home / github

Menu
  • Search all tables
  • GraphQL API

issue_comments

Table actions
  • GraphQL API for issue_comments

12 rows where author_association = "MEMBER" and issue = 811933067 sorted by updated_at descending

✎ View and edit SQL

This data as json, CSV (advanced)

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

user 3

  • kmuehlbauer 7
  • spencerkclark 3
  • dcherian 2

issue 1

  • Times not decoding due to time_reference being in another variable · 12 ✖

author_association 1

  • MEMBER · 12 ✖
id html_url issue_url node_id user created_at updated_at ▲ author_association body reactions performed_via_github_app issue
782820367 https://github.com/pydata/xarray/issues/4927#issuecomment-782820367 https://api.github.com/repos/pydata/xarray/issues/4927 MDEyOklzc3VlQ29tbWVudDc4MjgyMDM2Nw== kmuehlbauer 5821660 2021-02-21T08:34:10Z 2021-02-21T08:34:10Z MEMBER

Closing as "won't fix" due to issue based on non-standard behaviour.

Anyone finding this issue, a workaround is shown in the OP.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Times not decoding due to time_reference being in another variable 811933067
782808567 https://github.com/pydata/xarray/issues/4927#issuecomment-782808567 https://api.github.com/repos/pydata/xarray/issues/4927 MDEyOklzc3VlQ29tbWVudDc4MjgwODU2Nw== kmuehlbauer 5821660 2021-02-21T06:31:26Z 2021-02-21T06:31:26Z MEMBER

@dcherian Thanks, I've thought around the same. But it will be a bit more involved because this will be used in a new BackendEntrypoint in a downstream package.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Times not decoding due to time_reference being in another variable 811933067
782783402 https://github.com/pydata/xarray/issues/4927#issuecomment-782783402 https://api.github.com/repos/pydata/xarray/issues/4927 MDEyOklzc3VlQ29tbWVudDc4Mjc4MzQwMg== dcherian 2448579 2021-02-21T02:22:02Z 2021-02-21T02:22:02Z MEMBER

Thanks @spencerkclark I missed that those conventions specified that the units attribute should include the datetime string.

@kmuehlbauer you could python ds = xr.open_dataset(..., decode_times=False) ds = rewrite_time_reference_units(ds) ds = xr.decode_cf(ds)

