Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tighten the Timeout type to non-optional #538

Merged
merged 1 commit into from
Jun 12, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.

### Added

- Timeout option added to `Client.open` [#463](https://github.com/stac-utils/pystac-client/pull/463)
- Timeout option added to `Client.open` [#463](https://github.com/stac-utils/pystac-client/pull/463), [#538](https://github.com/stac-utils/pystac-client/pull/538)
- Support for fetching catalog queryables [#477](https://github.com/stac-utils/pystac-client/pull/477)
- PySTAC Client specific warnings [#480](https://github.com/stac-utils/pystac-client/pull/480)
- Support for fetching and merging a selection of queryables [#511](https://github.com/stac-utils/pystac-client/pull/511)
Expand Down
4 changes: 2 additions & 2 deletions pystac_client/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ def open(
modifier: Optional[Callable[[Modifiable], None]] = None,
request_modifier: Optional[Callable[[Request], Union[Request, None]]] = None,
stac_io: Optional[StacApiIO] = None,
timeout: Timeout = None,
timeout: Optional[Timeout] = None,
) -> "Client":
"""Opens a STAC Catalog or API
This function will read the root catalog of a STAC Catalog or API
Expand Down Expand Up @@ -197,7 +197,7 @@ def from_file( # type: ignore
parameters: Optional[Dict[str, Any]] = None,
modifier: Optional[Callable[[Modifiable], None]] = None,
request_modifier: Optional[Callable[[Request], Union[Request, None]]] = None,
timeout: Timeout = None,
timeout: Optional[Timeout] = None,
) -> "Client":
"""Open a STAC Catalog/API

Expand Down
6 changes: 3 additions & 3 deletions pystac_client/stac_api_io.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
logger = logging.getLogger(__name__)


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


class StacApiIO(DefaultStacIO):
Expand All @@ -49,7 +49,7 @@ def __init__(
conformance: Optional[List[str]] = None,
parameters: Optional[Dict[str, Any]] = None,
request_modifier: Optional[Callable[[Request], Union[Request, None]]] = None,
timeout: Timeout = None,
timeout: Optional[Timeout] = None,
max_retries: Optional[int] = 5,
):
"""Initialize class for API IO
Expand Down Expand Up @@ -104,7 +104,7 @@ def update(
headers: Optional[Dict[str, str]] = None,
parameters: Optional[Dict[str, Any]] = None,
request_modifier: Optional[Callable[[Request], Union[Request, None]]] = None,
timeout: Timeout = None,
timeout: Optional[Timeout] = None,
) -> None:
"""Updates this StacApi's headers, parameters, and/or request_modifer.

Expand Down