Skip to content

Commit 3b7c7c7

Browse files
committed
Push Timeout type alias to all relevant locations
1 parent 9ee4166 commit 3b7c7c7

File tree

2 files changed

+6
-7
lines changed

2 files changed

+6
-7
lines changed

pystac_client/client.py

+1-6
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,8 @@
77
Iterator,
88
List,
99
Optional,
10-
Tuple,
1110
Union,
1211
)
13-
from typing_extensions import TypeAlias
1412

1513
import pystac
1614
import pystac.utils
@@ -37,15 +35,12 @@
3735
QueryLike,
3836
SortbyLike,
3937
)
40-
from pystac_client.stac_api_io import StacApiIO
38+
from pystac_client.stac_api_io import StacApiIO, Timeout
4139

4240
if TYPE_CHECKING:
4341
from pystac.item import Item as Item_Type
4442

4543

46-
Timeout: TypeAlias = Optional[Union[float, Tuple[float, float], Tuple[float, None]]]
47-
48-
4944
class Client(pystac.Catalog):
5045
"""A Client for interacting with the root of a STAC Catalog or API
5146

pystac_client/stac_api_io.py

+5-1
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
Tuple,
1414
Union,
1515
)
16+
from typing_extensions import TypeAlias
1617
from urllib.parse import urlparse
1718

1819
import pystac
@@ -38,14 +39,17 @@
3839
logger = logging.getLogger(__name__)
3940

4041

42+
Timeout: TypeAlias = Optional[Union[float, Tuple[float, float], Tuple[float, None]]]
43+
44+
4145
class StacApiIO(DefaultStacIO):
4246
def __init__(
4347
self,
4448
headers: Optional[Dict[str, str]] = None,
4549
conformance: Optional[List[str]] = None,
4650
parameters: Optional[Dict[str, Any]] = None,
4751
request_modifier: Optional[Callable[[Request], Union[Request, None]]] = None,
48-
timeout: Optional[Union[float, Tuple[float, float], Tuple[float, None]]] = None,
52+
timeout: Timeout = None,
4953
):
5054
"""Initialize class for API IO
5155

0 commit comments

Comments
 (0)