Skip to content

Fail a streamed path-table over a folder that cannot be listed - #1779

Open
thekevinbot wants to merge 5 commits into
mainfrom
bot/1740-streamed-unlistable-1120
Open

thekevinbot wants to merge 5 commits into
mainfrom
bot/1740-streamed-unlistable-1120

Conversation

@thekevinbot

@thekevinbot thekevinbot commented Nov 20, 2026 •

Copy link
Copy Markdown
Collaborator

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.

RowStream gets an error channel: the scan records its UnlistableFolder on 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:

  • Binding tests (3.12) 136442862729: FAILED ...path_table_unlistable_test.py::...::it_raises_naming_the_folder - Failed: DID NOT RAISE Exception
  • Binding tests (Node 24) 136444613708: promise resolved "[ { path: 'data/open/a.json' } ]" instead of rejecting
  • The Rust integration job on that run stopped at the unrelated flaky queries_apply_events test before it reached unlistable_folder. Locally, the four new Rust tests failed with an unlistable folder must fail the query: [{"path": Text("data/open/a.ndjson")}].

Manual exercise

On a tree with data/open/a.ndjson and data/locked (chmod 311), dirsql "SELECT path FROM './data/**/*.ndjson'" and SELECT count(*) both exit 1 with cannot list folder '/tmp/hand1740b/data/locked': Permission denied (os error 13). ./data/{open,missing}/*.ndjson exits 0 and returns [{"path":"data/open/a.ndjson"}].

E2E Verification

  • Python: ran 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.
  • TypeScript: ran just e2e-attest-ts (pnpm test:e2e). Result: 29 passed. Receipt committed.
  • Rust: cargo test --workspace --features cli --no-fail-fast passes, except tests/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.md
  • packages/rust/migrations.d/2026-11-20-streamed-unlistable-folder-fails.md (no signature changes)

@thekevinbot
thekevinbot marked this pull request as ready for review November 20, 2026 18:14

This branch has not been deployed

No deployments
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.

A folder that cannot be listed is treated as empty and the query succeeds

1 participant