home / github

Menu
  • GraphQL API
  • Search all tables

issue_comments

Table actions
  • GraphQL API for issue_comments

7 rows where issue = 56817968 sorted by updated_at descending

✖
✖

✎ View and edit SQL

This data as json, CSV (advanced)

Suggested facets: created_at (date), updated_at (date)

user 2

  • shoyer 5
  • sjpfenninger 2

author_association 2

  • MEMBER 5
  • CONTRIBUTOR 2

issue 1

  • Not-quite-ISO timestamps · 7 ✖
id html_url issue_url node_id user created_at updated_at ▲ author_association body reactions performed_via_github_app issue
74811395 https://github.com/pydata/xarray/issues/316#issuecomment-74811395 https://api.github.com/repos/pydata/xarray/issues/316 MDEyOklzc3VlQ29tbWVudDc0ODExMzk1 shoyer 1217238 2015-02-18T04:45:25Z 2015-02-18T04:45:25Z MEMBER

Made a new issue for datetime decoding error handling: #323

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Not-quite-ISO timestamps 56817968
73756512 https://github.com/pydata/xarray/issues/316#issuecomment-73756512 https://api.github.com/repos/pydata/xarray/issues/316 MDEyOklzc3VlQ29tbWVudDczNzU2NTEy shoyer 1217238 2015-02-10T18:40:12Z 2015-02-10T18:40:12Z MEMBER

I agree, this is not ideal. We really should try to decode time units at the time a dataset is opened, not just when the values are read (which open leads to a failed repr()). Adding some sort of more helpful error message to catch exception that arise would also help (e.g., "cannot read non-ISO time units: netCDF4 not installed").

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Not-quite-ISO timestamps 56817968
73732815 https://github.com/pydata/xarray/issues/316#issuecomment-73732815 https://api.github.com/repos/pydata/xarray/issues/316 MDEyOklzc3VlQ29tbWVudDczNzMyODE1 sjpfenninger 141709 2015-02-10T16:37:16Z 2015-02-10T16:37:16Z CONTRIBUTOR

I noticed that you already have a fallback option and I simply made use of that, which solves this problem in a way that looks reasonable to me.

However, I'm still not quite happy with the way errors were/are handled: before this change, reading a file with the non-standard datetime format would work without errors, but trying to do anything with the dataset after opening it would produce a ValueError, which from an end-user perspective doesn't help much to figure out where the error is coming from.

I suppose with the change in my PR, for cases where python-netCDF4 is not installed, one would instead get an ImportError without explanation (one wouldn't know why we tried to import the optional dependency). Maybe something like a wrapper to import netCDF4 which raises a context-specific ImportError message would be useful?

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Not-quite-ISO timestamps 56817968
73619315 https://github.com/pydata/xarray/issues/316#issuecomment-73619315 https://api.github.com/repos/pydata/xarray/issues/316 MDEyOklzc3VlQ29tbWVudDczNjE5MzE1 shoyer 1217238 2015-02-10T00:12:57Z 2015-02-10T00:12:57Z MEMBER

Yes, if you want to give it a shot, that would be great!

The only thing to watch out for is that netCDF4/netcdftime is an optional dependency, so you need to ensure that test methods are properly decorated with requires_netCDF4; otherwise the CI tests will fail. I'm not too concerned about being able to decode datetime units without netCDF4 installed, though I suppose that would be nice to maintain if possible (just import netcdftime locally when the fallback is used).

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Not-quite-ISO timestamps 56817968
73519971 https://github.com/pydata/xarray/issues/316#issuecomment-73519971 https://api.github.com/repos/pydata/xarray/issues/316 MDEyOklzc3VlQ29tbWVudDczNTE5OTcx sjpfenninger 141709 2015-02-09T14:47:39Z 2015-02-09T14:47:39Z CONTRIBUTOR

I think falling back to netcdftime would be preferrable to a datetime_format argument since it would just automagically work (although a datetime_format could be useful for other, trickier netCDF files). I could have a go at doing this later in the week and submit a PR, if it's helpful.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Not-quite-ISO timestamps 56817968
73289825 https://github.com/pydata/xarray/issues/316#issuecomment-73289825 https://api.github.com/repos/pydata/xarray/issues/316 MDEyOklzc3VlQ29tbWVudDczMjg5ODI1 shoyer 1217238 2015-02-06T18:42:32Z 2015-02-06T18:42:32Z MEMBER

It looks like netcdftime (part of the netCDF4 package) can parse this string correctly, so we should probably fall back to using that:

In [26]: netcdftime.num2date(0, 'hours since 1981-1-10 0') Out[26]: datetime.datetime(1981, 1, 10, 0, 0)

The other possibility is adding a datetime_format argument to open_dataset.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Not-quite-ISO timestamps 56817968
73276393 https://github.com/pydata/xarray/issues/316#issuecomment-73276393 https://api.github.com/repos/pydata/xarray/issues/316 MDEyOklzc3VlQ29tbWVudDczMjc2Mzkz shoyer 1217238 2015-02-06T17:21:18Z 2015-02-06T17:21:18Z MEMBER

What a hassle! Unfortunately my experience has been that non-ISO conformant time units are not uncommon. I'll take a look into this.

We did add one fix to improve the time unit parsing since the last release. You might want to try installing the dev version off github to see if it fixes your issue. Otherwise you can also do the sort of fixup you describe by loading the dataset with decode_cf=False, fixing the metadata and then calling xray.decode_cf.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Not-quite-ISO timestamps 56817968

Advanced export

JSON shape: default, array, newline-delimited, object

CSV options:

CREATE TABLE [issue_comments] (
   [html_url] TEXT,
   [issue_url] TEXT,
   [id] INTEGER PRIMARY KEY,
   [node_id] TEXT,
   [user] INTEGER REFERENCES [users]([id]),
   [created_at] TEXT,
   [updated_at] TEXT,
   [author_association] TEXT,
   [body] TEXT,
   [reactions] TEXT,
   [performed_via_github_app] TEXT,
   [issue] INTEGER REFERENCES [issues]([id])
);
CREATE INDEX [idx_issue_comments_issue]
    ON [issue_comments] ([issue]);
CREATE INDEX [idx_issue_comments_user]
    ON [issue_comments] ([user]);
Powered by Datasette · Queries took 25.436ms · About: xarray-datasette
  • Sort ascending
  • Sort descending
  • Facet by this
  • Hide this column
  • Show all columns
  • Show not-blank rows