home / github

Menu
  • GraphQL API
  • Search all tables

issue_comments

Table actions
  • GraphQL API for issue_comments

5 rows where issue = 677307460 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 2

  • spencerkclark 3
  • aidanheerdegen 2

author_association 2

  • MEMBER 3
  • CONTRIBUTOR 2

issue 1

  • cftime_range does not support default cftime.datetime formatted output strings · 5 ✖
id html_url issue_url node_id user created_at updated_at ▲ author_association body reactions performed_via_github_app issue
674394720 https://github.com/pydata/xarray/issues/4337#issuecomment-674394720 https://api.github.com/repos/pydata/xarray/issues/4337 MDEyOklzc3VlQ29tbWVudDY3NDM5NDcyMA== spencerkclark 6628425 2020-08-15T13:10:28Z 2020-08-15T13:10:28Z MEMBER

It would be good if xarray.cftime_range supported the default strftime format output from cftime.datetime objects. It is confusing that it uses this format with repr but explicitly does not support it.

@aidanheerdegen see #4343 for a PR that enables this.

{
    "total_count": 1,
    "+1": 1,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  cftime_range does not support default cftime.datetime formatted output strings 677307460
674008512 https://github.com/pydata/xarray/issues/4337#issuecomment-674008512 https://api.github.com/repos/pydata/xarray/issues/4337 MDEyOklzc3VlQ29tbWVudDY3NDAwODUxMg== spencerkclark 6628425 2020-08-14T10:29:05Z 2020-08-14T10:29:05Z MEMBER

Turns zero-padding years is platform dependent.

Oh wow, I didn't appreciate this; thanks for digging that up.

Thanks for being open to supporting the default output. My only goal is to remove barriers to productivity and remove sources of confusion as I want these tools to be used, and embraced, as widely as possible.

For sure! I can work on a PR for that.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  cftime_range does not support default cftime.datetime formatted output strings 677307460
673840314 https://github.com/pydata/xarray/issues/4337#issuecomment-673840314 https://api.github.com/repos/pydata/xarray/issues/4337 MDEyOklzc3VlQ29tbWVudDY3Mzg0MDMxNA== aidanheerdegen 6063709 2020-08-14T01:56:49Z 2020-08-14T01:56:49Z CONTRIBUTOR

Turns zero-padding years is platform dependent.

https://bugs.python.org/issue13305

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  cftime_range does not support default cftime.datetime formatted output strings 677307460
673769082 https://github.com/pydata/xarray/issues/4337#issuecomment-673769082 https://api.github.com/repos/pydata/xarray/issues/4337 MDEyOklzc3VlQ29tbWVudDY3Mzc2OTA4Mg== aidanheerdegen 6063709 2020-08-14T00:08:22Z 2020-08-14T00:08:22Z CONTRIBUTOR

Thanks for the detailed response @spencerkclark

Seems that we're using different versions of python as my datetime implementation doesn't produce a zero padded year. I guess that was a bug that has also been fixed: ```python In [1]: import datetime

In [2]: datetime.datetime(1, 1, 1).strftime("%Y-%m-%dT%H:%M:%S") Out[2]: '1-01-01T00:00:00' `` I agree that theisoformatis a good solution. I didn't know it was available in newer versions. I will upgrade mycftimeversion to>=1.1.3` to access it.

Thanks for being open to supporting the default output. My only goal is to remove barriers to productivity and remove sources of confusion as I want these tools to be used, and embraced, as widely as possible.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  cftime_range does not support default cftime.datetime formatted output strings 677307460
672825107 https://github.com/pydata/xarray/issues/4337#issuecomment-672825107 https://api.github.com/repos/pydata/xarray/issues/4337 MDEyOklzc3VlQ29tbWVudDY3MjgyNTEwNw== spencerkclark 6628425 2020-08-12T11:52:13Z 2020-08-12T11:52:13Z MEMBER

Thanks @aidanheerdegen, at least part of this issue may be better discussed in the cftime repository. This seems like a cftime bug: ``` In [1]: import cftime

In [2]: cftime.datetime(1, 1, 1).strftime("%Y-%m-%dT%H:%M:%S") Out[2]: ' 1-01-01T00:00:00' Following Python standard library conventions for `strftime`, the year should be zero-padded: In [3] import datetime

In [4]: datetime.datetime(1, 1, 1).strftime("%Y-%m-%dT%H:%M:%S") Out[4]: '0001-01-01T00:00:00' ISO-8601 formatting [requires zero-padding for years < 1000](https://en.wikipedia.org/wiki/ISO_8601#Years), which due to the bug above cannot currently be achieved easily with `strftime`. Note you may find the `isoformat` method of `cftime.datetime` objects helpful, which already works as we would like it to: In [5]: cftime.datetime(1, 1, 1).isoformat() Out[5]: '0001-01-01T00:00:00' ```

As for your suggested solution:

It would be good if xarray.cftime_range supported the default strftime format output from cftime.datetime objects. It is confusing that it uses this format with repr but explicitly does not support it.

I'm open to this. It seems reasonable that we could expand the acceptable time formats to include the default string representation of cftime objects (the only difference is a " " datetime separator instead of "T").

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  cftime_range does not support default cftime.datetime formatted output strings 677307460

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