Repository navigation
Conversation
…ling (#983) A display klass that calls getattr (not in the sandbox builtins) compiles and loads fine, then raises on every column once styled. Rendering falls back to DefaultMainStyling and logs, so nothing tells the host the class is broken. check_styling(klass, sd, df) should report each column whose most specific style_column raises or returns a non-config, with the column, orig_col_name, the class and the exception, and leave the sd alone. compile_display_source should run source text through the display loader's sandbox and raise where the loader would log and skip. SAFE_BUILTIN_NAMES gives hosts the builtins list for error messages. The new tests reach these names through the module, so each one fails on its own instead of taking down the files' existing tests at collection. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…errides default_styling (#983) With no style_column override, rendering goes straight to default_styling, so that's what check_styling has to try first. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
📦 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.dev36771686771or 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.dev36771686771MCP server for Claude Codeclaude mcp add buckaroo-table -- uvx --from "buckaroo[mcp]==0.15.8.dev36771686771" --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 |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 83cb2bc330
ℹ️ 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".
|
|
||
|
|
||
| def test_compile_display_source_returns_display_klasses(): | ||
| klasses = xorq_loading.compile_display_source(MINIMAL_DISPLAY, "my_display") |
There was a problem hiding this comment.
Add the APIs exercised by the new tests
compile_display_source is not defined in buckaroo.server.xorq_loading at this commit (nor are SAFE_BUILTIN_NAMES or styling_core.check_styling added anywhere), so this and the other newly added tests fail with AttributeError rather than validating the described feature. Implement the production APIs in the same change, or defer these tests until that implementation is included.
Useful? React with 👍 / 👎.
…o vet display klasses (#983) compile_display_source(source, name) runs source text through the display loader's sandbox and raises where load_project_display_klasses logs and skips. Both go through _exec_display_source; _compile_project_display keeps its signature for tallyman's prototype. check_styling(klass, sd, df) tries every column style_columns would style and returns a StylingFailure per column whose most specific style_column raises or returns a non-config (default_styling when nothing overrides style_column). It shares the MRO walk (_style_column_chain) and column enumeration (_columns_to_style) with the render path, which is unchanged. _SAFE_BUILTIN_NAMES becomes SAFE_BUILTIN_NAMES. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Closes #983.
A host that registers project display klasses has no way to find out whether a class works short of rendering a table, and rendering doesn't say either.
style_column_with_fallbackcatches the exception, logs it and falls back to the parent class. A class that callsgetattr, which isn't in the sandbox builtins, loads fine and then loses its styling on every column. Loading has the same gap:load_project_display_klasseslogs and skips a file that fails to exec, and the only path that raises takes a file path.This adds three things.
compile_display_source(source, name)inserver/xorq_loading.pyruns source text through the display loader's sandbox (same builtins, same injected base classes) and raises where the loader would skip. The loader and this function now share_exec_display_source.namestands in for the file stem and has to be an identifier, since the loader would skip it otherwise._compile_project_display(path, ...)keeps its signature, because tallyman's prototype calls it.check_styling(klass, sd, df)indataflow/styling_core.pytries each column thatstyle_columnswould style and returns aStylingFailure(col, orig_col_name, klass, exc)for each one that fails. It doesn't stop at the first failure and doesn't modify the sd. It shares the MRO walk (_style_column_chain) and the column enumeration (_columns_to_style) with the render path, so both paths agree on which columns get styled and in what order.A failure means the most specific
style_columnraised or returned something that isn't a column config, even when a parent's would have worked. The point is to catch a class that silently loses its own styling, and that's the case where the fallback hides it.klasson the failure is the class that defines thestyle_columnthat raised, which is a parent when the checked class inheritsstyle_column. A class that doesn't overridestyle_columnat all is checked against itsdefault_styling, since that's what rendering reaches first. Passing something that isn't aStylingAnalysissubclass raisesTypeError.SAFE_BUILTIN_NAMESis the builtins list under a public name, for hosts to quote in error messages. Nothing in the repo used the underscored name, so there's no alias.Rendering is unchanged: a failing class still falls back to its parent.
The first commit adds the failing tests; the fix follows once CI has shown them failing.
🤖 Generated with Claude Code