Skip to content

Commit

Permalink
Push Timeout type alias to all relevant locations
Browse files Browse the repository at this point in the history
  • Loading branch information
jpolchlo committed Apr 20, 2023
1 parent 9ee4166 commit 3b7c7c7
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
7 changes: 1 addition & 6 deletions pystac_client/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,8 @@
Iterator,
List,
Optional,
Tuple,
Union,
)
from typing_extensions import TypeAlias

import pystac
import pystac.utils
Expand All @@ -37,15 +35,12 @@
QueryLike,
SortbyLike,
)
from pystac_client.stac_api_io import StacApiIO
from pystac_client.stac_api_io import StacApiIO, Timeout

if TYPE_CHECKING:
from pystac.item import Item as Item_Type


Timeout: TypeAlias = Optional[Union[float, Tuple[float, float], Tuple[float, None]]]


class Client(pystac.Catalog):
"""A Client for interacting with the root of a STAC Catalog or API
Expand Down
6 changes: 5 additions & 1 deletion pystac_client/stac_api_io.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
Tuple,
Union,
)
from typing_extensions import TypeAlias
from urllib.parse import urlparse

import pystac
Expand All @@ -38,14 +39,17 @@
logger = logging.getLogger(__name__)


Timeout: TypeAlias = Optional[Union[float, Tuple[float, float], Tuple[float, None]]]


class StacApiIO(DefaultStacIO):
def __init__(
self,
headers: Optional[Dict[str, str]] = None,
conformance: Optional[List[str]] = None,
parameters: Optional[Dict[str, Any]] = None,
request_modifier: Optional[Callable[[Request], Union[Request, None]]] = None,
timeout: Optional[Union[float, Tuple[float, float], Tuple[float, None]]] = None,
timeout: Timeout = None,
):
"""Initialize class for API IO
Expand Down

0 comments on commit 3b7c7c7

Please sign in to comment.