Skip to content

Update ZonalFile write operations with byte count and location tracking#777

Merged
ankitaluthra1 merged 1 commit intofsspec:mainfrom
ankitaluthra1:loc-fix
Mar 12, 2026
Merged

Update ZonalFile write operations with byte count and location tracking#777
ankitaluthra1 merged 1 commit intofsspec:mainfrom
ankitaluthra1:loc-fix

Conversation

@suni72
Copy link
Contributor

@suni72 suni72 commented Mar 11, 2026

Description

Updates ZonalFile.write() to properly return the number of bytes written and track the logical file position (self.loc).

Why: Missing byte returns and static file pointers caused downstream tools like PyTorch to calculate 0-length chunks, corrupting saved checkpoint metadata.

Changes

  • ZonalFile.write(): Now returns len(data) and increments self.loc += len(data).
  • Tests: Updated test_zonal_file_write_success to assert correct byte returns and sequential loc accumulation.

@codecov
Copy link

codecov bot commented Mar 11, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 75.45%. Comparing base (1533f79) to head (bba8a2b).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #777      +/-   ##
==========================================
+ Coverage   75.08%   75.45%   +0.37%     
==========================================
  Files          14       14              
  Lines        2625     2628       +3     
==========================================
+ Hits         1971     1983      +12     
+ Misses        654      645       -9     

☔ View full report in Codecov by Sentry.
📢 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.

@ankitaluthra1
Copy link
Collaborator

/gcbrun

@ankitaluthra1 ankitaluthra1 merged commit 06327c0 into fsspec:main Mar 12, 2026
9 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