Skip to content

fix(cboe): a non-numeric settlement price is null - #7759

Open
artcashin wants to merge 2 commits into
openbq-org:developfrom
artcashin:fix/cboe-non-numeric-settlement-price
Open

artcashin wants to merge 2 commits into
openbq-org:developfrom
artcashin:fix/cboe-non-numeric-settlement-price

Conversation

@artcashin

Copy link
Copy Markdown
Contributor

Problem

derivatives.futures.settlements with options=True (provider cboe) fails on any day when the options settlement file has a cabinet trade. Those rows print CAB in the price column, so the price doesn't validate:

1 validation error for CboeFuturesSettlementsData
price
  Input should be a valid number, unable to parse string as a number [type=float_parsing, input_value='CAB', input_type=str]

One such row fails the whole request.

Change

_get_settlement_csv coerces the price column with to_numeric(errors="coerce"). A non-numeric price becomes null, and the row is kept with its symbol and expiration. The existing NaN-to-None purge in aextract_data handles the rest.

Tests

New tests/test_models.py::TestFuturesSettlements::test_non_numeric_price_is_null. It serves a two-row options CSV, one row with price CAB, through get_cboe_data, then checks the fetcher returns prices [0.7389, None].

The test fails without the change with the error above, and passes with it. The CBOE suite has no new failures. The 32 tests that fail in our environment, in test_options_analysis.py and test_cboe_router.py, fail on develop too.

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 futures options settlements widget on the CAB price. With it, the widget returned 888 rows, 45 of them with a null price.

Not included

Nothing else.

🤖 Generated with Claude Code

artcashin and others added 2 commits October 9, 2026 19:26
The futures options settlement file prints CAB in the price column for
cabinet trades. The column then reads as text and the row fails float
validation, so the whole options request failed. Settlement prices are
coerced to numbers, and a non-numeric price becomes null; the row is kept.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

This branch has not been deployed

No deployments
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.

2 participants