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

HDX-10120 Type annotation changes #203

Merged
merged 5 commits into from
Sep 2, 2024

Conversation

IanHopkinson
Copy link
Collaborator

@IanHopkinson IanHopkinson commented Sep 2, 2024

This PR includes changes to adapt the HDX HAPI app to cope with new datetime type annotations. Mainly this is replacing sqlalchemy.NaiveDateTime with datetime.datetime, and also sqlalchemy.DateTime. Using NaiveDateTime for response annotation rejects datetimes with time zone information and the new type annotation add time zones by default.

Some endpoints used NaiveDatetime in their query parameter definitions, these were replaced and commented code was removed too. It is also found in the util.py file for definition of the ReferencePeriodParameters class

The majority of changes were in the response models where NaiveDateTime was used widely but not universally. Replacing these with datetime.datetime does not change OpenAPI documentation.

@alexandru-m-g alexandru-m-g merged commit aa1858e into dev Sep 2, 2024
2 checks passed
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.

2 participants