Skip to content

fix(filesystem): fail missing concrete sources - #265

Merged
amotl merged 2 commits into
mainfrom
fix/filesystem-missing-source
Aug 1, 2026
Merged

fix(filesystem): fail missing concrete sources#265
amotl merged 2 commits into
mainfrom
fix/filesystem-missing-source

Conversation

@hampsterx

Copy link
Copy Markdown
Contributor

Summary

  • Fail ingestion when a concrete filesystem selection matches no file instead of reporting false success.
  • Keep unmatched globs, zero-row files, and unchanged incremental reruns valid by counting matches before incremental filtering.
  • Apply the behavior across local, remote, and locator-based filesystem sources, with regression and integration coverage.
  • Document concrete-path requirements and supported glob syntax.

Fixes #260.

Review

  • Internal review: one credential-redaction fix applied before push; ambiguous remote URI-path parsing remains in its existing follow-up scope.
  • External review: GLM-5.2 and Claude both returned clean final verdicts with no critical or warning defects.
  • Four non-blocking hardening suggestions were noted for follow-up.

Changes

  • 16 files changed, 453 insertions, 2 deletions.
  • Add discovery-time enforcement and a credential-safe NoFilesFoundError.
  • Thread concrete-selection intent through all filesystem construction paths.
  • Add unit, incremental, cross-transport, and emulator-backed integration tests.
  • Document concrete path and glob behavior.

Test plan

  • Focused filesystem tests: 106 passed in the final reviewer run.
  • Fast lane: 796 passed, 44 skipped; only three documented pre-existing HDFS mock failures remain.
  • Focused S3, Azure, and GCS integration suite: 6 passed.
  • Amended S3 integration subset: 3 passed.
  • Ruff, type checking, project validation, and diff checks.
  • Strict Sphinx HTML build and linkcheck.
  • GLM-5.2 and Claude repo-aware reviews, including clean final reviews.
  • Vale documentation lint, unavailable locally because Vale is not installed.

@coderabbitai

coderabbitai Bot commented Jul 30, 2026

Copy link
Copy Markdown
Contributor

Important

Review skipped

Auto reviews are limited based on label configuration.

🏷️ Required labels (at least one) (1)
  • coderabbit-review

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 61655ffe-bd99-44e8-acc3-a1f15165245b

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@read-the-docs-community

read-the-docs-community Bot commented Jul 30, 2026

Copy link
Copy Markdown

Documentation build overview

📚 omniload | 🛠️ Build #33842943 | 📁 Comparing 8cf4658 against latest (fa14230)

  🔍 Preview build  

2 files changed
± changelog.html
± supported-sources/filesystem.html

@codecov

codecov Bot commented Jul 30, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 57.80%. Comparing base (d4fa8cb) to head (8cf4658).
⚠️ Report is 4 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #265      +/-   ##
==========================================
+ Coverage   57.63%   57.80%   +0.16%     
==========================================
  Files         227      227              
  Lines       10489    10531      +42     
==========================================
+ Hits         6045     6087      +42     
  Misses       4444     4444              

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@hampsterx
hampsterx force-pushed the fix/filesystem-missing-source branch from 0e55712 to 5899f54 Compare July 30, 2026 00:58
- Fail ingestion when a concrete filesystem selection matches no file instead of reporting false success.
- Keep unmatched globs, zero-row files, and unchanged incremental reruns valid by counting matches before incremental filtering.
- Apply the behavior across local, remote, and locator-based filesystem sources, with regression and integration coverage.
- Document concrete-path requirements and supported glob syntax.

@amotl amotl left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Excellent, thank you so much for improving this detail thoroughly. 💯
I just found one nit, but it can easily be addressed in a later iteration.

Comment on lines +41 to +45
def has_glob_magic(path: str) -> bool:
"""Return whether ``path`` contains fsspec's ``*``, ``?``, or ``[`` syntax."""
return any(char in path for char in _GLOB_CHARS)


Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This other patch just uses glob.has_magic from Python's standard library. Is it applicable to also use it here?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, applicable, done in 8cf4658. glob.has_magic tests the same *?[ class the local constant did, so the classification is unchanged (verified over the concrete/*/?/[ab]/{a,b}/**/empty/literal-# cases the predicate tests already cover), and one less local copy of the rule to keep in sync.

Worth noting the ? caveat from the review you linked does not bite here, and the asymmetry is why. In source_selects_single_file, magic means glob means an unmatched selection still succeeds, so counting ? as magic is the conservative direction; dropping it from the set (as fsspec/filesystem_spec#2080 ended up doing for URLs) would reclassify bar/baz?.csv as concrete and turn it into a hard failure. The query-delimiter problem that review raises is handled separately and more narrowly here: a trailing tail made entirely of key=value segments is stripped as connection parameters before classification, so ? only survives when it is genuinely part of the selection.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

Use the standard library's glob.has_magic instead of a local copy of the
*?[ character class, so concrete-vs-glob classification tracks the rule
Python and fsspec globbing already share rather than one this package has
to keep in sync by hand. Behaviour is unchanged: has_magic tests the same
three characters, and brace expansion stays non-magic, matching fsspec,
which does not expand braces.
@amotl
amotl merged commit 989164c into main Aug 1, 2026
14 checks passed
@amotl
amotl deleted the fix/filesystem-missing-source branch August 1, 2026 21:38
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.

Process succeeds when importing from fileystem yields empty results

2 participants