From b84c858e5d083f71e1d6b92ff913e7a6b4e67659 Mon Sep 17 00:00:00 2001 From: Vini Salazar <17276653+vinisalazar@users.noreply.github.com> Date: Tue, 13 Sep 2022 13:39:36 -0300 Subject: [PATCH] Add __future__ import The '|' operator for typing was introduced in Python 3.10. This import allows previous Python versions to work with this operator. --- erddapy/objects/objects.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/erddapy/objects/objects.py b/erddapy/objects/objects.py index 043e001b..920e313b 100644 --- a/erddapy/objects/objects.py +++ b/erddapy/objects/objects.py @@ -1,7 +1,9 @@ """Main module of the 'objects' subpackage containing most classes.""" +from __future__ import annotations + from pathlib import Path -from typing import Dict, Union +from typing import Dict, Union # noqa StrLike = Union[str, bytes] FilePath = Union[str, Path] @@ -170,11 +172,11 @@ def connection(self, value: str | ERDDAPConnection): """Set private ._connection attribute.""" self._connection = ERDDAPConnection(ERDDAPConnection.to_string(value)) - def full_text_search(self, query: str) -> Dict[str, ERDDAPDataset]: + def full_text_search(self, query: str) -> dict[str, ERDDAPDataset]: """Search the server with native ERDDAP full text search capabilities.""" pass - def search(self, query: str) -> Dict[str, ERDDAPDataset]: + def search(self, query: str) -> dict[str, ERDDAPDataset]: """ Search the server with native ERDDAP full text search capabilities. @@ -182,6 +184,6 @@ def search(self, query: str) -> Dict[str, ERDDAPDataset]: """ return self.full_text_search(query) - def advanced_search(self, **kwargs) -> Dict[str, ERDDAPDataset]: + def advanced_search(self, **kwargs) -> dict[str, ERDDAPDataset]: """Search server with ERDDAP advanced search capabilities (may return pre-filtered datasets).""" pass