File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -183,18 +183,15 @@ def read_xarray(ds: xr.Dataset, chunks: Chunks = None) -> pa.RecordBatchReader:
183183 Returns:
184184 A PyArrow Table, which is a table representation of the input Dataset.
185185 """
186- fst = next (iter (ds .values ())).dims
187- assert all (
188- da .dims == fst for da in ds .values ()
189- ), "All dimensions must be equal. Please filter data_vars in the Dataset."
190-
191- blocks = list (block_slices (ds , chunks ))
192186
193187 def pivot_block (b : Block ):
194188 return pivot (ds .isel (b ))
195189
196- schema = pa .Schema .from_pandas (pivot_block (blocks [0 ]))
197- last_schema = pa .Schema .from_pandas (pivot_block (blocks [- 1 ]))
198- assert schema == last_schema , "Schemas must be consistent across blocks!"
190+ fst = next (iter (ds .values ())).dims
191+ assert all (
192+ da .dims == fst for da in ds .values ()
193+ ), "All dimensions must be equal. Please filter data_vars in the Dataset."
199194
195+ schema = _parse_schema (ds )
196+ blocks = block_slices (ds , chunks )
200197 return from_map_batched (pivot_block , blocks , schema = schema )
You can’t perform that action at this time.
0 commit comments