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

Permit None value for datetime #116

Closed
wants to merge 4 commits into from
Closed

Conversation

alukach
Copy link

@alukach alukach commented Jul 21, 2022

As mentioned in #77, we should permit a None value for datetime property under certain circumstances.

By the time we are running our validators, we are validating against a Python dictionary (ie not a JSON string). For this reason, we should be permitting None values for properties.datetime when properties.start_datetime and properties.end_datetime are provided.

Going a bit further, I'm not sure that it's correct for us to permit properties.datetime to ever equal "null" (as is currently supported). The STAC Spec states that null is sometimes permitted, however "null" is never mentioned as being permitted.


closes #77

Before:

$ git checkout master
Switched to branch 'master'
Your branch is up to date with 'origin/master'.
$ stac-pydantic validate-item https://raw.githubusercontent.com/radiantearth/stac-spec/master/examples/collectionless-item.json

1 validation error for Item
properties -> datetime
  none is not an allowed value (type=type_error.none.not_allowed)

After:

$ git checkout patch-1
Switched to branch 'patch-1'
Your branch is up to date with 'origin/patch-1'.
$ stac-pydantic validate-item https://raw.githubusercontent.com/radiantearth/stac-spec/master/examples/collectionless-item.json

https://raw.githubusercontent.com/radiantearth/stac-spec/master/examples/collectionless-item.json is valid

As mentioned in stac-utils#77, we should permit a None value for datetime property under certain circumstances.
@alukach
Copy link
Author

alukach commented Jul 21, 2022

In 006b0cf, I've dropped support for "null" values. This feels like it may be a it contentious, happy to roll back if desired.

@alukach alukach force-pushed the patch-1 branch 2 times, most recently from 5d4fdd4 to 53d66d8 Compare July 21, 2022 19:47
@alukach alukach mentioned this pull request Jul 21, 2022
@alukach
Copy link
Author

alukach commented Aug 2, 2022

@geospatial-jeff A gentle nudge for this PR, any issues with merging this in?

stac_pydantic/item.py Outdated Show resolved Hide resolved
@ka7eh
Copy link

ka7eh commented Feb 2, 2023

Any estimate on when this will be merged?

@vincentsarago
Copy link
Member

vincentsarago commented May 21, 2024

will be taken care of in #149

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

error with null datetime
3 participants