Skip to content

fix!: a blank cell in an R-file table is NaN, not a fabricated 0.0 (edgartools-nfk3) - #1609

Merged
dgunning merged 1 commit into
mainfrom
fix/nfk3-blank-cells-are-not-zero
Oct 18, 2026
Merged

dgunning merged 1 commit into
mainfrom
fix/nfk3-blank-cells-are-not-zero

Conversation

@dgunning

Copy link
Copy Markdown
Owner

What

Report.to_dataframe() (via FinancialTableExtractor._parse_financial_value) reported every blank cell as 0.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.

  • Blank, N/A/NA, NM and 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.
  • Dashes — – ‒ - → still 0.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

  • Ground truth: Apple FY2025 10-K, accession 0000320193-25-000079, R7.htm (statement of shareholders' equity). The raw cells for "Common stock issued" are ['Common stock issued', ' ', '1,346', ' ', ' ']. Total is now NaN instead of 0.0, and "Common stock and additional paid-in capital" still reads 1,346,000,000. I read this live from SEC.
  • New test, 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.
    • The first "Common stock issued" row: Total is NaN, and paid-in capital is 752,000,000 as filed.
    • The frame has no zeros and 111 NaN cells.
    • The beginning-balance components still sum to the filed Total of $62,146M under pandas' default skipna.
    • The blank/dash split is pinned per marker.
    • 12 of the 19 tests fail against main's parser.
  • Suites: hatch run test-fast passed, 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() and xbrl/viewer.py, which delegates to it. Sums and means are unaffected because pandas skips NaN by default; only == 0 checks for blanks change.

Tool: Claude Code, Claude Opus 5.5.

🤖 Generated with Claude Code

…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>
@dgunning
dgunning enabled auto-merge (squash) October 18, 2026 13:59
@dgunning
dgunning merged commit fffaa98 into main Oct 18, 2026
10 checks passed
@dgunning
dgunning deleted the fix/nfk3-blank-cells-are-not-zero branch October 18, 2026 14:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant