Skip to content

[Bug] SEC standardized statements: missing debt tag mappings, and operating income imputed as revenue #7634

Description

@eivanovski-lab

What's Wrong?

Two issues in the SEC standardized statements (openbb-sec 1.6.7), both found while migrating a dashboard onto equity.fundamental.balance / income.

1. balance_sheet.json is missing five tag spellings, so current_portion_of_long_term_debt and short_term_debt come back empty for issuers that use them.

current_portion_of_long_term_debt accepts only LongTermDebtCurrent, CurrentPortionOfLongTermDebt, CurrentPortionOfNoncurrentBorrowings, CurrentBorrowingsAndCurrentPortionOfNoncurrentBorrowings, CurrentPortionOfLongtermBorrowings. Issuers whose long-term debt line includes capital leases file the current half under LongTermDebtAndCapitalLeaseObligationsCurrent; the noncurrent twin LongTermDebtAndCapitalLeaseObligations is already mapped under long_term_debt, so only the current half was left out.

Total debt (short_term_debt + current_portion_of_long_term_debt + long_term_debt) against stockanalysis, latest quarterly balance:

openbb-sec 1.6.7 reference missed
XOM 32,229 M 42,368 M us-gaap:DebtCurrent = 10,139 M
KO 39,315 M 43,543 M us-gaap:LongTermDebtAndCapitalLeaseObligationsCurrent = 4,493 M
CVS 59,452 M us-gaap:DebtCurrent = 1,958 M
MU 5,140 M us-gaap:LongTermDebtAndCapitalLeaseObligationsCurrent = 582 M

Adding these names to the existing rows fixes all four (verified locally by appending to schema._statements["balance_sheet"] before the first request):

  • current_portion_of_long_term_debt: LongTermDebtAndCapitalLeaseObligationsCurrent, LongTermDebtCurrentMaturities, DebtCurrent
  • short_term_debt: NotesAndLoansPayable, OtherShortTermBorrowings

Each is a spelling of a quantity the schema already models, not a new quantity.

2. total_operating_income is imputed as total_revenue for issuers that publish no operating-expense subtotal.

source reads imputed-rollup: total_revenue(+) and the value equals total_revenue to the dollar, i.e. a 100% operating margin. Reproduced on XOM, O (Realty Income) and BRK-B, annual and quarterly, all periods. An operating income equal to revenue is never right; returning None would be more useful than a roll-up with nothing subtracted.

Steps to Reproduce

from openbb import obb

# 1 — missing current maturities
b = obb.equity.fundamental.balance(symbol="XOM", provider="sec", period="quarterly", limit=1).results[0]
print(b.short_term_debt, b.current_portion_of_long_term_debt, b.long_term_debt)
# None None 32229000000.0   — the issuer files us-gaap:DebtCurrent = 10,139 M at that date

# 2 — operating income equals revenue
i = obb.equity.fundamental.income(symbol="XOM", provider="sec", period="annual", limit=1).results[0]
print(i.total_revenue, i.total_operating_income)
# 332238000000.0 332238000000.0

Versions

openbb-sec 1.6.7, openbb-core 1.6.13, openbb-equity 1.6.2, Python 3.12, macOS.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions