Repository navigation
Conversation
|
|
There was a problem hiding this comment.
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.
Contributor
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.
Closes #7618.
get_13f_holdingcan receive valid filings whose reported holding value sums to zero. Guard the weight calculation so those records return a numeric0.0weight 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 -quv run ruff check openbb_platform/providers/sec/openbb_sec/utils/parse_13f.py openbb_platform/providers/sec/tests/test_parse_13f.py