Repository navigation
fix(nasdaq): keep a split whose ratio has no "a : b" form - #7760
Merged
dlee-bq merged 4 commits intoNov 28, 2026
Merged
Conversation
Nasdaq's splits calendar also lists percentage stock dividends, published with a ratio such as "5%". _split_ratio returns no numerator or denominator for those, but the standard model requires both, so one such row failed validation and the whole calendar request with it. The Nasdaq model makes numerator and denominator optional; the row keeps its published ratio_display. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
dlee-bq
requested changes
Oct 19, 2026
dlee-bq
left a comment
Contributor
There was a problem hiding this comment.
Thanks for the PR, @artcashin. I've highlighted a couple of items in the changed files. Please take a look.
… the percentage A ratio with no "a : b" form fell through to to_number(ratio), so "5%" gave split_ratio 5.0, which reads as 5-for-1. A percentage is now 1 + pct (1.05); any other unparsed ratio has a null split_ratio. The test asserts split_ratio. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Contributor
Author
|
Thanks, @dlee-bq, and apologies for the month this sat. Both points are fixed in b701659.
The Nasdaq suite passes, 530 tests (Python 3.12). One thing for you to decide: a |
dlee-bq
approved these changes
Nov 28, 2026
Merged
via the queue into
openbq-org:develop
with commit Nov 28, 2026
e4ca9ed
13 of 22 checks passed
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.
Problem
equity.calendar.splits(providernasdaq) fails for any window that includes a percentage stock dividend. Nasdaq lists those in the splits calendar with a ratio like5%, which has noa : bform._split_ratiocorrectly returns(None, None), but the standardCalendarSplitsDatarequiresnumeratoranddenominator. So the row fails validation, and the whole request fails with it.Change
NasdaqCalendarSplitsDatadeclaresnumeratoranddenominatorasfloat | None. A row whose ratio doesn't parse is kept: it has null numerator and denominator, and its published ratio inratio_display. Parsed ratios are unchanged.split_ratiofor such a row no longer falls back toto_number(ratio), which read5%as 5.0 (a 5-for-1 split). A percentage stock dividend is1 + pct, so5%gives 1.05. Any other ratio with noa : bform has a nullsplit_ratio.Tests
New
tests/test_models_calendars.py::TestCalendarSplits::test_keeps_a_row_whose_ratio_has_no_two_parts. It passes1 : 10,1-for-10,5%and3, and expects four rows: the first with1.0 / 10.0, the others with nulls and their published ratio. It also assertssplit_ratio: 0.1, null, 1.05, null.The test fails without the change and passes with it. The provider suite passes: 530 tests (Python 3.12).
Results from a deployment
We run this as an overlay on the 2.0.0 wheel in OpenBQ's Docker image. Before the change, a sweep of every widget failed the splits calendar on a split ratio it couldn't parse. With it, the widget returned 453 rows.
Not included
The standard model in
openbb_corestill requires both fields, so this only covers the Nasdaq provider.🤖 Generated with Claude Code