chore(deps): bump xorq>=0.3.24 and adapt tests to API changes#265
Closed
ghoersti wants to merge 2 commits into
Closed
chore(deps): bump xorq>=0.3.24 and adapt tests to API changes#265ghoersti wants to merge 2 commits into
ghoersti wants to merge 2 commits into
Conversation
…tent hash Closes boringdata#263 Both `to_tagged()` and `reemit()` previously wrapped BSL expressions in a plain Tag node, which xorq's `opaque_node_replacer` strips during content-hash computation. The result: `source` and `source.tag("bsl", **metadata)` produced identical hashes, so two `xorq build` invocations (one for the raw source, one for a BSL model over it) silently overwrote each other under `builds/<hash>/`. The same regression applied to rebuilt artifacts coming out of `reemit`. Switch both call sites to `Table.hashing_tag(...)` so BSL metadata participates in the hash. HashingTag is a Tag subclass, so existing `isinstance(op, Tag)` checks in the reconstruct path are unaffected. Tests: - Drop `@pytest.mark.xfail` from the pre-existing `test_different_measures_produce_different_hashes` in test_xorq_convert.py — that test was xfailed against the bug and now passes (uses xorq's authoritative `compute_expr_hash`). - Add two new tests in test_xorq_tag_handler.py: * test_tagged_op_is_hashing_tag — outer op type is HashingTag. * test_tagged_hash_differs_from_untagged_source — tagged hash differs from bare source (covers untagged-vs-tagged, no pre-existing duplicate). - Add two new reemit regression tests: * test_reemit_preserves_hashing_tag — pin that `reemit` re-stamps with HashingTag, so rebuild paths keep the hash contract. * test_reemit_hash_distinguishes_metadata — round-trip via `to_tagged → reemit` still produces distinct hashes for distinct metadata. All new tests use `compute_expr_hash` (xorq's content-hash function) rather than `dask.base.tokenize` for consistency with the existing tests in test_xorq_convert.py. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Between the previously-pinned 0.3.19 and the new 0.3.24, xorq:
- changed the dispatch returned by ``get_rebuild_dispatch`` to take
``(rebuild_subexpr, remap, to_catalog)`` instead of just
``(rebuild_subexpr)``.
- made tag-op classes frozen with ``parent: Relation``, so
``parent=None`` is no longer constructible (and ``.parent`` cannot
be mutated after construction).
- removed ``xorq.api.read_parquet``; callers use
``deferred_read_parquet``.
- tightened ``xorq.vendor.ibis`` literal inference: scalars
constructed via the foreign top-level ``ibis`` package are
rejected inside a vendored expression.
Adaptations:
- test_xorq_backends: rename xo.read_parquet -> xo.deferred_read_parquet.
- test_xorq_rebuild: pass ``(rebuild_subexpr, None, None)`` to the
dispatch callable, and replace ``ibis.literal(1)`` inside a reemit
callback with a raw Python scalar so ``mutate`` infers in the
parent's flavor.
- serialization/tag_handler.reemit: drop the ``if tag_node.parent is
None`` guard. xorq now declares ``parent`` as a non-null
``Relation``, so the precondition is structurally impossible. Drop
the matching ``test_reemit_raises_on_missing_parent`` test (it
could only fire by mutating a real tag node into an invalid shape,
which xorq's immutability now rejects).
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
e1630d1 to
7d32ddd
Compare
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.
Summary
Stacked on top of #264 — please merge that first. Bumps
xorqfrom>=0.3.19to>=0.3.24and adapts BSL's xorq integration + tests to the four API changes the bump surfaces.Between the previously-pinned 0.3.19 and 0.3.24, xorq:
get_rebuild_dispatch— the returned callable now takes(rebuild_subexpr, remap, to_catalog)instead of just(rebuild_subexpr).parent: Relation, soparent=Noneis no longer constructible and.parentcannot be reassigned after construction.xorq.api.read_parquetremoved — callers usedeferred_read_parquet.ibispackage are rejected inside axorq.vendor.ibisexpression.Changes
pyproject.toml:xorq>=0.3.19→xorq>=0.3.24.test_xorq_backends.py:xo.read_parquet→xo.deferred_read_parquet.test_xorq_rebuild.py: pass(rebuild_subexpr, None, None)to dispatch; replaceibis.literal(1)inside a reemit callback with a raw Python scalar somutateinfers in the parent's flavor.serialization/tag_handler.reemit: drop theif tag_node.parent is Noneguard. xorq now declaresparentas a non-nullRelation, so the precondition is structurally impossible. Drop the matchingtest_reemit_raises_on_missing_parenttest.Test plan
pytest src/boring_semantic_layer/tests/→ 1003 passed, 1 skipped, 10 xfailed, 5 xpassed on xorq 0.3.24.pytest test_xorq_tag_handler.py test_xorq_rebuild.py test_xorq_convert.py test_xorq_backends.py→ 56 passed.Related
mainincludes both commits until fix(serialization): use HashingTag so BSL metadata contributes to content hash #264 merges.🤖 Generated with Claude Code