edgartools icon indicating copy to clipboard operation
edgartools copied to clipboard

BDC: since 5.62.0, `from_xbrl` keeps PhenixFIN's per-company subtotals as holdings (+$289.5M on a $301.6M book)

Open mmitc opened this issue 1 month ago • 0 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: 5.62.0, and main at 8cd5799f (compared with 5.61.1) Python Version: 3.12.13 Operating System: Windows 11

Bug Description

What you expected to happen: PortfolioInvestments.from_xbrl on PhenixFIN's Q2 2026 10-Q keeps each holding once, so the kept rows sum to about the book the filing states: its three top-level category rows (Non-Controlled/Non-Affiliated, Affiliated, Controlled) sum to exactly $301,637,310.

What actually happened: The kept rows sum to $1,090,825,316 on 5.62.0, up from $801,330,546 on 5.61.1. The "row states its own cost" rule from #1505 / #1506 is the change. PhenixFIN tags each company subtotal with the same fair value, cost and principal as its only holding, so every such subtotal now has its own cost over one extending row and is kept:

version kept rows kept fair value kept rows that are a prefix of another kept row
5.61.1 67 $801,330,546 2
5.62.0 83 $1,090,825,316 18 ($425,958,519)
main 8cd5799f 84 $1,091,046,941 18 (the extra row is the #1504 loan, +$221,625, correct)

Nothing 5.61.1 kept is dropped; all 16 added rows are subtotals. The largest kept prefix rows (fair value / cost):

Non-Controlled/Non-Affiliated Investments                               136,419,212 / 133,498,823
Controlled Investments                                                  128,535,521 / 155,112,950
Controlled Investments - NSG Captive, Inc.                               58,515,918 /  55,729,376
Affiliated Investments                                                   36,682,577 /  38,802,355
Non-Controlled/Non-Affiliated Investments - JFL-NGS-WCS Partners, LLC    14,000,000 /  10,000,000
Affiliated Investments - FST Holdings Parent, LLC                        12,956,608 /  10,008,289

Keeping the subtotals also stops "Controlled Investments" and "Affiliated Investments" being recognised as totals, though they carry many extending rows. reported_total_fair_value is None for this filing (no undimensioned InvestmentOwnedAtFairValue at 2026-06-30), so nothing in the result flags the gap.

Error message (if any):

None.

Reproduction

Company/Ticker: PFX (PhenixFIN Corp) Time Period: quarter ended 2026-06-30 Relevant Forms: 10-Q, accession 0001213900-26-085667

Minimal code to reproduce:

from edgar import set_identity, find
from edgar.bdc.investments import PortfolioInvestments

set_identity("Your Name [email protected]")
held = PortfolioInvestments.from_xbrl(find("0001213900-26-085667").xbrl(), period="2026-06-30")
print(len(held), sum(i.fair_value or 0 for i in held), held.reported_total_fair_value)
# 5.62.0: 83 1090825316.0 None      (5.61.1: 67 801330546.0 None)

ids = [i.identifier for i in held]
parents = [i for i in held if any(o != i.identifier and o.startswith(i.identifier) for o in ids)]
print(len(parents), sum(i.fair_value or 0 for i in parents))   # 18 425958519.0

Additional Context

I raised this on #1506 after it merged; this issue gives it a number of its own.

A narrower rule fixes ARCC's Proofpoint without this: with one extending row, exclude the parent unless its cost differs from that row's cost (a cost-less parent stays excluded, as before #1506). Over the 46 BDC filings I re-parsed earlier, that variant moved only Proofpoint. Adding "or the coupons differ" also restores ARCC's Nordic Ferry and PumpTech pairs, which share cost with their sibling. You mentioned a PR measured against the BDC set would be welcome for 6.0; I'm happy to send one with a PFX regression test if this direction suits.

One more PhenixFIN defect, older than #1506 and separate from it: 5.61.1 already kept the $136.4M "Non-Controlled/Non-Affiliated Investments" total, and FlexFIN's $35.3M equity is kept twice (as Controlled Investments - FlexFIN, LLC - ... Equity Interest and as bare FlexFIN, LLC). The kept leaf rows sum to $664.9M on all three versions. I can file that separately if you prefer.


Generated by Claude Code

mmitc avatar Oct 17 '26 01:10 mmitc