File tree 1 file changed +11
-3
lines changed
1 file changed +11
-3
lines changed Original file line number Diff line number Diff line change @@ -2061,9 +2061,17 @@ def load(self):
2061
2061
# https://github.com/python/mypy/issues/1465
2062
2062
@Variable .data .setter # type: ignore
2063
2063
def data (self , data ):
2064
- Variable .data .fset (self , data )
2065
- if not isinstance (self ._data , PandasIndexAdapter ):
2066
- self ._data = PandasIndexAdapter (self ._data )
2064
+ raise ValueError (
2065
+ f"Cannot assign to the .data attribute of dimension coordinate a.k.a IndexVariable { self .name !r} . "
2066
+ f"Please use DataArray.assign_coords, Dataset.assign_coords or Dataset.assign as appropriate."
2067
+ )
2068
+
2069
+ @Variable .values .setter # type: ignore
2070
+ def values (self , values ):
2071
+ raise ValueError (
2072
+ f"Cannot assign to the .values attribute of dimension coordinate a.k.a IndexVariable { self .name !r} . "
2073
+ f"Please use DataArray.assign_coords, Dataset.assign_coords or Dataset.assign as appropriate."
2074
+ )
2067
2075
2068
2076
def chunk (self , chunks = None , name = None , lock = False ):
2069
2077
# Dummy - do not chunk. This method is invoked e.g. by Dataset.chunk()
You can’t perform that action at this time.
0 commit comments