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
I'm getting an error when using the load_dataset function. It seems that the API is providing datetime information with nanosecond resolution, while datetime only supports up to microsecond resolution:
Traceback (most recent call last):
File "~\t2.py", line 3, in <module>
dw_ds = dw.load_dataset("{owner}/{id}") # modified for privacy
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "~\venv\Lib\site-packages\datadotworld\__init__.py", line 99, in load_dataset
load_dataset(dataset_key,
File "~\venv\Lib\site-packages\datadotworld\datadotworld.py", line 164, in load_dataset
last_modified = datetime.strptime(dataset_info['updated'],
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "~\Miniconda3\envs\nox\Lib\_strptime.py", line 568, in _strptime_datetime
tt, fraction, gmtoff_fraction = _strptime(data_string, format)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "~\Miniconda3\envs\nox\Lib\_strptime.py", line 349, in _strptime
raise ValueError("time data %r does not match format %r" %
ValueError: time data '2023-03-22T17:14:38.878483744Z' does not match format '%Y-%m-%dT%H:%M:%S.%fZ'
This should work if nanoseconds are stripped from the string before parsing with datetime.
datetime.datetime.strptime("2023-03-22T17:14:38.878483Z") # works
Let me know if I can provide any more info.
Happy to contribute a PR if you would like.
Thanks!
The text was updated successfully, but these errors were encountered:
Hi,
I'm getting an error when using the
load_dataset
function. It seems that the API is providing datetime information with nanosecond resolution, whiledatetime
only supports up to microsecond resolution:This should work if nanoseconds are stripped from the string before parsing with datetime.
Let me know if I can provide any more info.
Happy to contribute a PR if you would like.
Thanks!
The text was updated successfully, but these errors were encountered: