Repository navigation
Conversation
…he expression it came from (#1092) Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Contributor
📦 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.10.dev37800307589or 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.10.dev37800307589MCP server for Claude Codeclaude mcp add buckaroo-table -- uvx --from "buckaroo[mcp]==0.15.10.dev37800307589" --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 |
…he expression it came from (#1092) Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…ry-over and failed-load release (#1092) Failing tests for review findings on #1093: - a stat source is loaded with the session's cache_dir on /load_expr and /reload_expr - an identical re-POST of stat_sources/column_stat_sources takes the warm exit - a re-POST that omits them keeps them; one that sends null clears them - a load that fails after the stats ran releases the session's and the sources' memtables Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…xit, carry over and release on a failed load (#1092) - A stat source's build loads (and heals) in its spec's cache_dir, else the session's, on /load_expr and /reload_expr, so its stat queries read the embedder's snapshots instead of recomputing them under ~/.cache/xorq. - stat_sources/column_stat_sources leave the truthiness has_config tuple and are compared with the session's, so an identical re-POST takes the warm exit. - They carry over like data_id for the same build; sending null clears them. - A failed /load_expr releases the session expression's and the sources' memtables on both the 400 and 500 paths; a failed /reload_expr releases the new set. - StatSourceSet.from_fields replaces the three copies of the 'either field set' check. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Collaborator
Author
Review passA Fixed in 97d6e64
Open
🤖 Generated with Claude Code |
This branch was successfully deployed
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.
/load_exprtakes two new fields,stat_sourcesandcolumn_stat_sources, so a column's summary stats can be computed over the expression the column came from instead of over the loaded expression. A compare grid that loads an outer join of V1 and V2 can then show V2's ownlength,null_count,distinct_perand histogram forprice_v2, not the join's.Change
stat_sourcesnames expressions by the fields that would load each as a session of its own (build_dir, and optionallydata_id,cache_storage_path,project_root).column_stat_sourcesmaps a column of the session's expression to a list of{source, column, prefix?}.XorqDataflow._get_full_sd. Mapped columns join the skip set, so no stat query touches them in the raw, cleaned or filtered scope. Each source then gets its ownXorqStatPipeline.process_table(<source expr>, stat_columns=…, scope_id=make_scope_id(<source data_id>))against the source'scache_storage_path. Cells already there are hits, missing ones are computed over the source column and written to the source's cache, where the source's own grid finds them later. There is no fallback to the session's expression.XORQ_STATS_V2plusload_project_stat_klasses(<source project_root>). A stat from the session'sproject_rootdoes not run on a mapped column.dtypeandlengthincluded, and is part of the raw summary, so it wins overinit_sd.orig_col_nameandrewritten_col_namestay the session's. A prefixed source's keys land as<prefix><key>.stats_delivery: deferredthe sources run when the dataflow goes to the full tier, so they arrive in the samestats_update. The schema tier issues no source query.dataflow_kwargs, so/reload_exprreplays them, and they count as config for the warm-session exit, so a re-POST rebuilds the session.error_code:invalid_stat_sources,invalid_column_stat_sources(including a mapped column without exactly one unprefixed source),unknown_stat_source,column_not_found(a target missing from the session's expression) andstat_source_column_not_found. A source that fails to load, or a stat that errors over it, is a stat error on the mapped column ((<column>, stat_source)or(<column>, <stat>)inerrs), and the session still loads.SessionState.release_xorq_state, and after/reload_exprswaps the dataflow), like the main expression's memtables (load_expr creates a new xorq-datafusion backend per call; contexts accumulate and dominate server memory #896).The summaries of a mapped column don't depend on the session's scope, so each source run is computed once per dataflow and shared by the three scopes.
Tests
TestColumnStatSourcesandTestLoadExprColumnStatSourcesintests/unit/server/test_load_expr.py, over a V1/V2 pair where V1 has keys V2 lacks and the join is an outer join on the key:price_v2's summary equals the V2 session's forprice, values and types, withlength6 andnull_count0 where the join has 8 and 2.price_v2in the raw, clean and filtered scopes, with the unmapped join as a control that does.make_scope_id(<data_id>). A second load issues no stat query, and opening the source as a session of its own issues none forprice. Cells the source's own session wrote are hits.project_rootappears on the mapped column, and one in the session'sproject_rootruns on the other columns only./reload_exprreplay, and a re-POST that changes the mapping.The tests were pushed first and failed on CI (run 37656666811, Python / Test (3.13): 14 failed, 1896 passed; all 14 are the new tests). The fix commit also corrects one assertion in the cold-source test: V2's own session computes
keyandnametoo, so the check that it issues no query is limited toprice. Locally the unit suite passes exceptartifact_test.py::TestToHtml(two tests, no built static assets) andtest_mcp_uvx_install.py::test_view_data_call, which fail the same way onmain.Not in this PR
As the issue lists:
add_analysison a live session (#1063) does not run over sources, post-processing views of a session with mapped columns, and pandas, polars and the widget.Closes #1092.
🤖 Generated with Claude Code