Skip to content

Fix identification of invalid objects with stac_version field #487

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

Conversation

duckontheweb
Copy link
Contributor

@duckontheweb duckontheweb commented Jun 29, 2021

Related Issue(s): #

Description:

Objects with stac_version == 1.0.0 but without a type field were being incorrectly identified by pystac.serialization.identify_stac_object_type as Catalogs. This fixes that method to return None in that case (indicating a dict that does not represent a valid STAC object).

Also adds the "type" field to Catalogs and Collections during migration.

PR Checklist:

  • Code is formatted (run pre-commit run --all-files)
  • Tests pass (run scripts/test)
  • Documentation has been updated to reflect changes, if applicable
  • This PR maintains or improves overall codebase code coverage.
  • Changes are added to the CHANGELOG. See the docs for information about adding to the changelog.

@duckontheweb
Copy link
Contributor Author

cc: @philvarner

@duckontheweb duckontheweb added the bug Things which are broken label Jun 29, 2021
@duckontheweb duckontheweb added this to the 1.0.0 milestone Jun 29, 2021
@codecov-commenter
Copy link

codecov-commenter commented Jun 29, 2021

Codecov Report

Merging #487 (0a81994) into main (f9573f8) will increase coverage by 0.00%.
The diff coverage is 95.23%.

Impacted file tree graph

@@           Coverage Diff           @@
##             main     #487   +/-   ##
=======================================
  Coverage   91.66%   91.66%           
=======================================
  Files          40       40           
  Lines        5245     5258   +13     
=======================================
+ Hits         4808     4820   +12     
- Misses        437      438    +1     
Impacted Files Coverage Δ
pystac/serialization/identify.py 92.95% <94.73%> (-0.02%) ⬇️
pystac/serialization/migrate.py 87.09% <100.00%> (-0.21%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update f9573f8...0a81994. Read the comment docs.

@duckontheweb duckontheweb requested a review from lossyrob June 29, 2021 03:24
@duckontheweb duckontheweb requested a review from lossyrob June 30, 2021 02:10
@duckontheweb duckontheweb merged commit 8b4737e into stac-utils:main Jul 1, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Things which are broken
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Exception if Catalog doesn't have a description field during catalog.get_children()
3 participants