You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
S3FileSystem.info(version_id=...) returns cached metadata of another version #932
S3FileSystem.info(path, version_id=...) returns cached metadata of a different version. After info(p, version_id="v1"), a call to info(p, version_id="v2") returns v1's size, ETag and version_id instead of v2's.
Expected: an explicit version_id is honored, either by matching it against the cached entry or by bypassing the cache.
_head_object() caches the result under the path without the version (self.dircache[path] = file) and returns a cached entry whenever path in self.dircache, without comparing the requested version_id.
In info(), a cached entry is returned as is unless the filesystem is version aware, the call has no version_id, and the cached entry has none either. Calls with a different explicit version_id therefore get the cached entry.
Found by code reading during the review of #928 (not reproduced live yet).
PyAthena master 775874c, S3FileSystem with version_aware=True.
Proposed fix (optional)
When a version_id is requested (as an argument or in the path), use the cached entry only if its version_id matches; otherwise head the object with that version. Add a test that reads two versions of the same object through one instance.
Activity
Leave version caching in info() to #957