home / github

Menu
  • GraphQL API
  • Search all tables

issue_comments

Table actions
  • GraphQL API for issue_comments

15 rows where issue = 657792526 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 7

  • michaelaye 5
  • dcherian 3
  • tomwhite 2
  • shoyer 2
  • benbovy 1
  • jsignell 1
  • pep8speaks 1

author_association 3

  • MEMBER 6
  • NONE 6
  • CONTRIBUTOR 3

issue 1

  • provide set_option `collapse_html` to control HTML repr collapsed state · 15 ✖
id html_url issue_url node_id user created_at updated_at ▲ author_association body reactions performed_via_github_app issue
840696698 https://github.com/pydata/xarray/pull/4230#issuecomment-840696698 https://api.github.com/repos/pydata/xarray/issues/4230 MDEyOklzc3VlQ29tbWVudDg0MDY5NjY5OA== dcherian 2448579 2021-05-13T17:02:54Z 2021-05-13T17:02:54Z MEMBER

I think @tomwhite has implemented this functionality. Thanks everyone.

{
    "total_count": 1,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 1,
    "eyes": 0
}
  provide set_option `collapse_html` to control HTML repr collapsed state 657792526
822119562 https://github.com/pydata/xarray/pull/4230#issuecomment-822119562 https://api.github.com/repos/pydata/xarray/issues/4230 MDEyOklzc3VlQ29tbWVudDgyMjExOTU2Mg== dcherian 2448579 2021-04-19T02:08:49Z 2021-04-19T02:09:37Z MEMBER

I haven't implemented the nested options for display_expand - is it worth adding the extra complexity here?

Not sure :). Can you open a PR please?

EDIT: Oops you've already opened one! thanks!

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  provide set_option `collapse_html` to control HTML repr collapsed state 657792526
814813584 https://github.com/pydata/xarray/pull/4230#issuecomment-814813584 https://api.github.com/repos/pydata/xarray/issues/4230 MDEyOklzc3VlQ29tbWVudDgxNDgxMzU4NA== tomwhite 85085 2021-04-07T10:51:31Z 2021-04-07T10:51:31Z CONTRIBUTOR

Thanks for the suggestions @dcherian!

I've implemented "default" to preserve existing behaviour (i.e. only collapse if greater than preconfigured size limits). See #5126

I haven't implemented the nested options for display_expand - is it worth adding the extra complexity here?

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  provide set_option `collapse_html` to control HTML repr collapsed state 657792526
814255041 https://github.com/pydata/xarray/pull/4230#issuecomment-814255041 https://api.github.com/repos/pydata/xarray/issues/4230 MDEyOklzc3VlQ29tbWVudDgxNDI1NTA0MQ== dcherian 2448579 2021-04-06T16:24:06Z 2021-04-06T16:24:06Z MEMBER

maintaining the existing behaviour, which is that for the HTML dataset repr all three sections are expanded by default,

The existing behaviour could be "default", True could be fully expanded always; and False could be never expanded.

display_expand_attrs, display_expand_coords, display_expand_data, and display_expand_data_vars f

These are a lot with potentially two more: indexes and encoding.

Should we instead do something like python xr.set_options(display_expand = { "data_vars": False, "coords": "default", "attrs": False, })

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  provide set_option `collapse_html` to control HTML repr collapsed state 657792526
814059710 https://github.com/pydata/xarray/pull/4230#issuecomment-814059710 https://api.github.com/repos/pydata/xarray/issues/4230 MDEyOklzc3VlQ29tbWVudDgxNDA1OTcxMA== tomwhite 85085 2021-04-06T11:54:06Z 2021-04-06T11:54:06Z CONTRIBUTOR

I would find it useful to have a generalized version of this for datasets, so it's possible to control independently whether the coordinates, data variables, and attributes sections are expanded by default.

I'd be happy to pick this up if no one else is working on it. I have created a branch to try it out, which adds the options display_expand_attrs, display_expand_coords, display_expand_data, and display_expand_data_vars for controlling both HTML and text representations. All default to True.

