Skip to content

SEC 13F-HR: '&' silently dropped from issuer names (S&P500 -> SP500) - #7627

Open
ojassharma7 wants to merge 2 commits into
OpenBB-finance:developfrom
ojassharma7:autocontrib/issue-7619
Open

SEC 13F-HR: '&' silently dropped from issuer names (S&P500 -> SP500)#7627
ojassharma7 wants to merge 2 commits into
OpenBB-finance:developfrom
ojassharma7:autocontrib/issue-7619

Conversation

@ojassharma7

Copy link
Copy Markdown

Fixes #7619.

What changed

  • openbb_platform/providers/sec/openbb_sec/utils/parse_13f.py
  • openbb_platform/providers/sec/tests/test_parse_13f.py

Verification

The project's own test suite was run before and after this change; it introduces no new test failures or lint violations.

@CLAassistant

CLAassistant commented Aug 4, 2026

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

@anujbolewar anujbolewar left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The root cause is clear — recover-mode parsing drops character entities such as the ampersand entity inside SGML, so reassembling the well-formed nested blocks under a synthetic root is the correct fix. Worth also asserting on an ampersand that appears inside an attribute value, since the block extraction only strips top-level declarations, and confirm the no-block fallback still parses the original text unchanged.

Extract prepare_13f_xml and add regressions for '&' inside attribute
values and for filings with no <XML> wrappers (original text unchanged).

Co-authored-by: Cursor <cursoragent@cursor.com>
@ojassharma7

Copy link
Copy Markdown
Author

Thanks @anujbolewar — addressed in the latest commit.

  • Extracted prepare_13f_xml so the block-extraction path is testable
  • Assert &amp; inside an attribute value survives (only top-level XML decls are stripped)
  • Confirm the no-<XML>-block fallback returns the original text unchanged and still parses

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

SEC 13F-HR: '&' silently dropped from issuer names (S&P500 -> SP500)

3 participants