Skip to content

Commit

Permalink
Update xarray/core/dataset.py
Browse files Browse the repository at this point in the history
  • Loading branch information
hmaarrfk authored May 6, 2024
1 parent b0c52b2 commit ef95538
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions xarray/core/dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -2994,8 +2994,7 @@ def isel(
# without any relevant dimensions for slicing.
# Pick those out quickly and avoid paying the cost below
# of resolving the var_indexers variables
var_indexer_keys = all_keys.intersection(var_dims)
if var_indexer_keys:
if var_indexer_keys := all_keys.intersection(var_dims):
var_indexers = {k: indexers[k] for k in var_indexer_keys}
var = var.isel(var_indexers)
if drop and var.ndim == 0 and name in coord_names:
Expand Down

0 comments on commit ef95538

Please sign in to comment.