Open amangarg96 opened 5 years ago
Agree that this should only be optional information. I believe the line only exists to copy the original data without mutation. You are very welcome to submit a PR in which fields such as this are only referenced if they exist (or otherwise replaced with defaults, where appropriate). I may get to doing this myself, but I cannot promise when.
btw, with #161 (depends on filesystem-spec), this issue may have gone away. That PR will not be merged for some time, but it would be interesting to see if this kind of problem is already fixed "for free".
I see that this issue is very old, however this problem has been plaguing me in the context of testing with moto
. I genuinely do not know if it's an issue where the mocked objects don't have LastModified
attribute or not however I think a simple fix here would be to replace out['LastModified']
with out.get('LastModified', ...)
. I don't know what a reasonable default is, maybe None
would be fine.
Would the fsspec maintainers be open to a one-liner PR to implement this change?
Yes, I think that's reasonable. In general, we should be more OK with details missing except when explicitly doing an operations that depend on it.
I have a Ceph based Object store with S3, and I am trying to use s3fs.
The metadata of the objects do not seem to have 'LastModified' entry, which was identified using Boto3's s3.Client.head_object(). Here's a sample metadata response of one of the objects
When I try to use s3fs operations like open() [To open a file for reading and writing], it gives the following error
Operations like ls(), mkdir(),isfile(), isdir() are working as expected.
Is there a way to use S3FileSystem without the 'LastModified' metadata? What exactly is this LastModified entry used for?