Repository navigation
Fail a streamed path-table over a folder that cannot be listed - #1779
Open
thekevinbot wants to merge 5 commits into
Open
thekevinbot wants to merge 5 commits into
thekevinbot wants to merge 5 commits into
Conversation
thekevinbot
marked this pull request as ready for review
November 20, 2026 18:14
This branch has not been 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.
Fixes #1740
Part two of #1740, after #1763. A path-table query whose glob reaches a folder that exists but cannot be listed (its open fails, or a read fails part-way) now fails with
cannot list folder '<path>': <reason>. Before, the folder read as empty and the query returned the other folders' rows with exit 0. Config tables and parsed path-tables already failed this way after #1763.RowStreamgets an error channel: the scan records itsUnlistableFolderon the stream, and any read past the rows already made gets that error. This covers the cursor's full scan (xFilter/xNext), the path lookup (settled), and the direct read that skips stepping SQLite. Each surfaces as a SQLite module error, the same error a parsed path-table raises. The Python and TypeScript SDKs pick it up unchanged, and binding tests cover each.A folder that does not exist still holds nothing. The walk keeps going past an unlistable folder and reports it at the end, so a statement that stops early (
LIMIT 1) without reading to the end still succeeds.Red
CI run on red commit
253fe7ae:FAILED ...path_table_unlistable_test.py::...::it_raises_naming_the_folder - Failed: DID NOT RAISE Exceptionpromise resolved "[ { path: 'data/open/a.json' } ]" instead of rejectingqueries_apply_eventstest before it reachedunlistable_folder. Locally, the four new Rust tests failed withan unlistable folder must fail the query: [{"path": Text("data/open/a.ndjson")}].Manual exercise
On a tree with
data/open/a.ndjsonanddata/locked(chmod 311),dirsql "SELECT path FROM './data/**/*.ndjson'"andSELECT count(*)both exit 1 withcannot list folder '/tmp/hand1740b/data/locked': Permission denied (os error 13)../data/{open,missing}/*.ndjsonexits 0 and returns[{"path":"data/open/a.ndjson"}].E2E Verification
testing-conventions e2e attest 'uv run python -m pytest tests/e2e/query_contract_test.py tests/e2e/stat_speed_test.py tests/e2e/glob_speed_recursive_test.py tests/e2e/glob_speed_one_level_test.py tests/e2e/glob_speed_symlink_test.py tests/e2e/glob_speed_matchers_test.py tests/e2e/many_dirs_speed_test.py tests/e2e/on_file_query_test.py tests/e2e/use_case_join_test.py -x -q'after a release build. Result: 27 passed. Receipt committed.just e2e-attest-ts(pnpm test:e2e). Result: 29 passed. Receipt committed.cargo test --workspace --features cli --no-fail-fastpasses, excepttests/non_utf8_names*.rs, which cannot create their fixtures on this host's tmpfs (EILSEQ). That failure predates this change.Changelog / Migrations
packages/rust/changelog.d/2026-11-20-streamed-unlistable-folder-fails.mdpackages/rust/migrations.d/2026-11-20-streamed-unlistable-folder-fails.md(no signature changes)