refactor: convert to_untagged() to return xorq-vendored ibis types at…#203
Merged
boringdata merged 10 commits intomainfrom Mar 9, 2026
Merged
refactor: convert to_untagged() to return xorq-vendored ibis types at…#203boringdata merged 10 commits intomainfrom
boringdata merged 10 commits intomainfrom
Conversation
… the leaf Convert SemanticTableOp.to_untagged() to return xorq-vendored ibis types via _ensure_xorq_table(), eliminating ad-hoc from_ibis() calls and module-sniffing workarounds throughout the codebase. Add _unify_backends() helper using walk_nodes to ensure all DatabaseTable nodes share a single canonical backend at execution time. Update all internal ibis.window(), ibis.literal(), ibis._ usages to xorq-vendored equivalents. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Same LegacyWindowBuilder fix as other test files — the rolling window lambda needs xorq's window builder since to_untagged() now returns xorq-vendored ibis types. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Replace `from xorq.vendor import ibis as xibis` / `xibis.*` with `import xorq.api as xo` / `xo.*` throughout source and test files. Keep `from xorq.vendor import ibis` only where xorq.api lacks the needed API (to_sql with dialect parameter, TimestampScalar type). Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Replace ibis.window(), ibis.dense_rank(), ibis.row_number(), ibis.desc(), ibis.date() with xorq.api equivalents in example scripts that pass these through semantic layer lambdas. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
AllOf.ref can be an AggregationExpr at runtime (e.g. t.all(t.value.sum().coalesce(0))), but _serialize_calc_expr had no handler for it, silently producing None and crashing deserialization with TypeError: 'NoneType' object is not subscriptable. Add "agg_expr" tag for AggregationExpr serialization/deserialization, using _list_to_tuple to restore tuple structure from xorq's list-based tag metadata. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Replace xorq_convert.py monolith with serialization/ package: - extract.py: singledispatch extractors on actual op types - reconstruct.py: decorator-based handler registry - context.py: BSLSerializationContext centralizes deserialization - freeze.py: clean freeze/thaw utilities for FrozenOrderedDict - helpers.py: shared deserialization helpers - Remove all pickle support (v1.0 backward compat) - Delete xorq_convert.py, update all imports directly Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
COUNT DISTINCT (nunique) was being pre-aggregated per source table and re-aggregated with SUM, which overcounts when the same value appears across partitions. Since distinct counts are immune to fan-out, they are now computed on the full joined table instead of pre-aggregated. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Instead of always using the full fanned-out joined table for deferred count-distinct measures, compute on the raw source table when all group-by columns are local. Falls back to the joined table only for cross-table group-bys where the join is needed to resolve foreign dims. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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.
… the leaf
Convert SemanticTableOp.to_untagged() to return xorq-vendored ibis types via _ensure_xorq_table(), eliminating ad-hoc from_ibis() calls and module-sniffing workarounds throughout the codebase. Add unify_backends() helper using walk_nodes to ensure all DatabaseTable nodes share a single canonical backend at execution time. Update all internal ibis.window(), ibis.literal(), ibis. usages to xorq-vendored equivalents.