Skip to content

fix(sec): handle zero-value 13F holdings - #7679

Closed
bozarnr wants to merge 1 commit into
openbq-org:developfrom
bozarnr:fix/sec-form-13f-empty-filings
Closed

bozarnr wants to merge 1 commit into
openbq-org:developfrom
bozarnr:fix/sec-form-13f-empty-filings

Conversation

@bozarnr

@bozarnr bozarnr commented Sep 25, 2026

Copy link
Copy Markdown

Closes #7618.

get_13f_holding can receive valid filings whose reported holding value sums to zero. Guard the weight calculation so those records return a numeric 0.0 weight instead of dividing by zero.

Tests:

  • uv run --with pytest --with pandas --with beautifulsoup4 --with lxml --with xmltodict --with numpy --with-editable openbb_platform/core --with-editable openbb_platform/providers/sec pytest openbb_platform/providers/sec/tests/test_parse_13f.py -q
  • uv run ruff check openbb_platform/providers/sec/openbb_sec/utils/parse_13f.py openbb_platform/providers/sec/tests/test_parse_13f.py

Copilot AI lite review requested due to automatic review settings September 25, 2026 04:17
@CLAassistant

Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

Copilot AI 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.

Copilot review overview

🟢 Approval recommended

No unresolved review issues remain.

Review effort: Lite
Findings: None

What changed in this PR

Fixes SEC 13F parsing for valid zero-value filings by returning a numeric 0.0 weight.

Changes:

  • Guards weight calculation against division by zero.
  • Adds regression coverage for zero-value filings.
File Description
openbb_platform/​providers/​sec/​tests/​test_parse_13f.py Tests zero-weight parsing behavior.
openbb_platform/​providers/​sec/​openbb_sec/​utils/​parse_13f.py Handles zero total holdings safely.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@dlee-bq

dlee-bq commented Oct 19, 2026

Copy link
Copy Markdown
Contributor

Thanks for the PR, @bozarnr. However, I am closing because this was fixed in #7489.

@dlee-bq dlee-bq closed this Oct 19, 2026
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: empty filings (zero holdings) crash with ValidationError on weight

4 participants