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

Check if datetime is a str instance before parsing #74

Closed
wants to merge 1 commit into from

Conversation

mzaglia
Copy link

@mzaglia mzaglia commented Apr 16, 2021

Parse to rfc3339 only if the dates are strings.

@mzaglia
Copy link
Author

mzaglia commented May 3, 2021

can anyone take a look into this?

@kylebarron
Copy link
Contributor

Not sure if this is superseded by #75. @geospatial-jeff might have a better idea

@geospatial-jeff
Copy link
Collaborator

geospatial-jeff commented May 20, 2021

Thanks @kylebarron you are correct, as of #75 the field is simply typed as datetime instead of a union. When passed a string, pydantic will validate the date string against ISO format and convert to a datetime object.

I think this PR can be closed.

@geospatial-jeff
Copy link
Collaborator

Apologies I'm trying to figure out GitHub mobile and it's not going so well haha.

I just realized that the ItemProperties.datetime member is still typed with a Union, once that is fixed I think we will have the behavior described in this PR.

@moradology
Copy link
Collaborator

Closing as superseded by #75

@moradology moradology closed this Nov 23, 2021
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.

4 participants