Skip to content

fix: stabilize the timed-stream test, fix null ordering and path counts, bump 0.3.1 - #62

Merged
prrao87 merged 4 commits into
mainfrom
fix/timed-stream-error-test
Oct 26, 2026
Merged

prrao87 merged 4 commits into
mainfrom
fix/timed-stream-error-test

Conversation

@prrao87

@prrao87 prrao87 commented Oct 26, 2026

Copy link
Copy Markdown
Member

Why

The v0.3.0 PyPI publish stopped at its test job: test_execution_error_in_a_timed_stream_is_preserved failed on two of the three macOS runners, so nothing was uploaded. The test assumed the first batch read from the stream would raise the error. Only the batch holding p.id = 0 fails, and partitions finish in any order. With a release build on a 3-core runner, the first read succeeded 15–25% of the time. The engine was correct: across 900 local runs, the error always surfaced and was never lost.

This PR fixes the test, adds two quick fixes from the open issues, and bumps the version to 0.3.1 for the PyPI release. crates.io already has 0.3.0; 0.3.1 keeps the crate and package versions aligned.

What changed

  • Timed-stream test: reads until the error surfaces, and still fails if the stream ends without it. With the release wheel it passed 120 of 120 runs on Python 3.12, 3.13 and 3.14. The old version failed 15–25% of the time under the same conditions.
  • ORDER BY puts nulls last in ascending order and first in descending order, as in openCypher. Previously nulls always came first. Tests that had locked in the old order are updated, and the rule is documented. Fixes Ascending ORDER BY sorts nulls first instead of last #60.
  • count(v) works for values without an id column: count(DISTINCT p) on named paths, and count(x) for UNWIND and WITH values, used to fail to plan. The aggregate now counts the value when there's no v__id column. Parallel edges count as distinct paths. Fixes count(DISTINCT p) fails on named paths #61.
  • Version 0.3.1 in the crates, the Python package and the lockfiles.

Validation

  • cargo fmt --check, cargo clippy --workspace --all-targets -- -D warnings and cargo test --workspace pass (661 tests). The test that documented the count(unwind variable) limitation now checks the correct count.
  • In python/: make install (0.3.1), make test (1,263 passed) and make lint pass, and docs/check_snippets.py reports no failures.
  • zensical build --strict and typos pass.
  • With a debug build, all 88 result assertions in both benchmark suites pass in memory and lazy mode, so the new null ordering leaves the golden answers intact.
  • Not run: new timing benchmarks. Query execution only changes for sorts with nulls and for counts of non-entity values.

🤖 Generated with Claude Code

Only the batch holding p.id = 0 fails, and partitions finish in any
order, so the first read can succeed. With a release build on a 3-core
runner it did 15-25% of the time, failing the v0.3.0 publish. Read
until the error surfaces, still failing if the stream ends without it.
ORDER BY always placed nulls first. openCypher orders null after every
value, so ascending sorts now put nulls last and descending sorts first.
Update the tests that expected the old order and document the rule.

Fixes #60
count(v) lowered to count(v__id), which only node and relationship
bindings have, so count(DISTINCT p) on a named path and count(x) for
UNWIND or WITH values failed to plan. When the aggregate's input has no
v__id column but has v, count the value itself. Turn the test that
documented the limitation into a correctness test.

Fixes #61
@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Oct 26, 2026 •

Copy link
Copy Markdown

Deploying lance-csr with  Cloudflare Pages  Cloudflare Pages

Latest commit: e2b89a6
Status: ✅  Deploy successful!
Preview URL: https://66bd0260.lance-csr.pages.dev
Branch Preview URL: https://fix-timed-stream-error-test.lance-csr.pages.dev

View logs

@prrao87
prrao87 merged commit 4d19929 into main Oct 26, 2026
8 checks passed
@prrao87
prrao87 deleted the fix/timed-stream-error-test branch October 26, 2026 20:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

count(DISTINCT p) fails on named paths Ascending ORDER BY sorts nulls first instead of last

1 participant