edgartools icon indicating copy to clipboard operation
edgartools copied to clipboard

[DATA] PortfolioInvestments.from_xbrl() cuts "High" off "High Street Buyer, Inc." when the filer labels srt:MaximumMember "High"

Open mmitc opened this issue 2 months ago • 1 comments

Data Quality Issue Details

Issue Type:

  • [x] Incorrect financial values (wrong numbers)
  • [ ] Missing financial data (expected data not present)
  • [ ] Calculation errors (formulas producing wrong results)
  • [x] Data inconsistency (different values for same metric)
  • [ ] Historical data problems (changes over time)

Environment

EdgarTools Version: 5.58.0 Python Version: 3.14.3 Operating System: Windows 11

Financial Data Details

Company/Ticker: BXSL (Blackstone Secured Lending Fund, CIK 1736035) Form Type: 10-K and 10-Q Filing Date/Period: FY2025 10-K 0001736035-26-000004; Q2 2026 10-Q 0001736035-26-000016 Statement Type: Schedule of Investments (PortfolioInvestments.from_xbrl)

Specific Metric/Concept:

  • Financial line item: PortfolioInvestment.company_name (and .industry)
  • XBRL concept name: us-gaap:InvestmentIdentifierAxis members

Data Issue

Expected Value:

  • company_name == 'High Street Buyer, Inc. 2', industry is None
  • Source: the filing's own Investment Identifier member is High Street Buyer, Inc. 2 | Non-Affiliated Issuer. parse_investment_identifier(identifier, member_candidates=...) on the same string, with the same filing's candidates, returns High Street Buyer, Inc. 2.

Actual Value from EdgarTools:

  • company_name == 'Street Buyer, Inc. 2', industry == 'High', industry_source == 'identifier'
  • Four positions per filing (High Street Buyer, Inc. 1 to 4), on both filings above: 8 rows naming a company that does not exist.

How obtained: PortfolioInvestments.from_xbrl(filing.xbrl()), then compared every row's company_name with parse_investment_identifier(row.identifier, member_candidates=_get_investment_member_candidates(xbrl)).company_name. 674 positions on the 10-K, 703 on the 10-Q; exactly the four High Street Buyer rows differ on each.

Cause (read from 5.58.0's source): _fill_industries (edgar/bdc/investments.py, the 5.58.0 industry fill) asks identifier_industry with candidates from _get_investment_member_candidates, which admits every element in xbrl.element_catalog ending in member, from every taxonomy and every label role. BXSL heads its interest-rate range table with srt:MaximumMember labelled High and srt:MinimumMember labelled Low in its own label linkbase (CGBD does the same; ARCC, HTGC, TRIN and TSLX keep Maximum/Minimum, which would cut a borrower opening with either word just the same). _industry_before_company trusts a single-word span when it is in the candidate set, so High is read as a schedule grouping and _fill_industries slices it off the front of company_name. The members of srt:RangeAxis bound a range, never a company or an industry, so they have no business in the candidate set.

Code to reproduce (offline, no network):

from decimal import Decimal
from types import SimpleNamespace
from edgar.bdc.investments import PortfolioInvestments

def fact(identifier, value=Decimal('77686000')):
    return {'concept': 'us-gaap:InvestmentOwnedAtFairValue', 'value': value,
            'numeric_value': float(value), 'period_instant': '2025-12-31',
            'period_type': 'instant', 'unit_ref': 'usd',
            'dim_us-gaap_InvestmentIdentifierAxis': identifier}

facts = [fact('High Street Buyer, Inc. 2 | Non-Affiliated Issuer')]
# srt:MaximumMember as BXSL's element catalog carries it: label "Maximum [Member]", terseLabel "High"
maximum = SimpleNamespace(labels={'http://www.xbrl.org/2003/role/label': 'Maximum [Member]',
                                  'http://www.xbrl.org/2003/role/terseLabel': 'High'})
for catalog in ({}, {'srt_MaximumMember': maximum}):
    xbrl = SimpleNamespace(facts=SimpleNamespace(get_facts=lambda: facts), element_catalog=catalog)
    inv = PortfolioInvestments.from_xbrl(xbrl)[0]
    print(bool(catalog), repr(inv.company_name), repr(inv.industry), inv.industry_source)

Output at 5.58.0:

False 'High Street Buyer, Inc. 2' None None
True 'Street Buyer, Inc. 2' 'High' identifier

The live filing gives the same four rows:

from edgar import Filing
from edgar.bdc.investments import PortfolioInvestments
f = Filing(cik=1736035, company="Blackstone Secured Lending Fund", form="10-K",
           filing_date="2026-02-25", accession_no="0001736035-26-000004")
for inv in PortfolioInvestments.from_xbrl(f.xbrl()):
    if inv.identifier.startswith("High Street"):
        print(repr(inv.identifier), repr(inv.company_name), repr(inv.industry))

Cross-Verification

  • [x] Multiple time periods for same company (10-K FY2025 and 10-Q Q2 2026, 4 rows each)
  • [x] Multiple companies with same issue — checked 12 filings across ARCC, BXSL, CGBD, HTGC, TRIN and TSLX at 5.58.0 (8,212 positions): the 8 BXSL rows are the only ones affected today. CGBD also labels the members High/Low and every filer carries Maximum/Minimum, so the mechanism is not BXSL-specific.
  • [x] Direct SEC filing comparison — the Investment Identifier member text in the filing is High Street Buyer, Inc. 2 | Non-Affiliated Issuer.

Affects multiple periods/companies? Any filer using srt:RangeAxis with a borrower whose name opens with the word the filer labels the range bound (High, Low, Maximum, Minimum). 5.57.0 returned the full name; the cut arrived with 5.58.0's industry fill.

Expected Behavior

company_name should stay High Street Buyer, Inc. 2 and industry should stay None (BXSL tags no industry for these rows). The five srt:RangeAxis members (MaximumMember, MinimumMember, WeightedAverageMember, ArithmeticAverageMember, MedianMember) should not be member candidates, whatever the filer labels them.

I have a fix with an offline regression test ready and will open a PR against this issue. Measured on the 12 filings above, excluding those five members moves exactly the 8 BXSL rows and nothing else. (Dropping every standard-taxonomy member instead moved 82 rows and broke 70 of HTGC's, whose parse leans on us-gaap:WarrantMember and us-gaap:EquitySecuritiesMember labels, so that is not the fix.)

Impact Assessment:

  • [ ] Minor (affects specific edge case)
  • [x] Moderate (affects common use cases)
  • [ ] Major (affects core financial calculations)
  • [ ] Critical (produces completely wrong results)

mmitc avatar Sep 12 '26 17:09 mmitc

Excellent diagnosis. The mechanism is exactly right: srt:RangeAxis members are dimension qualifiers for a range, not entity or industry identifiers, so they have no business being in the candidate set regardless of what a filer labels them in their own linkbase.

Two things worth noting for the fix:

1. The five members you listed are the complete set. srt:RangeAxis in the SEC's Standard Taxonomy contains exactly MinimumMember, MaximumMember, ArithmeticAverageMember, WeightedAverageMember, and MedianMember. Your exclusion list is exhaustive, not a partial patch.

2. The pattern generalizes. Any member-candidate set built from "element ends in member" is vulnerable to filer-specific terseLabel overrides. BXSL happens to label srt:MaximumMember as "High", but a filer could just as easily relabel a custom axis member to "Schedule", "Portfolio", or any other word that a borrower name might start with.

Your targeted fix is the right call for this issue — a whitelist-of-axes rewrite would be a larger change with real risk. But it might be worth a separate issue to note that label-based member matching is inherently fragile, and that the axis QName is the only reliable signal.

Your measurement approach (12 filings, 8 rows affected, nothing else moved) is the kind of evidence that makes a fix reviewable in one pass. Thanks for doing that work.

DOMCHURCH avatar Sep 12 '26 22:09 DOMCHURCH