html_url,issue_url,id,node_id,user,created_at,updated_at,author_association,body,reactions,performed_via_github_app,issue
https://github.com/pydata/xarray/issues/4821#issuecomment-860240046,https://api.github.com/repos/pydata/xarray/issues/4821,860240046,MDEyOklzc3VlQ29tbWVudDg2MDI0MDA0Ng==,37740986,2021-06-13T16:49:05Z,2021-06-13T16:51:36Z,CONTRIBUTOR,"Ok, I think I understand better now
Almost finished, I just have one test that fails currently, it is this one:
https://github.com/pydata/xarray/blob/e17cf595c84dffdd73c668f6d945c1b0eeba13d6/xarray/tests/test_dataset.py#L3299-L3306
The error changed from a KeyError to the error that I wrote in the constructor :
```
> raise TypeError(f'The dimension provided is a tuple, you may intended to pass a list')
E TypeError: The dimension provided is a tuple, you may intended to pass a list
```
I am not sure what I should do with it, should I delete it ?
(Thanks for your help :))","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,787847449
https://github.com/pydata/xarray/issues/4821#issuecomment-859736218,https://api.github.com/repos/pydata/xarray/issues/4821,859736218,MDEyOklzc3VlQ29tbWVudDg1OTczNjIxOA==,37740986,2021-06-11T17:35:28Z,2021-06-11T17:35:28Z,CONTRIBUTOR,"I think I am quite confused by the fact that 'one' dimension can be a tuple (also I couldn't find a way to successfully create a dataset with a dim being a tuple, even by tweaking your example using list)
Was it what you imagined for the dataset construction ? (If I understand right, a virtual variable can't be a tuple)
```
def _construct_dataarray(self, name: Hashable) -> ""DataArray"":
""""""Construct a DataArray by indexing this dataset""""""
from .dataarray import DataArray
try:
variable = self._variables[name]
except KeyError:
if isinstance(name, tuple):
raise TypeError(f'The dimension ""{name}"" provided is a tuple, you may be intended to pass it as a list')
else:
_, name, variable = _get_virtual_variable(
self._variables, name, self._level_coords, self.dims
)
```","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,787847449
https://github.com/pydata/xarray/issues/4821#issuecomment-859678312,https://api.github.com/repos/pydata/xarray/issues/4821,859678312,MDEyOklzc3VlQ29tbWVudDg1OTY3ODMxMg==,37740986,2021-06-11T15:56:22Z,2021-06-11T15:56:22Z,CONTRIBUTOR,"You seemed to all agree on the solution 1:
> Explicitly allow tuples as dimension and variable names. This is probably the most mypy-compatible, since we use Hashable in lots of places
If you allow explicitly tuple, doesn't it mean I need to edit this part (as mentioned by @mathause) :
```
if not isinstance(variables, (list, tuple)):
variables = [variables]
```
(I tried and it works well)
But you said after :
> If it's a tuple, that message can suggest passing it as a list.
(I find it a little bit weird to give dimensions in list, no ? I thought that generally tuples were more adapted to provide dims)
Can you tell me which test-case I can implement to fulfill all the requirements needed ? I can't think of test cases that I can implement except the one suggested first, and that one passes with the first modification
Also the code you mentioned is for one dim, but in this case we can have a list of dims, it does means that I need to do a 'for loop' for checking the existence of the dims, right ? ","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,787847449
https://github.com/pydata/xarray/issues/4821#issuecomment-855278196,https://api.github.com/repos/pydata/xarray/issues/4821,855278196,MDEyOklzc3VlQ29tbWVudDg1NTI3ODE5Ng==,37740986,2021-06-05T18:31:00Z,2021-06-05T19:07:03Z,CONTRIBUTOR,"(@max-sixty , I originally took this one because I wanted to do one more ~easy PR. I just saw you modified the tags, lmk if this one is problematic or if you know other issues I could tackle)","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,787847449
https://github.com/pydata/xarray/issues/4821#issuecomment-855201627,https://api.github.com/repos/pydata/xarray/issues/4821,855201627,MDEyOklzc3VlQ29tbWVudDg1NTIwMTYyNw==,37740986,2021-06-05T07:54:57Z,2021-06-05T07:54:57Z,CONTRIBUTOR,"@mesejo Do you still work on it ? If not, I am interested to work on it","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,787847449