home / github

Menu
  • Search all tables
  • GraphQL API

issue_comments

Table actions
  • GraphQL API for issue_comments

7 rows where issue = 1405752975 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 6

  • derhintze 2
  • dcherian 1
  • Illviljan 1
  • keewis 1
  • TomNicholas 1
  • headtr1ck 1

author_association 3

  • MEMBER 4
  • NONE 2
  • COLLABORATOR 1

issue 1

  • Plotting empty DataArray oddly raises ImportError · 7 ✖
id html_url issue_url node_id user created_at updated_at ▲ author_association body reactions performed_via_github_app issue
1277103850 https://github.com/pydata/xarray/issues/7156#issuecomment-1277103850 https://api.github.com/repos/pydata/xarray/issues/7156 IC_kwDOAMm_X85MHw7q derhintze 25172489 2022-10-13T06:40:59Z 2022-10-13T06:40:59Z NONE

This is raised by matplotlib, not pandas. Personally, I prefer aligning with upstream projects, so I'd pick that very same error.

One could argue that it's a ValueError in the sense that there's no data to plot, which is like an invalid value. But I also could see why they picked TypeError, because one could have non-numeric (but not empty) data. But yeah, this is nitpicking, I suppose 😆

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Plotting empty DataArray oddly raises ImportError 1405752975
1276771566 https://github.com/pydata/xarray/issues/7156#issuecomment-1276771566 https://api.github.com/repos/pydata/xarray/issues/7156 IC_kwDOAMm_X85MGfzu headtr1ck 43316012 2022-10-12T21:49:27Z 2022-10-12T21:49:27Z COLLABORATOR

pandas raises an error when plotting an empty dataframe:

python ... TypeError: no numeric data to plot Not sure if TypeError is correct? Should it not be a ValueError?

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Plotting empty DataArray oddly raises ImportError 1405752975
1276752500 https://github.com/pydata/xarray/issues/7156#issuecomment-1276752500 https://api.github.com/repos/pydata/xarray/issues/7156 IC_kwDOAMm_X85MGbJ0 Illviljan 14371165 2022-10-12T21:24:57Z 2022-10-12T21:24:57Z MEMBER

pandas raises an error when plotting an empty dataframe: ```python import pandas as pd

a = pd.DataFrame()

a.plot() Traceback (most recent call last):

File "C:\Users\J.W\AppData\Local\Temp\ipykernel_14580\3422621525.py", line 1, in <cell line: 1> a.plot()

File "C:\Users\J.W\anaconda3\envs\xarray-tests\lib\site-packages\pandas\plotting_core.py", line 1001, in call return plot_backend.plot(data, kind=kind, **kwargs)

File "C:\Users\J.W\anaconda3\envs\xarray-tests\lib\site-packages\pandas\plotting_matplotlib__init__.py", line 71, in plot plot_obj.generate()

File "C:\Users\J.W\anaconda3\envs\xarray-tests\lib\site-packages\pandas\plotting_matplotlib\core.py", line 451, in generate self._compute_plot_data()

File "C:\Users\J.W\anaconda3\envs\xarray-tests\lib\site-packages\pandas\plotting_matplotlib\core.py", line 636, in _compute_plot_data raise TypeError("no numeric data to plot")

TypeError: no numeric data to plot ```

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Plotting empty DataArray oddly raises ImportError 1405752975
1276635221 https://github.com/pydata/xarray/issues/7156#issuecomment-1276635221 https://api.github.com/repos/pydata/xarray/issues/7156 IC_kwDOAMm_X85MF-hV dcherian 2448579 2022-10-12T19:21:00Z 2022-10-12T19:21:00Z MEMBER

I don't think we have a test for plotting empty DataArrays, so no combination of dependencies would've picked that up?

We should just explicitly check for da.size > 0 before trying anything in .plot

{
    "total_count": 1,
    "+1": 1,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Plotting empty DataArray oddly raises ImportError 1405752975
1276623786 https://github.com/pydata/xarray/issues/7156#issuecomment-1276623786 https://api.github.com/repos/pydata/xarray/issues/7156 IC_kwDOAMm_X85MF7uq keewis 14808389 2022-10-12T19:11:38Z 2022-10-12T19:11:38Z MEMBER

the issue is that we only have a minimum dependencies CI (i.e. pandas and numpy but not matplotlib) and one that tests all dependencies with minimum versions. This means that we don't have an environment could have caught this (we'd need one with matplotlib but not nc-time-axis). This case is one of the issues we run into with so many optional dependencies: we can't just test every combination of them (the "all but dask" CI is an exception).

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Plotting empty DataArray oddly raises ImportError 1405752975
1276555939 https://github.com/pydata/xarray/issues/7156#issuecomment-1276555939 https://api.github.com/repos/pydata/xarray/issues/7156 IC_kwDOAMm_X85MFrKj TomNicholas 35968931 2022-10-12T18:11:52Z 2022-10-12T18:11:52Z MEMBER

Thanks for the bug report @derhintze !

I'm confused as to why this wasn't caught by our tests - I thought we had a minimum-dependencies test run in our suite :confused:

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Plotting empty DataArray oddly raises ImportError 1405752975
1275752988 https://github.com/pydata/xarray/issues/7156#issuecomment-1275752988 https://api.github.com/repos/pydata/xarray/issues/7156 IC_kwDOAMm_X85MCnIc derhintze 25172489 2022-10-12T08:01:31Z 2022-10-12T08:01:31Z NONE

👁️ @headtr1ck

{
    "total_count": 2,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 2
}
  Plotting empty DataArray oddly raises ImportError 1405752975

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