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

AssertionError in stac_object_from_dict when calling item.get_collection() in 0.7.1 #548

Closed
TomAugspurger opened this issue Jun 23, 2023 · 0 comments · Fixed by #549
Closed
Assignees
Labels
bug Something isn't working
Milestone

Comments

@TomAugspurger
Copy link
Collaborator

This program fails in pystac 0.7.1

import pystac_client
print(pystac_client.__version__)

catalog = pystac_client.Client.open(
        "https://planetarycomputer.microsoft.com/api/stac/v1/",
)

item = catalog.get_collection("cil-gdpcir-cc-by").get_item(
        "cil-gdpcir-NUIST-NESM3-ssp585-r1i1p1f1-day"
)
item.get_collection()

with

Traceback (most recent call last):
  File "/tmp/a/bug.py", line 11, in <module>
    item.get_collection()
  File "/tmp/a/a/lib/python3.10/site-packages/pystac/item.py", line 356, in get_collection
    return cast(Collection, collection_link.resolve_stac_object().target)
  File "/tmp/a/a/lib/python3.10/site-packages/pystac/link.py", line 322, in resolve_stac_object
    obj = stac_io.read_stac_object(target_href, root=root)
  File "/tmp/a/a/lib/python3.10/site-packages/pystac/stac_io.py", line 232, in read_stac_object
    return self.stac_object_from_dict(
  File "/tmp/a/a/lib/python3.10/site-packages/pystac_client/stac_api_io.py", line 270, in stac_object_from_dict
    assert isinstance(root, pystac_client.client.Client)
AssertionError

It runs successfully with pystac-client 0.6.1

@gadomski gadomski self-assigned this Jun 23, 2023
@gadomski gadomski added the bug Something isn't working label Jun 23, 2023
@gadomski gadomski added this to the 0.7.2 milestone Jun 23, 2023
TomAugspurger pushed a commit to microsoft/PlanetaryComputerExamples that referenced this issue Jun 23, 2023
TomAugspurger pushed a commit to microsoft/PlanetaryComputerExamples that referenced this issue Jun 23, 2023
gadomski added a commit to stac-utils/pystac that referenced this issue Jun 23, 2023
gadomski added a commit to stac-utils/pystac that referenced this issue Jun 23, 2023
github-merge-queue bot pushed a commit to stac-utils/pystac that referenced this issue Jun 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants