fix(bdc): a company the filer tags as a member is not stripped as a prefix (#1373) - #1375
Merged
Merged
Conversation
…refix (dgunning#1373) On "<Company> | <Industry> | <Instrument>" identifiers, a filer that also tags the company as a member puts its label in the candidate set, and _match_company_candidate's prefix loop stripped it as a grouping, then the industry, and returned the residue before the instrument cut: "First Lien", "Ordinary Shares", "9.1%". The no-candidate parse named the company. A candidate that fills the whole first pipe segment is now returned as the company. A segment holding an instrument or a portfolio category is still a prefix: SLRC tags its headings ("Senior Secured Loans") as members. Measured over the latest schedule of 42 BDCs (18,949 identifiers, each parsed with its filing's own member candidates, as from_xbrl does): 401 names move (CSWC 155, PSEC 142, TPVG 58, ARCC 24, BBDC 14, OCSL 4, NMFC 3, OTF 1), every one from an instrument to the company; no investment_type moves, and no other filer changes. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #1373.
On
<Company> | <Industry> | <Instrument>identifiers, a filer that also tags the company as a member puts its label among the member candidates._match_company_candidate's prefix loop then stripped it as a grouping, stripped the industry, and returned the residue before the instrument cut:First Lien,Ordinary Shares,9.1%. The same parse with no candidates named the company.from_xbrlpasses the filing's candidates, socompany_namecarried the instrument.Fix. In the prefix loop, a candidate that fills the whole first pipe segment is returned as the company. The check stays out of the way when that segment holds an instrument or a portfolio category (
_known_investment_type_matches,_PORTFOLIO_CATEGORY_RE), because SLRC tags its headings (Senior Secured Loans,Common Equity/Equity Interests/Warrants) as members too. On SLRC's latest 10-Q that exception applies to 85 identifiers, all heading-led, which #1374 handles.Measured over the latest 10-Q/10-K schedule of 42 BDCs (18,949 identifiers). Each was parsed with its own filing's member candidates, as
from_xbrldoes, before and after. 401 names move, every one from an instrument to the company. Noinvestment_typemoves, and the other 34 filers are unchanged:First Lien→AAC New Holdco Inc.First Lien→Abacus Dermatology Management, LLCPreferred Stock→Ao1 Holdings, Inc.Series G→Aerin Medical Inc.9.1%→Jocassee Partners LLCFirst Lien→Thrasio, LLCClass B-1→TVG-Edmentum Holdings, LLCSeries D→HARNESS INC.Every moved name equals the identifier's first pipe segment, with a trailing comma dropped in three ARCC rows (
Vamos Bidco, Inc.,→Vamos Bidco, Inc.).Tests.
tests/issues/regression/test_issue_1373.py, offline, covers the four identifiers from the issue, each with its own company as the one candidate, plus the issue'sfrom_xbrlrepro on a stub XBRL.tests/bdcandtests/issues/regression(not slow or network) show the same 13 failures onmainin this Windows environment: filing-text baselines, legacy-parser lookups and #1325's import-ordering test. There are no new failures.Composes with #1374 (the fix for #1372): merged together, the 42-filer run moves exactly the union of the two.
🤖 Generated with Claude Code