-
Notifications
You must be signed in to change notification settings - Fork 44
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Different return types for S3Path.stat() and WindowsUPath.stat() #145
Comments
Hi @theogaraj This is definitely an issue, and we should create a We need to ensure that the relevant fsspec issues: For now I don't have a good recommendation other than _stat = pth.stat()
size = _stat["size"] if isinstance(_stat, dict) else _stat.st_size Cheers, |
I vaguely remembered that I implemented something related to this already... getmtime on fsspec |
@ap-- thank you for checking and responding so promptly. Because of another problem I had with So this is by no means a showstopper. I'll track this issue and can update my code whenever someone is able to resolve these two issues. |
Just ran across this. See https://github.com/apache/airflow/blob/main/airflow/io/store/stat.py for a |
I just ran across the same issue here and would be happy to fire a PR with a fix, though it looks like @ap-- may already be investigating? @bolkedebruin make several updates to the airflow io provider while inheriting from UPath in apache/airflow#35612 which are great prior art here. I would propose that we just port the changes to support |
Collected InfoFor links to All filesystems have "name", "size" and "type".
For translating to
Additional info to be considered comes from specific filesystems:
All data types need to be normalized to |
Which operating system and Python version are you using?
Windows 11, Python 3.9.6
Which version of this project are you using?
0.1.3
What did you do?
I am attempting to use universal_pathlib in order to have a unified way of handling files whether they are local or in S3.
One of the things I need to do is get all the files in a folder (yes I know S3 doesn't have actual folders, but hopefully you understand what I mean) and get their sizes.
What did you expect to see?
I expected to be able to use same code to get file sizes whether they are in local directory or in S3
What did you see instead?
The return types of stat() are different for S3Path vs WindowsUPath and I can't get file size in the same way from each.
Would this difference in behavior be something you would consider reconciling? Alternatively, do you have suggestions on another approach to achieving what I'm trying to do?
The text was updated successfully, but these errors were encountered: