issue_comments
4 rows where issue = 1422460071 sorted by updated_at descending
This data as json, CSV (advanced)
Suggested facets: created_at (date), updated_at (date)
issue 1
- Incorrect handle to Dagster frozenlists in Dataset object · 4 ✖
id | html_url | issue_url | node_id | user | created_at | updated_at ▲ | author_association | body | reactions | performed_via_github_app | issue |
---|---|---|---|---|---|---|---|---|---|---|---|
1295785782 | https://github.com/pydata/xarray/issues/7211#issuecomment-1295785782 | https://api.github.com/repos/pydata/xarray/issues/7211 | IC_kwDOAMm_X85NPB82 | airton-neto 64480652 | 2022-10-29T09:39:35Z | 2022-10-29T09:39:35Z | NONE | I see, the user would be responsible to manage whats he's doing. I think this answer closes this issue, then, as this behaviour is indeed expected. Thanks for your helping. Nice work! |
{ "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
Incorrect handle to Dagster frozenlists in Dataset object 1422460071 | |
1295779740 | https://github.com/pydata/xarray/issues/7211#issuecomment-1295779740 | https://api.github.com/repos/pydata/xarray/issues/7211 | IC_kwDOAMm_X85NPAec | headtr1ck 43316012 | 2022-10-29T09:14:31Z | 2022-10-29T09:14:31Z | COLLABORATOR | I think we wanted to explicitly support any hashable (e.g. tuples or as in this case frozenlists) as variable or dimension "names". |
{ "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
Incorrect handle to Dagster frozenlists in Dataset object 1422460071 | |
1295372811 | https://github.com/pydata/xarray/issues/7211#issuecomment-1295372811 | https://api.github.com/repos/pydata/xarray/issues/7211 | IC_kwDOAMm_X85NNdIL | airton-neto 64480652 | 2022-10-28T19:26:45Z | 2022-10-28T19:41:36Z | NONE | Hey @TomNicholas, thanks for replying me back! The problem is they chose to define how to hash a list (which is no hashable) by parsing it to a tuple ```python class frozenlist(list): def readonly(self, args, *kwargs): raise RuntimeError("Cannot modify ReadOnlyList")
``` Dataset class defines getitem by
It tries to hash the key (and this frozenlist do this without any error). I've checked out how pandas library deal with this task. They have a much more complex structure to deal with this problem (I haven't read all of the code below to understand): ```python def getitem(self, key): check_deprecated_indexers(key) key = lib.item_from_zerodim(key) key = com.apply_if_callable(key, self)
``` This similar code, by the way, runs correctly ```python %%import pandas as pd data = pd.DataFrame({'a': [1], 'b': [2]}) variables = frozenlist(['a']) data[variables] ``` Now it is a matter of how xarray want to treat this issue. If you do want to change your way of doing this, I could try coding and request this PR trying pandas approach. Anyway, I will report this issue back to Dagster for them to check this discussion too. Maybe they see their side is worth changing. Let me know what is your view about this! Links: https://github.com/pydata/xarray/blob/e1936a98059ae29da2861f58a7aff4a56302aac1/xarray/core/dataset.py#L1419 https://github.com/pandas-dev/pandas/blob/v1.5.1/pandas/core/frame.py#L473-L11983 |
{ "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
Incorrect handle to Dagster frozenlists in Dataset object 1422460071 | |
1293975333 | https://github.com/pydata/xarray/issues/7211#issuecomment-1293975333 | https://api.github.com/repos/pydata/xarray/issues/7211 | IC_kwDOAMm_X85NIH8l | TomNicholas 35968931 | 2022-10-27T19:33:55Z | 2022-10-27T19:40:19Z | MEMBER | Hi @airton-neto - here is a much shorter example that reproduces the same error ```python url = 'https://rda.ucar.edu/thredds/dodsC/files/g/ds084.1/2022/20220201/gfs.0p25.2022020100.f000.grib2' dataset = xr.open_dataset(url, cache=True, engine="netcdf4")
variables = list(['u-component_of_wind_height_above_ground']) # <--- This way it runsvariables = frozenlist(['u-component_of_wind_height_above_ground']) dataset[variables] ``` ```pythonKeyError Traceback (most recent call last) File ~/miniconda3/envs/py39/lib/python3.9/site-packages/xarray/core/dataset.py:1317, in Dataset._construct_dataarray(self, name) 1316 try: -> 1317 variable = self._variables[name] 1318 except KeyError: KeyError: ['u-component_of_wind_height_above_ground'] During handling of the above exception, another exception occurred: KeyError Traceback (most recent call last) Input In [43], in <cell line: 1>() ----> 1 dataset[variables] File ~/miniconda3/envs/py39/lib/python3.9/site-packages/xarray/core/dataset.py:1410, in Dataset.getitem(self, key) 1408 return self.isel(**key) 1409 if utils.hashable(key): -> 1410 return self._construct_dataarray(key) 1411 if utils.iterable_of_hashable(key): 1412 return self._copy_listed(key) File ~/miniconda3/envs/py39/lib/python3.9/site-packages/xarray/core/dataset.py:1319, in Dataset.construct_dataarray(self, name) 1317 variable = self._variables[name] 1318 except KeyError: -> 1319 , name, variable = _get_virtual_variable(self._variables, name, self.dims) 1321 needed_dims = set(variable.dims) 1323 coords: dict[Hashable, Variable] = {} File ~/miniconda3/envs/py39/lib/python3.9/site-packages/xarray/core/dataset.py:171, in _get_virtual_variable(variables, key, dim_sizes) 168 return key, key, variable 170 if not isinstance(key, str): --> 171 raise KeyError(key) 173 split_key = key.split(".", 1) 174 if len(split_key) != 2: KeyError: ['u-component_of_wind_height_above_ground'] ``` I'm not immediately sure why the elements of the list are not properly extracted, but the Having said that if you want to submit a PR which fixes this bug (and doesn't require special-casing dagster somehow) then that would be welcome too! |
{ "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
Incorrect handle to Dagster frozenlists in Dataset object 1422460071 |
Advanced export
JSON shape: default, array, newline-delimited, object
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]);
user 3