Repository navigation
fix!: a blank cell in an R-file table is NaN, not a fabricated 0.0 (edgartools-nfk3) - #1609
Merged
Merged
Conversation
…dgartools-nfk3) FinancialTableExtractor._parse_financial_value returned 0.0 for an empty cell and a dash alike. A dash is how a financial table writes zero; an empty cell means the filing gives no value on that row. Across six filers' latest 10-K statements, 45% of parsed cells were blank and all read as zero. Blank, N/A, NM and footnote asterisks now return NaN. Dashes stay 0.0. Ground truth: Apple FY2025 10-K (0000320193-25-000079, R7) "Common stock issued" files a blank Total beside $1,346M of paid-in capital; Total is now NaN and the component still reads 1,346,000,000. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Report.to_dataframe()(viaFinancialTableExtractor._parse_financial_value) reported every blank cell as0.0. A dash is how a financial table writes zero, but a blank cell means the filing gives no value on that row. Across six filers' latest 10-K statements, 45% of parsed cells were blank, and every one of them read as zero.N/A/NA,NMand the footnote asterisks*/**→NaN. N/A, NM and the asterisks go beyond the bead's scope; "not applicable" and "not meaningful" aren't zero either.—–‒-→ still0.0.This is a 6.0 contract change, covered by a new section in
docs/upgrade/6.0.md(.fillna(0.0)brings back the old frame) and a changelog fragment.Verification
['Common stock issued', ' ', '1,346', ' ', ' ']. Total is nowNaNinstead of0.0, and "Common stock and additional paid-in capital" still reads 1,346,000,000. I read this live from SEC.tests/issues/regression/test_nfk3_blank_cells_are_not_zero.py(19 tests): it runs offline against the tracked Apple Q2 FY2025 10-Q R6 fixture.NaN, and paid-in capital is 752,000,000 as filed.NaNcells.skipna.hatch run test-fastpassed, with 42,557 passed and 0 failed.tests/meta(the docs checks) passed, 250 tests. The existing extractor tests (dhbg, yq1l, sgml) are unchanged and pass.Consumers:
Report.to_dataframe()andxbrl/viewer.py, which delegates to it. Sums and means are unaffected because pandas skips NaN by default; only== 0checks for blanks change.Tool: Claude Code, Claude Opus 5.5.
🤖 Generated with Claude Code