Commit 15328b6
authored
Declare Dataset, DataArray, Variable, GroupBy unhashable (#8392)
* Add unhashable to generate_ops
* Regenerate _typed_ops after adding "unhashable"
* Fix variable redefinition
The previous commit revealed the following mypy error:
xarray/core/dataset.py: note: In member "swap_dims" of class "Dataset":
xarray/core/dataset.py:4415: error: Incompatible types in assignment (expression has type "Variable", variable has type "Hashable") [assignment]
xarray/core/dataset.py:4415: note: Following member(s) of "Variable" have conflicts:
xarray/core/dataset.py:4415: note: __hash__: expected "Callable[[], int]", got "None"
xarray/core/dataset.py:4416: error: "Hashable" has no attribute "dims" [attr-defined]
xarray/core/dataset.py:4419: error: "Hashable" has no attribute "to_index_variable" [attr-defined]
xarray/core/dataset.py:4430: error: "Hashable" has no attribute "to_base_variable" [attr-defined]1 parent feba698 commit 15328b6
3 files changed
+43
-15
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
83 | 83 | | |
84 | 84 | | |
85 | 85 | | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
86 | 90 | | |
87 | 91 | | |
88 | 92 | | |
| |||
291 | 295 | | |
292 | 296 | | |
293 | 297 | | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
294 | 302 | | |
295 | 303 | | |
296 | 304 | | |
| |||
643 | 651 | | |
644 | 652 | | |
645 | 653 | | |
| 654 | + | |
| 655 | + | |
| 656 | + | |
| 657 | + | |
646 | 658 | | |
647 | 659 | | |
648 | 660 | | |
| |||
851 | 863 | | |
852 | 864 | | |
853 | 865 | | |
| 866 | + | |
| 867 | + | |
| 868 | + | |
| 869 | + | |
854 | 870 | | |
855 | 871 | | |
856 | 872 | | |
| |||
973 | 989 | | |
974 | 990 | | |
975 | 991 | | |
| 992 | + | |
| 993 | + | |
| 994 | + | |
| 995 | + | |
976 | 996 | | |
977 | 997 | | |
978 | 998 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4410 | 4410 | | |
4411 | 4411 | | |
4412 | 4412 | | |
4413 | | - | |
4414 | | - | |
| 4413 | + | |
| 4414 | + | |
4415 | 4415 | | |
4416 | | - | |
| 4416 | + | |
4417 | 4417 | | |
4418 | 4418 | | |
4419 | | - | |
| 4419 | + | |
| 4420 | + | |
| 4421 | + | |
4420 | 4422 | | |
4421 | | - | |
4422 | | - | |
| 4423 | + | |
| 4424 | + | |
4423 | 4425 | | |
4424 | 4426 | | |
4425 | 4427 | | |
| |||
4429 | 4431 | | |
4430 | 4432 | | |
4431 | 4433 | | |
4432 | | - | |
4433 | | - | |
| 4434 | + | |
| 4435 | + | |
4434 | 4436 | | |
4435 | | - | |
4436 | | - | |
| 4437 | + | |
| 4438 | + | |
4437 | 4439 | | |
4438 | | - | |
4439 | | - | |
4440 | | - | |
| 4440 | + | |
| 4441 | + | |
| 4442 | + | |
4441 | 4443 | | |
4442 | 4444 | | |
4443 | 4445 | | |
4444 | 4446 | | |
4445 | 4447 | | |
4446 | 4448 | | |
4447 | | - | |
| 4449 | + | |
4448 | 4450 | | |
4449 | | - | |
| 4451 | + | |
4450 | 4452 | | |
4451 | 4453 | | |
4452 | 4454 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
116 | 116 | | |
117 | 117 | | |
118 | 118 | | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
119 | 123 | | |
120 | 124 | | |
121 | 125 | | |
| |||
152 | 156 | | |
153 | 157 | | |
154 | 158 | | |
| 159 | + | |
155 | 160 | | |
156 | 161 | | |
157 | 162 | | |
| |||
185 | 190 | | |
186 | 191 | | |
187 | 192 | | |
| 193 | + | |
188 | 194 | | |
189 | 195 | | |
190 | 196 | | |
| |||
0 commit comments