Skip to content

Commit dfe9b87

Browse files
committed
fix non-awaited load_async
1 parent cca7589 commit dfe9b87

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

xarray/core/dataset.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -547,12 +547,12 @@ def load(self, **kwargs) -> Self:
547547
self.variables[k].data = data
548548

549549
# load everything else sequentially
550-
[v.load_async() for k, v in self.variables.items() if k not in chunked_data]
550+
[v.load() for k, v in self.variables.items() if k not in chunked_data]
551551

552552
return self
553553

554554
async def load_async(self, **kwargs) -> Self:
555-
# TODO refactor this to pul out the common chunked_data codepath
555+
# TODO refactor this to pull out the common chunked_data codepath
556556

557557
# this blocks on chunked arrays but not on lazily indexed arrays
558558

@@ -572,10 +572,10 @@ async def load_async(self, **kwargs) -> Self:
572572
self.variables[k].data = data
573573

574574
# load everything else concurrently
575-
tasks = [
575+
coros = [
576576
v.load_async() for k, v in self.variables.items() if k not in chunked_data
577577
]
578-
await asyncio.gather(*tasks)
578+
await asyncio.gather(*coros)
579579

580580
return self
581581

0 commit comments

Comments
 (0)