home / github / issue_comments

Menu
  • GraphQL API
  • Search all tables

issue_comments: 1237014040

This data as json

html_url issue_url id node_id user created_at updated_at author_association body reactions performed_via_github_app issue
https://github.com/pydata/xarray/issues/6906#issuecomment-1237014040 https://api.github.com/repos/pydata/xarray/issues/6906 1237014040 IC_kwDOAMm_X85Ju1YY 6628425 2022-09-05T13:18:21Z 2022-09-05T13:18:21Z MEMBER

Thanks @amckinstry. I guess my last try to produce a pandas minimal example might be: ```

import numpy as np; import pandas as pd pd.Series(np.array([np.int64(1000000).astype("<M8[h]")])) 0 2084-01-29 16:00:00 dtype: datetime64[ns] or potentially more simply: import numpy as np; import pandas as pd pd.Series(np.int64(1000000).astype("<M8[h]")) 0 2084-01-29 16:00:00 dtype: datetime64[ns] `` Somewhere something is going wrong in converting a non-nanosecond-precision datetime value to a nanosecond-precision one (maybe the cast to apd.Timestamp` in my earlier example was short-circuiting this).

I think #6988 should likely work around this issue at least on the xarray side, since it passes datetime64[ns] values into the DataArray constructor immediately. It also seems like the function where the error occurs (ensure_datetime64ns) was recently eliminated in favor of an updated implementation in pandas, so I wonder if this will be an issue there going forward.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  1334835539
Powered by Datasette · Queries took 0.7ms · About: xarray-datasette