File tree Expand file tree Collapse file tree 2 files changed +18
-18
lines changed Expand file tree Collapse file tree 2 files changed +18
-18
lines changed Original file line number Diff line number Diff line change @@ -34,6 +34,8 @@ Bug fixes
34
34
allowing the ``encoding `` and ``unlimited_dims `` options with ``save_mfdataset ``.
35
35
(:issue: `6684 `)
36
36
By `Travis A. O'Brien <https://github.com/taobrienlbl >`_.
37
+ - Fix backend support of pydap versions <3.3.0 (:issue: `6648 `, :pull: `6656 `).
38
+ By `Hauke Schulz <https://github.com/observingClouds >`_.
37
39
- :py:meth: `Dataset.where ` with ``drop=True `` now behaves correctly with mixed dimensions.
38
40
(:issue: `6227 `, :pull: `6690 `)
39
41
By `Michael Niklas <https://github.com/headtr1ck >`_.
Original file line number Diff line number Diff line change 1
1
from __future__ import annotations
2
2
3
3
import numpy as np
4
+ from packaging .version import Version
4
5
5
6
from ..core import indexing
6
7
from ..core .pycompat import integer_types
17
18
18
19
try :
19
20
import pydap .client
21
+ import pydap .lib
20
22
23
+ pydap_version = pydap .lib .__version__
21
24
has_pydap = True
22
25
except ModuleNotFoundError :
23
26
has_pydap = False
@@ -99,29 +102,24 @@ def open(
99
102
user_charset = None ,
100
103
):
101
104
102
- if output_grid is None :
103
- output_grid = True
104
-
105
- if verify is None :
106
- verify = True
107
-
108
105
if timeout is None :
109
106
from pydap .lib import DEFAULT_TIMEOUT
110
107
111
108
timeout = DEFAULT_TIMEOUT
112
109
113
- if user_charset is None :
114
- user_charset = "ascii"
115
-
116
- ds = pydap .client .open_url (
117
- url = url ,
118
- application = application ,
119
- session = session ,
120
- output_grid = output_grid ,
121
- timeout = timeout ,
122
- verify = verify ,
123
- user_charset = user_charset ,
124
- )
110
+ kwargs = {
111
+ "url" : url ,
112
+ "application" : application ,
113
+ "session" : session ,
114
+ "output_grid" : output_grid or True ,
115
+ "timeout" : timeout ,
116
+ }
117
+ if Version (pydap_version ) >= Version ("3.3.0" ):
118
+ if verify is not None :
119
+ kwargs .update ({"verify" : verify })
120
+ if user_charset is not None :
121
+ kwargs .update ({"user_charset" : user_charset })
122
+ ds = pydap .client .open_url (** kwargs )
125
123
return cls (ds )
126
124
127
125
def open_store_variable (self , var ):
You can’t perform that action at this time.
0 commit comments