Skip to content

Commit 1485a27

Browse files
committed
Fix that removes data vars while preserving dimension coordinates so isel works correctly.
1 parent 0c5afab commit 1485a27

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

xarray_sql/reader.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -271,7 +271,7 @@ def make_stream(
271271
else:
272272
# Only dimension coords requested — drop all data vars to avoid
273273
# loading them unnecessarily (e.g. for queries like SELECT lat, lon).
274-
ds_block = ds[[]].isel(block)
274+
ds_block = ds.drop_vars(list(ds.data_vars)).isel(block)
275275
batch_schema = pa.schema(
276276
[schema.field(name) for name in projection_names]
277277
)

0 commit comments

Comments
 (0)