edgartools icon indicating copy to clipboard operation
edgartools copied to clipboard

Missing Balance Sheet data for certain filings

Open mpreiss9 opened this issue 1 year ago • 2 comments

Issue Type

  • [X ] Data Quality Issue (incorrect financial values, missing data)
  • [ ] XBRL Parsing Issue (statement rendering, concept mapping)
  • [ ] 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: 4.29.0 Python Version: 3.13.9 Operating System: macOS 14.0

Bug Description

In rare cases only a fragment of a balance sheet is being provided. It looks like maybe other tables are being mistaken for the whole balance sheet by the algorithm that selects statements. What actually happened: For example, for WST-2015 the entire BS consists of 3 items with the following concepts: us-gaap_PensionAndOtherPostretirementDefinedBenefitPlansCurrentLiabilities us-gaap_PensionAndOtherPostretirementDefinedBenefitPlansLiabilitiesNoncurrent us-gaap_PensionAndOtherPostretirementDefinedBenefitPlansLiabilitiesCurrentAndNoncurrent

For BSX the BS consists of these concepts only: us-gaap_CommonStockParOrStatedValuePerShare us-gaap_CommonStockSharesAuthorized us-gaap_CommonStockSharesIssued us-gaap_CommonStockSharesOutstanding us-gaap_PreferredStockParOrStatedValuePerShare us-gaap_PreferredStockSharesAuthorized us-gaap_PreferredStockSharesIssued us-gaap_PreferredStockSharesOutstanding us-gaap_TreasuryStockShares

Reproduction

**Company/Ticker:BSX from 2015 to 2019, WST from 2015 to 2018 **Time Period: pre-2020 **Relevant Forms: 10-K

Minimal code to reproduce:

# Paste the minimal code that reproduces the issue
from edgar import Company

bs_curr_df = current.balance_sheet().get_dataframe()


## 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.*

mpreiss9 avatar Nov 23 '25 01:11 mpreiss9

Thanks for the detailed report @mpreiss9! This is classified as P0 CRITICAL due to data accuracy impact on balance sheets.

Classification: CRITICAL

Release Type: Point Release 4.30.1
Timeline: 1-2 days (target: within 48 hours)
Priority: HIGHEST
Beads Issue: edgartools-lmy

Rationale: This meets critical bug criteria because:

  • ✅ Data accuracy issue - Balance sheets returning fragments instead of complete statements
  • ✅ Core functionality impaired - One of three primary financial statements providing wrong data
  • ✅ Silent failure - No error raised, users receive incomplete data thinking it's complete
  • ✅ Mission violation - Contradicts EdgarTools' core principle: "Accurate financials: Data reliability is non-negotiable"

Root Cause Hypothesis

Based on code analysis of edgar/xbrl/statement_resolver.py:

  • The _match_by_content() method may be matching partial disclosure tables (pension benefits, equity details) that contain SOME balance sheet concepts
  • These partial tables may score higher than the actual complete balance sheet presentation role
  • Confidence threshold (0.4 minimum) may be too permissive for financial statements

Next Steps

  1. Reproduction Tests (4 hours)

    • Create reproduction tests for WST-2015, BSX-2015, BSX-2019
    • Inspect all presentation roles to identify correct vs incorrect matches
  2. Root Cause Analysis (4 hours)

    • Analyze why partial tables score higher than complete balance sheets
    • Identify pattern across affected filings
  3. Fix Implementation (2-4 hours)

    • Add stricter balance sheet matching criteria (require ALL key concepts)
    • Increase confidence thresholds for financial statements
    • Add validation heuristics (e.g., minimum line item count)
  4. Testing & Validation (2-4 hours)

    • Regression tests for reported cases
    • Batch test on pre-2020 filings to assess scope
    • Ensure fix doesn't break other companies

Tracking

  • Beads Issue: edgartools-lmy (P0 CRITICAL)
  • ROADMAP: Will be added to "Pending Point Release 4.30.1" section
  • Related: Issue #504 may be related - investigating together

We'll keep you updated on progress. This is top priority.

dgunning avatar Nov 23 '25 16:11 dgunning

I haven't looked at your code for identifying Balance Sheets, but I've never seen one that didn't have the simple xbrl tag 'Assets'. While there may be other reports in a filing that have that tag, I'd presume that if it's missing it can't be a Balance Sheet. On the other hand there always seem to be exceptions to the other tags, even total liabilities and so on, so although they can help raise the score they can't be exclusionary tests.

mpreiss9 avatar Nov 23 '25 19:11 mpreiss9