Skip to content

Normalize Etag format#544

Open
wonwuakpa-msft wants to merge 11 commits intofsspec:mainfrom
wonwuakpa-msft:wendi/normalizeEtag
Open

Normalize Etag format#544
wonwuakpa-msft wants to merge 11 commits intofsspec:mainfrom
wonwuakpa-msft:wendi/normalizeEtag

Conversation

@wonwuakpa-msft
Copy link
Copy Markdown
Collaborator

@wonwuakpa-msft wonwuakpa-msft commented Apr 21, 2026

Description

This fixes a bug with the Etag blob property where info() and ls() were returning different formats. This GitHub issue reproduces said bug. This is due to API differences when using BlobClient.get_blob_properties() vs BlobContainer.walk_blobs().
This PR introduces a standardization to _details() by ensuring the Etag property return type is wrapped with double quotes. S3fs formats Etags with double quotes here

Test

Added test_etag_normalized_form to test both calls property is equivalent and there is no double quoting

Copy link
Copy Markdown
Collaborator

@nateprewitt nateprewitt left a comment

Choose a reason for hiding this comment

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

Thanks for the PR, @wonwuakpa-msft, this is a great start! I left some initial feedback on a few things. Please let me know if you think I'm missing something or if you have any questions.

Comment thread adlfs/spec.py Outdated
Comment thread adlfs/spec.py Outdated
Comment thread adlfs/spec.py Outdated
Comment thread adlfs/tests/test_spec.py Outdated
Comment thread adlfs/tests/test_spec.py
Co-authored-by: Nate Prewitt <nate.prewitt@gmail.com>
Comment thread adlfs/tests/test_spec.py Outdated
Comment thread adlfs/spec.py Outdated
@nateprewitt
Copy link
Copy Markdown
Collaborator

@wonwuakpa-msft It looks like the latest commit may have modified the newline at the end of spec.py so it's diffing the entire file. Can you take a look at that? Feel free to ping me if you need help.

@wonwuakpa-msft
Copy link
Copy Markdown
Collaborator Author

@wonwuakpa-msft It looks like the latest commit may have modified the newline at the end of spec.py so it's diffing the entire file. Can you take a look at that? Feel free to ping me if you need help.

Yes, it was changing the line endings of every line in spec.py from LF to CRLF, so git detected that as a new change. Setting the git config core.autocrlf = input and changing my settings.json file in VSCode to /n resolved it.

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.

3 participants