Skip to content

Commit

Permalink
Update src/datasets/utils/file_utils.py
Browse files Browse the repository at this point in the history
Co-authored-by: Quentin Lhoest <[email protected]>
  • Loading branch information
dwyatte and lhoestq committed Mar 10, 2023
1 parent 74c0c45 commit b2c958a
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/datasets/utils/file_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -501,7 +501,8 @@ def get_from_cache(
elif scheme not in ("http", "https"):
response = fsspec_head(url)
# use the hash of the response as a pseudo ETag to detect changes
etag = json.dumps(response, sort_keys=True) if use_etag else None
# s3fs uses "ETag", gcsfs uses "etag"
etag = (response.get("ETag", None) or response.get("etag", None)) if use_etag else None
connected = True
try:
response = http_head(
Expand Down

0 comments on commit b2c958a

Please sign in to comment.