Skip to content

Commit 62583c8

Browse files
committed
Add __future__ import
The '|' operator for typing was introduced in Python 3.10. This import allows previous Python versions to work with this operator.
1 parent 357c997 commit 62583c8

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

erddapy/objects/objects.py

+6-4
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
"""Main module of the 'objects' subpackage containing most classes."""
22

3+
from __future__ import annotations
4+
35
from pathlib import Path
4-
from typing import Dict, Union
6+
from typing import Union
57

68
StrLike = Union[str, bytes]
79
FilePath = Union[str, Path]
@@ -170,18 +172,18 @@ def connection(self, value: str | ERDDAPConnection):
170172
"""Set private ._connection attribute."""
171173
self._connection = ERDDAPConnection(ERDDAPConnection.to_string(value))
172174

173-
def full_text_search(self, query: str) -> Dict[str, ERDDAPDataset]:
175+
def full_text_search(self, query: str) -> dict[str, ERDDAPDataset]:
174176
"""Search the server with native ERDDAP full text search capabilities."""
175177
pass
176178

177-
def search(self, query: str) -> Dict[str, ERDDAPDataset]:
179+
def search(self, query: str) -> dict[str, ERDDAPDataset]:
178180
"""
179181
Search the server with native ERDDAP full text search capabilities.
180182
181183
Also see ERDDAPServer.full_text_search.
182184
"""
183185
return self.full_text_search(query)
184186

185-
def advanced_search(self, **kwargs) -> Dict[str, ERDDAPDataset]:
187+
def advanced_search(self, **kwargs) -> dict[str, ERDDAPDataset]:
186188
"""Search server with ERDDAP advanced search capabilities (may return pre-filtered datasets)."""
187189
pass

0 commit comments

Comments
 (0)