Skip to content

fix: preserve user headers in cat_file requests - #1013

Open
fallenmi wants to merge 1 commit into
fsspec:mainfrom
fallenmi:agent/preserve-cat-file-headers
Open

fallenmi wants to merge 1 commit into
fsspec:mainfrom
fallenmi:agent/preserve-cat-file-headers

Conversation

@fallenmi

@fallenmi fallenmi commented Aug 16, 2026 •

Copy link
Copy Markdown

Fixes #889.

Summary

Testing

  • On the upstream base, the three new regression cases failed: both _cat_file header cases dropped If-Match, and headers forced get_file onto the sequential path.
  • After rebasing onto current main (ab6bc825), six focused header, routing, and adjacent generation tests passed with STORAGE_EMULATOR_HOST=http://localhost:4443.
  • A two-chunk concurrent probe preserved If-Match, generated the correct range per chunk, and left the caller mapping unchanged.
  • flake8, isort --check-only, Black, and git diff --check passed.

The full emulator-backed suite was not run locally because the Docker daemon is unavailable; upstream CI remains the integration gate.

AI assistance disclosure

OpenAI Codex prepared the issue reproduction, implementation, tests, rebase, and validation. The GitHub account owner explicitly authorized publication and transition to ready for maintainer review.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Code Review

This pull request enables passing custom headers to sequential and concurrent file operations in gcsfs. Specifically, _cat_file_sequential now correctly merges and overrides range headers when start/end limits are provided, and _get_file no longer bypasses the concurrent download path when custom headers are present. Corresponding unit tests have been added to verify these behaviors. I have no additional feedback to provide as the changes are well-implemented and covered by tests.

@fallenmi
fallenmi force-pushed the agent/preserve-cat-file-headers branch from 3dc40dd to 9222b47 Compare August 25, 2026 12:44
@fallenmi
fallenmi marked this pull request as ready for review August 25, 2026 12:44
@codecov

codecov Bot commented Aug 25, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 90.07%. Comparing base (ab6bc82) to head (9222b47).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1013      +/-   ##
==========================================
+ Coverage   90.04%   90.07%   +0.03%     
==========================================
  Files          16       16              
  Lines        3638     3639       +1     
==========================================
+ Hits         3276     3278       +2     
+ Misses        362      361       -1     

☔ 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.

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.

The _cat_file doesn't respect the header passed via user.

1 participant