Skip to content

Set the _stac_io on a collection client #709

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

Merged
merged 3 commits into from
Jul 1, 2024
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
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.

## [Unreleased]

### Fixed

- Actually set `timeout` when initializing `StacApiIO` [#709](https://github.com/stac-utils/pystac-client/pull/709)
- Set `_stac_io` on `CollectionClient` when reading [#709](https://github.com/stac-utils/pystac-client/pull/709)

## [v0.8.2] - 2024-05-30

### Added
Expand Down
6 changes: 4 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -99,11 +99,13 @@ ignore-path = "docs/_build,docs/tutorials"
max-line-length = 130

[tool.ruff]
ignore = ["E722", "E731"]
line-length = 88

[tool.ruff.lint]
ignore = ["E722", "E731"]
select = ["E", "F", "W", "I"]

[tool.ruff.per-file-ignores]
[tool.ruff.lint.per-file-ignores]
"__init__.py" = ["F401"]
"test_item_search.py" = ["E501"]

Expand Down
17 changes: 14 additions & 3 deletions pystac_client/stac_api_io.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,10 @@ def __init__(
self.session.mount("https://", HTTPAdapter(max_retries=max_retries))
self.timeout = timeout
self.update(
headers=headers, parameters=parameters, request_modifier=request_modifier
headers=headers,
parameters=parameters,
request_modifier=request_modifier,
timeout=timeout,
)

def update(
Expand Down Expand Up @@ -271,9 +274,17 @@ def stac_object_from_dict(
return result

if info.object_type == pystac.STACObjectType.COLLECTION:
return pystac_client.collection_client.CollectionClient.from_dict(
d, href=str(href), root=root, migrate=False, preserve_dict=preserve_dict
collection_client = (
pystac_client.collection_client.CollectionClient.from_dict(
d,
href=str(href),
root=root,
migrate=False,
preserve_dict=preserve_dict,
)
)
collection_client._stac_io = self
return collection_client

if info.object_type == pystac.STACObjectType.ITEM:
return pystac.Item.from_dict(
Expand Down
Loading
Loading