Repository navigation
Conversation
…verrides at the entry points A malformed display config key in init_sd or column_config_overrides should be rejected where it enters, with one ValueError that names each column and key, instead of being ignored by the styling guards or crashing somewhere unrelated. Covers the dataflow constructor (and the pandas and polars widgets through it), and /load and /load_expr, which should answer 400 invalid_display_config. Unknown keys stay accepted: init_sd entries also carry summary stats, and hosts set override keys like header_name that the override type doesn't list. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: b7b6ffa82f
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| with pytest.raises(ValueError, match=key): | ||
| ACDFC(BASIC_DF, init_sd=init_sd) |
There was a problem hiding this comment.
Add the validator exercised by these test cases
This commit changes only tests, while CustomizableDataflow.__init__ still accepts these values unchanged and DefaultMainStyling deliberately ignores a non-dict ag_grid_specs. Consequently this first parametrized case (and several of the new widget and HTTP expectations) fails with “DID NOT RAISE” rather than ValueError, so the proposed commit leaves the test suite red. Include the entry-point validation and server error mapping in the same change, rather than landing the intentionally failing tests alone.
Useful? React with 👍 / 👎.
📦 TestPyPI package publishedpip install --index-strategy unsafe-best-match --index-url https://test.pypi.org/simple/ --extra-index-url https://pypi.org/simple/ buckaroo==0.15.8.dev36771714737or with uv: uv pip install --index-strategy unsafe-best-match --index-url https://test.pypi.org/simple/ --extra-index-url https://pypi.org/simple/ buckaroo==0.15.8.dev36771714737MCP server for Claude Codeclaude mcp add buckaroo-table -- uvx --from "buckaroo[mcp]==0.15.8.dev36771714737" --index-strategy unsafe-best-match --index-url https://test.pypi.org/simple/ --extra-index-url https://pypi.org/simple/ buckaroo-table📖 Docs preview🎨 Storybook preview |
… points validate_display_config checks that each display config key styling reads holds its type's shape: displayer_args, ag_grid_specs, color_map_config, tooltip_config and column_config_override are dicts, delete_keys a list of str (a bare str still means the one key), highlight_* strings, merge_rule 'hidden'. Everything wrong goes into one DisplayConfigError (a ValueError) naming the column and key. Unknown keys pass: init_sd entries carry summary stats, and overrides are merged straight over the column config. CustomizableDataflow.__init__ runs it first, which covers the pandas and polars widgets, /load and the xorq dataflow. /load and /load_expr also run it before touching the session and answer 400 invalid_display_config with the problems. The guards in DefaultMainStyling.style_column stay for values a ColAnalysis adds. Closes #979 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Note for later work on this, not a blocker.
What
Nothing breaks today: the runtime check here only looks at display config keys and passes stat values through, and the sd travels as a plain dict. But whoever widens 🤖 Generated with Claude Code |
Closes #979. Runtime half of #978.
Most display config never passes a type checker: it comes from notebook calls, JSON on the wire, and project files loaded through
exec. Since #977 the base styling ignores the two malformed values it knows about (a non-dictag_grid_specs, a non-listdelete_keys). That keeps the column styled, but a typo now does nothing and says nothing. Others still crash in places that don't mention the config at all: a column entry that isn't a dict fails with'str' object has no attribute 'get', and a non-dictinit_sdfails with a baredictionary update sequenceerror.CustomizableDataflow.__init__now checksinit_sdandcolumn_config_overridesbefore anything else runs. The widgets (pandas and polars),/load,/load_exprand the xorq dataflow all construct through it. Every known display config key has to hold its type's shape:displayer_args,ag_grid_specs,color_map_config,tooltip_configandcolumn_config_overrideare dictsdelete_keysis a list of str. A bare'tooltip_config'is still accepted as the one key, since the intent is unambiguous.highlight_regexandhighlight_colorare str, andhighlight_phraseis a str or a list of strmerge_ruleis'hidden', the only value that does anythingAnything wrong raises one
ValueErrorlisting every problem with its column and key, so fixing a config doesn't take a round trip per typo. Unknown keys are left alone. Aninit_sdentry also carries summary stats, and hosts put keys the override type doesn't list, such asheader_name, intocolumn_config_overrides./loadand/load_exprrun the same check before touching the session or loading data. A bad config is a 400invalid_display_configwith the message and aproblemslist, not a 500 or a 200 with the key silently dropped.The point-of-use guards in
DefaultMainStyling.style_columnstay. Entry validation can't see a value aColAnalysiscontributes to the sd from inside the pipeline.The first commit adds the failing tests; the fix follows once CI has shown them failing.
🤖 Generated with Claude Code