Skip to content

Commit 6caca80

Browse files
committed
let pydap handle exceptions/warning
1 parent 983d090 commit 6caca80

File tree

1 file changed

+2
-14
lines changed

1 file changed

+2
-14
lines changed

xarray/backends/pydap_.py

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
from __future__ import annotations
22

3-
import warnings
43
from collections.abc import Iterable
54
from typing import TYPE_CHECKING, Any
65

@@ -166,26 +165,15 @@ def open(
166165
elif hasattr(url, "ds"):
167166
# pydap dataset
168167
dataset = url.ds
169-
args = {"dataset": dataset}
170-
args["checksums"] = checksums
168+
args = {"dataset": dataset, "checksums": checksums}
171169
if group:
172170
args["group"] = group
173171
if url.startswith(("http", "dap2")):
174172
args["protocol"] = "dap2"
175173
elif url.startswith("dap4"):
176174
args["protocol"] = "dap4"
177175
if batch:
178-
if args["protocol"] == "dap2":
179-
warnings.warn(
180-
f"`batch={batch}` is currently only compatible with the `DAP4` "
181-
"protocol. Make sue the OPeNDAP server implements the `DAP4` "
182-
"protocol and then replace the scheme of the url with `dap4` "
183-
"to make use of it. Setting `batch=False`.",
184-
stacklevel=2,
185-
)
186-
else:
187-
# only update if dap4
188-
args["batch"] = batch
176+
args["batch"] = batch
189177
return cls(**args)
190178

191179
def open_store_variable(self, var):

0 commit comments

Comments
 (0)