Skip to content

Fix AsyncFileSystem._cat_ranges error handling with on_error parameter#2045

Merged
martindurant merged 1 commit into
fsspec:masterfrom
zhixiangli:fix-async-cat-ranges-on-error
Jun 12, 2026
Merged

Fix AsyncFileSystem._cat_ranges error handling with on_error parameter#2045
martindurant merged 1 commit into
fsspec:masterfrom
zhixiangli:fix-async-cat-ranges-on-error

Conversation

@zhixiangli

Copy link
Copy Markdown
Contributor

This PR implements error handling for AsyncFileSystem._cat_ranges by introducing the on_error parameter (matching the AbstractFileSystem.cat_ranges interface).

Changes:

  • Added on_error parameter to AsyncFileSystem._cat_ranges (defaulting to "return").
  • Documented on_error in _cat_ranges docstring.
  • Implemented error handling: when on_error is not "return", we scan the chunk outputs using is_exception, raising the first encountered exception.
  • Added comprehensive unit tests in fsspec/tests/test_async.py verifying both "return" and "raise" behaviors under errors.

@martindurant martindurant merged commit 652325d into fsspec:master Jun 12, 2026
11 checks passed
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.

2 participants