home / github

Menu
  • GraphQL API
  • Search all tables

issue_comments

Table actions
  • GraphQL API for issue_comments

12 rows where issue = 251734482 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

  • willirath 7
  • shoyer 3
  • max-sixty 2

author_association 2

  • CONTRIBUTOR 7
  • MEMBER 5

issue 1

  • Add `pathlib.Path` support to `open_(mf)dataset` · 12 ✖
id html_url issue_url node_id user created_at updated_at ▲ author_association body reactions performed_via_github_app issue
326611618 https://github.com/pydata/xarray/pull/1514#issuecomment-326611618 https://api.github.com/repos/pydata/xarray/issues/1514 MDEyOklzc3VlQ29tbWVudDMyNjYxMTYxOA== shoyer 1217238 2017-09-01T15:31:59Z 2017-09-01T15:31:59Z MEMBER

CI failures are all the issue with dask distributed (https://github.com/pydata/xarray/issues/1540), so I'm going ahead and merging.

Thanks @willirath !

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Add `pathlib.Path` support to `open_(mf)dataset` 251734482
326548654 https://github.com/pydata/xarray/pull/1514#issuecomment-326548654 https://api.github.com/repos/pydata/xarray/issues/1514 MDEyOklzc3VlQ29tbWVudDMyNjU0ODY1NA== willirath 5700886 2017-09-01T10:35:41Z 2017-09-01T10:35:41Z CONTRIBUTOR

Thanks @shoyer!

I like the shorter example. It shows the essence of why pathlib is such a nice thing.

Is there anything more to do in this PR?

Am 31. August 2017 17:48:24 schrieb Stephan Hoyer notifications@github.com:

shoyer approved this pull request.

@@ -21,9 +21,38 @@ v0.9.7 (unreleased) Enhancements ~~~~~~~~~~~~

+- Support for pathlib.Path objects added to

I just pushed a commit to add this

  • .. ipython::
  • :verbatim:
  • In [1]: import xarray as xr +
  • In [2]: from pathlib import Path # In Python 2, use pathlib2! +
  • In [3]: data_dir = Path("data/") +
  • In [4]: one_file = data_dir / "dta_for_month_01.nc" +
  • In [5]: print(xr.open_dataset(one_file))
  • Out[5]:
  • <xarray.Dataset>
  • [...] +
  • In [6]: all_files = data_dir.glob("dta_for_month_*.nc")

I removed this example from What's New for two reason: 1. The section was getting a little longer than essential 2. It's actually a bit of an anti-pattern, since the order of paths matters to xarray but is arbtirary from glob. The right way to write this is sorted(data_dir.glob(...)).

-- You are receiving this because you were mentioned. Reply to this email directly or view it on GitHub: https://github.com/pydata/xarray/pull/1514#pullrequestreview-59903100

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Add `pathlib.Path` support to `open_(mf)dataset` 251734482
325187598 https://github.com/pydata/xarray/pull/1514#issuecomment-325187598 https://api.github.com/repos/pydata/xarray/issues/1514 MDEyOklzc3VlQ29tbWVudDMyNTE4NzU5OA== willirath 5700886 2017-08-27T09:35:40Z 2017-08-27T09:35:40Z CONTRIBUTOR

AppVeyor test failed with HTTP time-outs when trying to get repodata.json. Can somebody trigger the build again?

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Add `pathlib.Path` support to `open_(mf)dataset` 251734482
325158074 https://github.com/pydata/xarray/pull/1514#issuecomment-325158074 https://api.github.com/repos/pydata/xarray/issues/1514 MDEyOklzc3VlQ29tbWVudDMyNTE1ODA3NA== willirath 5700886 2017-08-26T19:47:40Z 2017-08-26T19:47:40Z CONTRIBUTOR

flake8 now fails because of the unused pathlib in xarray/tests/__init__.py.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Add `pathlib.Path` support to `open_(mf)dataset` 251734482
324971323 https://github.com/pydata/xarray/pull/1514#issuecomment-324971323 https://api.github.com/repos/pydata/xarray/issues/1514 MDEyOklzc3VlQ29tbWVudDMyNDk3MTMyMw== shoyer 1217238 2017-08-25T16:31:20Z 2017-08-25T16:31:20Z MEMBER

And then I remove the pathlib2 dependency I've introduced in setup.py again?

Yes, pathlib2 should not be a required dependency.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Add `pathlib.Path` support to `open_(mf)dataset` 251734482
324970564 https://github.com/pydata/xarray/pull/1514#issuecomment-324970564 https://api.github.com/repos/pydata/xarray/issues/1514 MDEyOklzc3VlQ29tbWVudDMyNDk3MDU2NA== willirath 5700886 2017-08-25T16:28:16Z 2017-08-25T16:28:16Z CONTRIBUTOR

take a look at what we do for handling the optional dask dependency

Ah, that's nice!

And then I remove the pathlib2 dependency I've introduced in setup.py again?

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Add `pathlib.Path` support to `open_(mf)dataset` 251734482
324969407 https://github.com/pydata/xarray/pull/1514#issuecomment-324969407 https://api.github.com/repos/pydata/xarray/issues/1514 MDEyOklzc3VlQ29tbWVudDMyNDk2OTQwNw== shoyer 1217238 2017-08-25T16:23:28Z 2017-08-25T16:23:28Z MEMBER

@willirath take a look at what we do for handling the optional dask dependency: https://github.com/pydata/xarray/blob/bcd608101133c0cb84c74d341d22edef71ef4818/xarray/core/pycompat.py#L55-L60

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Add `pathlib.Path` support to `open_(mf)dataset` 251734482
324966586 https://github.com/pydata/xarray/pull/1514#issuecomment-324966586 https://api.github.com/repos/pydata/xarray/issues/1514 MDEyOklzc3VlQ29tbWVudDMyNDk2NjU4Ng== willirath 5700886 2017-08-25T16:12:23Z 2017-08-25T16:12:23Z CONTRIBUTOR

One more thing:

Can we add pathlib2 as an optional dependency and handle the case where it's not installed?

Currently, I've set pathlib2 as a mandatory requirement for Python 2. How'd we achieve pathlib being optional? Test for pathlib upon import and wrap all the if isinstace(path, Path): path = str(path) in a function just passing unmodified path if pathlib's not present?

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Add `pathlib.Path` support to `open_(mf)dataset` 251734482
324962241 https://github.com/pydata/xarray/pull/1514#issuecomment-324962241 https://api.github.com/repos/pydata/xarray/issues/1514 MDEyOklzc3VlQ29tbWVudDMyNDk2MjI0MQ== willirath 5700886 2017-08-25T15:56:20Z 2017-08-25T15:56:20Z CONTRIBUTOR
  • [x] Tests added / passed

Tests are already done on my personal Travis Account (skipped intermediate commits there).

  • [x] Passes git diff upstream/master | flake8 --diff

Actually true only for git diff upstream/master xarray/ | flake8 --diff. But I guess that's what should pass the linter?

To me, aae32a8 looks like pathlib support is now present whereever it makes sense.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Add `pathlib.Path` support to `open_(mf)dataset` 251734482
324898664 https://github.com/pydata/xarray/pull/1514#issuecomment-324898664 https://api.github.com/repos/pydata/xarray/issues/1514 MDEyOklzc3VlQ29tbWVudDMyNDg5ODY2NA== willirath 5700886 2017-08-25T11:59:27Z 2017-08-25T11:59:27Z CONTRIBUTOR

Thanks for the review @shoyer !

On my machine, I've already stared adapting the other backends (to_netcdf et al) to support pathlib as well. I'll include it here.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Add `pathlib.Path` support to `open_(mf)dataset` 251734482
323845017 https://github.com/pydata/xarray/pull/1514#issuecomment-323845017 https://api.github.com/repos/pydata/xarray/issues/1514 MDEyOklzc3VlQ29tbWVudDMyMzg0NTAxNw== max-sixty 5635139 2017-08-21T20:30:48Z 2017-08-21T20:30:48Z MEMBER

Curently, tests with Python 2 are failing, because there is no explicit pathlib dependency yet.

I missed this, apologies.

Can we add pathlib2 as an optional dependency and handle the case where it's not installed?

{
    "total_count": 1,
    "+1": 1,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Add `pathlib.Path` support to `open_(mf)dataset` 251734482
323844395 https://github.com/pydata/xarray/pull/1514#issuecomment-323844395 https://api.github.com/repos/pydata/xarray/issues/1514 MDEyOklzc3VlQ29tbWVudDMyMzg0NDM5NQ== max-sixty 5635139 2017-08-21T20:27:58Z 2017-08-21T20:27:58Z MEMBER

Are you sure pathlib exists in py2? I had thought you needed to install pathlib2 (I may be wrong on the specifics)

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Add `pathlib.Path` support to `open_(mf)dataset` 251734482

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