One thing I'm not sure about is maintaining the existing behaviour, which is that for the HTML dataset repr all three sections are expanded by default, up to a certain size limit, depending on the section (25 coordinates, 15 data variables, 10 attributes). I couldn't see a simple way to incorporate that, although maybe it's not needed if the sections can be collapsed by setting an option (e.g. xr.set_options(display_expand_attrs=False))?

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  provide set_option `collapse_html` to control HTML repr collapsed state 657792526
667488894 https://github.com/pydata/xarray/pull/4230#issuecomment-667488894 https://api.github.com/repos/pydata/xarray/issues/4230 MDEyOklzc3VlQ29tbWVudDY2NzQ4ODg5NA== pep8speaks 24736507 2020-08-01T07:33:36Z 2021-02-27T20:54:06Z NONE

Hello @michaelaye! Thanks for updating this PR. We checked the lines you've touched for PEP 8 issues, and found:

There are currently no PEP 8 issues detected in this Pull Request. Cheers! :beers:

Comment last updated at 2021-02-27 20:54:05 UTC
{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  provide set_option `collapse_html` to control HTML repr collapsed state 657792526
696423758 https://github.com/pydata/xarray/pull/4230#issuecomment-696423758 https://api.github.com/repos/pydata/xarray/issues/4230 MDEyOklzc3VlQ29tbWVudDY5NjQyMzc1OA== benbovy 4160723 2020-09-21T23:01:09Z 2020-09-21T23:01:09Z MEMBER

but I think a name like html_expand_data or html_collapse_data would be more descriptive, because this refer specifically to the "data" section of HTML reprs.

Do we want that this expand/collapse option affects the text repr too (i.e., collapsed = show inline values repr vs. expanded = show the whole data repr)? This might be more consistent, although obviously there's no way to interactively expand/collapse the data section in the text repr.

In that case display_expand_data or display_collapse_data would be better names (using the same prefix than the display_style option).

{
    "total_count": 1,
    "+1": 1,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  provide set_option `collapse_html` to control HTML repr collapsed state 657792526
667622174 https://github.com/pydata/xarray/pull/4230#issuecomment-667622174 https://api.github.com/repos/pydata/xarray/issues/4230 MDEyOklzc3VlQ29tbWVudDY2NzYyMjE3NA== shoyer 1217238 2020-08-02T03:45:40Z 2020-08-02T03:45:40Z MEMBER

The scope is limited enough here that it would be fine to include the cleanup in this PR. The bigger issue is that names exposed in a public API need to be chosen much more carefully than internal only names — and we definitely don’t want to expose the current poorly chosen internal name for this feature to users.

On Sat, Aug 1, 2020 at 7:32 PM Michael Aye notifications@github.com wrote:

i'm fine in fixing the name of the variable, but usually open source teams don't want a PR that addresses more than one issue at a time, are you sure you want it in here?

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/pydata/xarray/pull/4230#issuecomment-667615325, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAJJFVTTULSMPGZWCUNIGPTR6TF4LANCNFSM4O3LS7JA .

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  provide set_option `collapse_html` to control HTML repr collapsed state 657792526
667615325 https://github.com/pydata/xarray/pull/4230#issuecomment-667615325 https://api.github.com/repos/pydata/xarray/issues/4230 MDEyOklzc3VlQ29tbWVudDY2NzYxNTMyNQ== michaelaye 69774 2020-08-02T02:32:26Z 2020-08-02T02:32:26Z NONE

i'm fine in fixing the name of the variable, but usually open source teams don't want a PR that addresses more than one issue at a time, are you sure you want it in here?

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  provide set_option `collapse_html` to control HTML repr collapsed state 657792526
667601315 https://github.com/pydata/xarray/pull/4230#issuecomment-667601315 https://api.github.com/repos/pydata/xarray/issues/4230 MDEyOklzc3VlQ29tbWVudDY2NzYwMTMxNQ== shoyer 1217238 2020-08-01T23:48:07Z 2020-08-01T23:48:07Z MEMBER

I support adding an option for this, but I think a name like html_expand_data or html_collapse_data would be more descriptive, because this refer specifically to the "data" section of HTML reprs.

I also agree with @jsignell that the current naming seems to be reversed "expanded" should mean show the data section and "collapsed" should mean hiding it.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  provide set_option `collapse_html` to control HTML repr collapsed state 657792526
661877612 https://github.com/pydata/xarray/pull/4230#issuecomment-661877612 https://api.github.com/repos/pydata/xarray/issues/4230 MDEyOklzc3VlQ29tbWVudDY2MTg3NzYxMg== jsignell 4806877 2020-07-21T13:57:19Z 2020-07-21T13:57:29Z CONTRIBUTOR

I'm looking at the relevant test function:

python def test_repr_of_dataarray(dataarray): formatted = fh.array_repr(dataarray) assert "dim_0" in formatted # has an expanded data section assert formatted.count("class='xr-array-in' type='checkbox' checked>") == 1 # coords and attrs don't have an items so they'll be be disabled and collapsed assert ( formatted.count("class='xr-section-summary-in' type='checkbox' disabled >") == 2 )

does this only check on the number of collapsed sections?

Yes, that test counts expanded data sections and collapsed summary sections

How could I check specifically if the data section is collapsed based on the OPTION setting?

Use set_option as a context manager and do a test much like the one above.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  provide set_option `collapse_html` to control HTML repr collapsed state 657792526
659135636 https://github.com/pydata/xarray/pull/4230#issuecomment-659135636 https://api.github.com/repos/pydata/xarray/issues/4230 MDEyOklzc3VlQ29tbWVudDY1OTEzNTYzNg== michaelaye 69774 2020-07-16T03:27:43Z 2020-07-16T03:27:43Z NONE

I'm looking at the relevant test function:

python def test_repr_of_dataarray(dataarray): formatted = fh.array_repr(dataarray) assert "dim_0" in formatted # has an expanded data section assert formatted.count("class='xr-array-in' type='checkbox' checked>") == 1 # coords and attrs don't have an items so they'll be be disabled and collapsed assert ( formatted.count("class='xr-section-summary-in' type='checkbox' disabled >") == 2 )

I'm not very good with HTML, does this only check on the number of collapsed sections? I am kinda guessing that this code is abusing checkbox code to make the display collapsible? How could I check specifically if the data section is collapsed based on the OPTION setting?

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  provide set_option `collapse_html` to control HTML repr collapsed state 657792526
659126681 https://github.com/pydata/xarray/pull/4230#issuecomment-659126681 https://api.github.com/repos/pydata/xarray/issues/4230 MDEyOklzc3VlQ29tbWVudDY1OTEyNjY4MQ== michaelaye 69774 2020-07-16T02:55:25Z 2020-07-16T02:55:25Z NONE

Oh, implemented the wrong default, things were confusing as the HTML code "checked" for the collapsed variable apparently means NOT collapsed...

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  provide set_option `collapse_html` to control HTML repr collapsed state 657792526
659121827 https://github.com/pydata/xarray/pull/4230#issuecomment-659121827 https://api.github.com/repos/pydata/xarray/issues/4230 MDEyOklzc3VlQ29tbWVudDY1OTEyMTgyNw== michaelaye 69774 2020-07-16T02:37:32Z 2020-07-16T02:37:32Z NONE

For mypy I'm getting:

bash . is not a valid Python package name

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  provide set_option `collapse_html` to control HTML repr collapsed state 657792526
659120733 https://github.com/pydata/xarray/pull/4230#issuecomment-659120733 https://api.github.com/repos/pydata/xarray/issues/4230 MDEyOklzc3VlQ29tbWVudDY1OTEyMDczMw== michaelaye 69774 2020-07-16T02:33:56Z 2020-07-16T02:35:26Z NONE

I didn't isort this commit, usually other peeps hate it when i do it, happy that you actually require it! :)

But I'm getting this return while using isort -rc . in the root repo folder (is that the idea?)

bash $ isort -rc . (xarray-tests) /home/maye/miniconda3/envs/xarray-tests/lib/python3.7/site-packages/setuptools/distutils_patch.py:26: UserWarning: Distutils was imported before Setuptools. This usage is discouraged and may exhibit undesirable behaviors or errors. Please use Setuptools' objects directly or at least import Setuptools first. "Distutils was imported before Setuptools. This usage is discouraged " Skipped 4 files

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  provide set_option `collapse_html` to control HTML repr collapsed state 657792526

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