File tree Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -103,7 +103,14 @@ def validate(self, da: xr.DataArray) -> xr.DataArray:
103
103
raise NotImplementedError ('coords schema not implemented yet' )
104
104
105
105
if self .chunks :
106
- raise NotImplementedError ('chunk schema not implemented yet' )
106
+ # ensure that the chunks are what you want them to be
107
+ for dim , expected in self .chunks .items ():
108
+ # for special case of chunksize=-1, make the expected equal to the full length of that dimension
109
+ if expected == - 1 :
110
+ expected = len (da [dim ])
111
+ actual = da .chunks [dim ][0 ]
112
+ if actual != expected :
113
+ raise SchemaError (f'chunk mismatch for dimension { dim } : { actual } != { expected } ' )
107
114
108
115
if self .attrs :
109
116
raise NotImplementedError ('attrs schema not implemented yet' )
You can’t perform that action at this time.
0 commit comments