Skip to content
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

"microseconds = False" seems to be ineffective #17

Open
mKartagis opened this issue May 3, 2022 · 1 comment
Open

"microseconds = False" seems to be ineffective #17

mKartagis opened this issue May 3, 2022 · 1 comment

Comments

@mKartagis
Copy link

mKartagis commented May 3, 2022

python 3.8

With "microseconds" explicitly defined as "False", the function seems to still attempt to retrieve "atime, mtime, ctime" and drop an error on some specific file (which i could not identify).

import folderstats
df = folderstats.folderstats(
    "path\to\folder",
    ignore_hidden=True,
    parent=True,
    microseconds=False
    )
~\.conda\envs\pyqgis38\lib\site-packages\folderstats\__init__.py in <lambda>(d)
    152         df[col] = df[col].apply(
    153             lambda d: datetime.fromtimestamp(d) if microseconds else \
--> 154                 datetime.fromtimestamp(d).replace(microsecond=0))
    155 
    156     if absolute_paths:

OSError: [Errno 22] Invalid argument

Works fine on others folders with no problematic file, but still look for timestamps while argument "microseconds" is False.

@datatalking
Copy link

@mKartagis I'm increasing the resolution on a time-series data project, was curious if you found a solution to this or workaround?

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

No branches or pull requests

2 participants