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

For discussion: explicitly hold timestamps at as Float() in db? #38

Draft
wants to merge 1 commit into
base: mongo-refactor
Choose a base branch
from

Conversation

jotelha
Copy link
Member

@jotelha jotelha commented Nov 20, 2022

Originally, sql_models.Dataset(db.Model) defines columns frozen_at and created_at as db.DateTime(), its method as_dict() converts those with dtoolcore.utils.timestamp(self.frozen_at). This, however, results in the autogenerated client API to expect a serialized datetime object and to throw an exception when receiving float. Treat created_at and frozen_at as floats in schema with
https://github.com/jotelha/dtool-lookup-server/blob/9d1b8cc751f1d1e143bae10d9454d86be438dc13/dtool_lookup_server/sql_models.py#L122-L128 as suggested below https://marshmallow.readthedocs.io/en/latest/quickstart.html#implicit-field-creation.

Not sure whether this issue would still persist, a lot has changed on the code since first encountered in #24.

@tjelvar-olsson
Copy link
Contributor

Not sure about this. I think it is a datetime in the SQL DB to potentially do clever filtering.

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