{
    "total_count": 1,
    "+1": 1,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Times not decoding due to time_reference being in another variable 811933067
782747982 https://github.com/pydata/xarray/issues/4927#issuecomment-782747982 https://api.github.com/repos/pydata/xarray/issues/4927 MDEyOklzc3VlQ29tbWVudDc4Mjc0Nzk4Mg== kmuehlbauer 5821660 2021-02-20T20:53:59Z 2021-02-20T20:53:59Z MEMBER

@spencerkclark If it's not exactly standard, it's not standard. So I completely understand your concerns.

I just need to figure out, how to work around this downstream.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Times not decoding due to time_reference being in another variable 811933067
782739934 https://github.com/pydata/xarray/issues/4927#issuecomment-782739934 https://api.github.com/repos/pydata/xarray/issues/4927 MDEyOklzc3VlQ29tbWVudDc4MjczOTkzNA== spencerkclark 6628425 2021-02-20T19:51:34Z 2021-02-20T19:51:34Z MEMBER

Yeah, I understand, these kinds of metadata issues can be frustrating to deal with, especially when things are close to being valid, but not quite. That said, I'm afraid I would be -1 on adding special logic to handle this to xarray, though I'm open to being convinced if others feel otherwise.

(The time bounds logic is a bit different, because there are indeed CF Conventions pertaining to that).

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Times not decoding due to time_reference being in another variable 811933067
782737641 https://github.com/pydata/xarray/issues/4927#issuecomment-782737641 https://api.github.com/repos/pydata/xarray/issues/4927 MDEyOklzc3VlQ29tbWVudDc4MjczNzY0MQ== kmuehlbauer 5821660 2021-02-20T19:33:42Z 2021-02-20T19:33:42Z MEMBER

@spencerkclark The problem is I have exactly these files which have a time attrs units reading "time since time_reference" and a variable "time_reference" with the needed time string. OK, I can use the fix I showed above.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Times not decoding due to time_reference being in another variable 811933067
782735912 https://github.com/pydata/xarray/issues/4927#issuecomment-782735912 https://api.github.com/repos/pydata/xarray/issues/4927 MDEyOklzc3VlQ29tbWVudDc4MjczNTkxMg== spencerkclark 6628425 2021-02-20T19:20:47Z 2021-02-20T19:20:47Z MEMBER

@kmuehlbauer thanks -- in my reading of the table under Section 4.4.1 (Attributes for time coordinate variable) it seems like the actual value of the date should appear in the units attribute of the time coordinate (matching the "time_reference" or "time_coverage_start" variable is a separate condition).

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Times not decoding due to time_reference being in another variable 811933067
782735668 https://github.com/pydata/xarray/issues/4927#issuecomment-782735668 https://api.github.com/repos/pydata/xarray/issues/4927 MDEyOklzc3VlQ29tbWVudDc4MjczNTY2OA== kmuehlbauer 5821660 2021-02-20T19:18:48Z 2021-02-20T19:18:48Z MEMBER

@spencerkclark We might restrict it to just that name time_reference over in #4933. WDYT?

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Times not decoding due to time_reference being in another variable 811933067
782734731 https://github.com/pydata/xarray/issues/4927#issuecomment-782734731 https://api.github.com/repos/pydata/xarray/issues/4927 MDEyOklzc3VlQ29tbWVudDc4MjczNDczMQ== kmuehlbauer 5821660 2021-02-20T19:11:01Z 2021-02-20T19:11:01Z MEMBER

@spencerkclark This is specified in CfRadial1 https://www.eol.ucar.edu/system/files/CfRadialDoc.v1.4.20160801.pdf

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Times not decoding due to time_reference being in another variable 811933067
782733509 https://github.com/pydata/xarray/issues/4927#issuecomment-782733509 https://api.github.com/repos/pydata/xarray/issues/4927 MDEyOklzc3VlQ29tbWVudDc4MjczMzUwOQ== spencerkclark 6628425 2021-02-20T19:02:02Z 2021-02-20T19:02:02Z MEMBER

Sorry for chiming in a bit late -- I just want to make sure, is this truly valid under the CF Conventions? It seems to open the door for ambiguity; e.g. it's a pathological example, but one could imagine a "time_reference" variable named in the form of a date. In that case what takes precedence when decoding the times, the value of the date in the name, or the value the variable refers to?

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Times not decoding due to time_reference being in another variable 811933067
782112972 https://github.com/pydata/xarray/issues/4927#issuecomment-782112972 https://api.github.com/repos/pydata/xarray/issues/4927 MDEyOklzc3VlQ29tbWVudDc4MjExMjk3Mg== kmuehlbauer 5821660 2021-02-19T14:34:35Z 2021-02-19T14:34:35Z MEMBER

Thanks @dcherian, this looks like a way to try. I'll give it a try.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Times not decoding due to time_reference being in another variable 811933067
782111696 https://github.com/pydata/xarray/issues/4927#issuecomment-782111696 https://api.github.com/repos/pydata/xarray/issues/4927 MDEyOklzc3VlQ29tbWVudDc4MjExMTY5Ng== dcherian 2448579 2021-02-19T14:32:28Z 2021-02-19T14:32:28Z MEMBER

https://github.com/pydata/xarray/blob/070d8158aab31c6a53efb36f9ea4a57dc6671e43/xarray/conventions.py#L498-L500

Looks like we treat time bounds specially. You could add a helper function to this if condition that rewrites "seconds since time_reference" to "seconds since 1970-01-01T00:00:00Z" and the rest of the decoding machinery should just work.

This approach might break round-tripping that file though. Perhaps saving encoding["units"] = "seconds since time_reference" fixes that?

{
    "total_count": 1,
    "+1": 1,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Times not decoding due to time_reference being in another variable 811933067

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 14.422ms · About: xarray-datasette