Skip to content

Commit 1687221

Browse files
committed
improve handling of dims vs dimensions deprecation warning
1 parent 04da264 commit 1687221

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

xarray/backends/pydap_.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535

3636

3737
class PydapArrayWrapper(BackendArray):
38-
def __init__(self, array, batch=False, checksums=True):
38+
def __init__(self, array, batch=None, checksums=True):
3939
self.array = array
4040
self._batch = batch
4141
self._checksums = checksums
@@ -167,11 +167,11 @@ def open(
167167
return cls(**args)
168168

169169
def open_store_variable(self, var):
170-
try:
170+
if hasattr(var, "dims"):
171171
dimensions = [
172172
dim.split("/")[-1] if dim.startswith("/") else dim for dim in var.dims
173173
]
174-
except AttributeError:
174+
else:
175175
# GridType does not have a dims attribute - instead get `dimensions`
176176
# see https://github.com/pydap/pydap/issues/485
177177
dimensions = var.dimensions

0 commit comments

Comments
 (0)