fix(sec_edgar): find capital expenditure reported as productive assets (#1370)

- Capital Expenditure also reads PaymentsToAcquireProductiveAssets, after the property and equipment tag
This commit is contained in:
David Arias, CFA
2026-09-23 12:28:52 -07:00
committed by GitHub
parent 2d17df8da1
commit c78fa86500
3 changed files with 19 additions and 1 deletions
+11
View File
@@ -237,3 +237,14 @@ def test_an_uninstalled_checkout_still_identifies_itself(monkeypatch):
monkeypatch.setattr(sec_edgar.metadata, "version", _missing)
assert "@" in sec_edgar._user_agent()
@pytest.mark.unit
def test_capital_expenditure_is_found_under_either_tag_filers_use(monkeypatch):
"""NVIDIA and Amazon report purchases of productive assets, not of property and equipment."""
facts = {"facts": {"us-gaap": {"PaymentsToAcquireProductiveAssets": {"units": {"USD": [
_fact("2024-12-31", 70_000_000, "2025-02-10", start="2024-01-01")]}}}}}
monkeypatch.setattr(sec_edgar, "_fetch_json",
lambda url: TICKER_MAP if "company_tickers" in url else facts)
out = sec_edgar.get_cashflow("AAPL", "annual", "2025-03-01")
assert [r for r in out.splitlines() if r.startswith("Capital Expenditure")] == ["Capital Expenditure,70"]