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

Clarify error using add_if_missing on ownerless asset #746

Merged
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: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@

- Self links no longer included in Items for "relative published" catalogs ([#725](https://github.com/stac-utils/pystac/pull/725))
- Adding New and Custom Extensions tutorial now up-to-date with new extensions API ([#724](https://github.com/stac-utils/pystac/pull/724))
- Clarify error message when using `PropertyExtension.ext(..., add_if_missing=True)` on an `Asset`
with no owner([#746](https://github.com/stac-utils/pystac/pull/746))
- Type errors when initializing `TemporalExtent` using a list of `datetime` objects ([#744](https://github.com/stac-utils/pystac/pull/744))

### Deprecated
Expand Down
3 changes: 2 additions & 1 deletion pystac/extensions/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,8 @@ def validate_owner_has_extension(
if asset.owner is None:
if add_if_missing:
raise pystac.STACError(
"Can only add schema URIs to Assets with an owner."
"Attempted to use add_if_missing=True for an Asset with no owner. "
"Use Asset.set_owner or set add_if_missing=False."
)
else:
return
Expand Down