home / github / issues

Menu
  • GraphQL API
  • Search all tables

issues: 1428549868

This data as json

id node_id number title user state locked assignee milestone comments created_at updated_at closed_at author_association active_lock_reason draft pull_request body reactions performed_via_github_app state_reason repo type
1428549868 I_kwDOAMm_X85VJfDs 7237 The new NON_NANOSECOND_WARNING is not very nice to end users 90008 closed 0     5 2022-10-30T01:56:59Z 2023-05-09T12:52:54Z 2022-11-04T20:13:20Z CONTRIBUTOR      

What is your issue?

The new nanosecond warning doesn't really point anybody to where they should change their code.

Nor does it really tell them how to fix it.

import xarray as xr import numpy as np xr.DataArray(np.zeros(1, dtype='datetime64[us]')) yields

xarray/core/variable.py:194: UserWarning: Converting non-nanosecond precision datetime values to nanosecond precision. This behavior can eventually be relaxed in xarray, as it is an artifact from pandas which is now beginning to support non-nanosecond precision values.

https://github.com/pydata/xarray/blob/f32d354e295c05fb5c5ece7862f77f19d82d5894/xarray/core/variable.py#L194

I think at the very least, the stacklevel should be specified when calling the warn function.

It isn't really pretty, but I've been passing a parameter when I expect to pass up a warning to the end user: eg. https://github.com/vispy/vispy/pull/2405

However, others have not liked that approach.

{
    "url": "https://api.github.com/repos/pydata/xarray/issues/7237/reactions",
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  completed 13221727 issue

Links from other tables

  • 1 row from issues_id in issues_labels
  • 5 rows from issue in issue_comments
Powered by Datasette · Queries took 0.646ms · About: xarray-datasette