Skip to content

Commit

Permalink
Add __future__ import
Browse files Browse the repository at this point in the history
  The '|' operator for typing was introduced in Python 3.10. This import
  allows previous Python versions to work with this operator.
  • Loading branch information
vinisalazar committed Sep 13, 2022
1 parent 357c997 commit b84c858
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions erddapy/objects/objects.py
Original file line number Diff line number Diff line change
@@ -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]
Expand Down Expand Up @@ -170,18 +172,18 @@ 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.
Also see ERDDAPServer.full_text_search.
"""
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

0 comments on commit b84c858

Please sign in to comment.