Repository navigation
fix(institutional): accept fractional insider share totals - #399
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (4)
Included review availability: 0 reviews are currently available. Your included PR review attempts over the past 7 days set your current allowance at 1 review per hour. WalkthroughThe change updates both insider-statistics models to preserve fractional share totals. It adds synchronous and asynchronous regression coverage for multirow responses, validation, serialization, and invalid fractional transaction counts. ChangesInsider-statistics fractional totals
Priority: ➖ Normal Estimated code review effort: 3 (Moderate) | ~20 minutes Change: Bug fix · Severity of issue fixed: Medium Merge Risk: ⚪ Minimal · up to Fractional insider-share totals are supported across both models and client paths while transaction counts remain integer-validated. The change is ready to merge. 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
Full details: Docstring CoverageExplanation Docstring coverage is 11.11% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 9 functions across 3 files. (1 skipped: 1 unsupported.)
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
🧪 Generate unit tests (beta)
Comment |
|
Quoting #399 (comment) No action — the walkthrough matches the diff; there are no line-level findings. The docstring-coverage warning is declined: the touched functions are parameterized regressions, and the model fields already carry |
Fractional share totals in successful insider-statistics responses currently raise Pydantic validation errors. A fractional historical row can therefore prevent either sync or async client from returning a valid first row.
Change
total_acquiredandtotal_disposedtofloatin bothInsiderStatisticandInsiderTradingStatistics, preserving the reported quantities without explicit rounding. Transaction counts remain integers, aliases and validation stay intact, and both public methods keep returning the first validated row. Update the integration type assertions and Unreleased changelog.Closes #395
Verification (Python 3.12.12, Pydantic 2.13.5, uv 0.12.13):
int_from_floaterrors and sync/async multirow response processing..venv/bin/pytest tests/unit/test_insider_statistics_fractional.py tests/unit/test_institutional.py tests/unit/test_async_clients.py: 319 passed, including all 38 new regressions. Covers both issue-provided NVDA rows, MSFT/AVGO fractional quantities, whole/zero totals, JSON aliases, integer counts, retained historical rows, and rejection of malformed historical rows.CI=true make ci: all 7 nox sessions passed (lint, full typing, security audit, core coverage, extras coverage, import smoke, and aggregator). Combined core coverage 92.24%; extras coverage 88.15%. Core runs: 2,585 passed / 300 skipped / 8 deselected each; MCP run: 286 passed / 9 skipped; extras run: 3,090 passed / 9 skipped.FMP_VCR_RECORD=none .venv/bin/pytest tests/integration/test_institutional.py: 31 skipped because replay cassettes are unavailable. No live-provider acceptance is claimed.The initial parallel
make cirun hit the existingtest_a_second_plain_handler_sees_masked_extrastest-order problem (empty INFO log after an earlier fixture configures ERROR). Reproduced on an archive of unchanged dev75c7592by runningtests/unit/test_institutional.pyfollowed by that logger test: 49 passed, 1 failed. The logger test passes in isolation. No logger changes are included.Package publication and downstream upgrade remain release follow-up work. This PR targets
dev; it does not publish a release.Summary by CodeRabbit
New Features
Bug Fixes