6.1.0 broke balance sheet access in some cases vs 6.0.0
Issue Type
- [ ] Data Quality Issue (incorrect financial values, missing data)
- [ X] XBRL Parsing Issue (statement rendering, concept mapping)
- [X ] Filing Access Issue (download failures, attachment problems)
- [ ] Performance Issue (slow operations, memory problems)
- [ ] Compatibility Issue (platform/dependency conflicts)
- [ ] Documentation Issue (unclear instructions, missing examples)
Environment
EdgarTools Version: 6.1.0 Python Version: 3.15 Operating System: macOS
Bug Description
xbrl.statements.balance_sheet() produces balance sheets for any of the last 10 years under 6.0.0 and prior. Under 6.1.0 the same statement only produces column headers and an empty row for 2021-2023 for MTD. Possibly picking up the wrong statement?
Reproduction
Company/Ticker: MTD Time Period: 2021-2023 Relevant Forms: 10-K
Minimal code to reproduce:
"""
Minimal repro for edgartools bug:
xbrl.statements.balance_sheet().to_dataframe(view='standard')
returns only a header and degenerate row for
MTD's FY2021,2022, 2023 10-K, while other years return full line items.
"""
from edgar import Company, set_identity
TICKER = "MTD"
set_identity("Your Name [email protected]") # REQUIRED by SEC
company = Company(TICKER)
filings = company.get_filings(form="10-K", amendments=False).latest(10)
for filing in filings:
period = filing.period_of_report # e.g. "2021-03-31"
xbrl = filing.xbrl()
if xbrl is None:
print(f"{period}: NO XBRL DATA")
continue
bs = xbrl.statements.balance_sheet()
df = bs.to_dataframe(view="standard")
nrows, ncols = df.shape
status = "OK" if nrows > 2 else "Data missing <-- bug"
print(f"=== {period}: rows={nrows}, cols={ncols} [{status}]")
print(df.head(5).to_string())
print()
Additional Context
Add any other context about the problem here. Screenshots, related issues, etc.
This issue will be handled using EdgarTools' systematic issue resolution workflow. A reproduction test will be created to verify the fix.
Thanks for the clear repro — this was a regression in 6.1.0. MTD's FY2021–2023 10-Ks include a small role called "Statement of Financial Position, Classified" that only holds the Schedule II valuation table. A fix in 6.1.0 for companies whose income statement doesn't use the usual revenue concepts made the library accept that role as the balance sheet before it got to the real "Consolidated Balance Sheets". The fix keeps looking for the real statement first. All ten of MTD's recent 10-Ks return the full balance sheet again (FY2022 total assets 3,492,395K, matching the filing), and it'll be in the next release.