-
Notifications
You must be signed in to change notification settings - Fork 5
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
Change: Message.time was float, becomes datetime #40
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me, but:
Shouldn't the pydantic model also explicitly include Float
for clarity?
This would send datetimes as strings, which is likely not compatible with the MongoDB API - we should wait for the PostgreSQL based version of PyAleph to release this. |
Moved as draft, all nodes should be upgraded to use Postgres beforehand. |
Nodes are using Postgres now, should we continue pursing this PR? |
Add a @validator to convert float to datetime |
@hoh it's ready |
a5a42f9
to
40befe9
Compare
Change the type if BaseMessage.time to a datetime. This allows easier manipulation of the field, and parsing from strings as well as floats. New APIs introduced in PyAleph 0.5.0 store the message time as timestampz and return it as ISO strings. This changes is compatible with both the old and new APIs.
40befe9
to
fba6fc0
Compare
Co-authored-by: Hugo Herter <[email protected]>
Change the type if BaseMessage.time to a datetime. This allows easier manipulation of the field, and parsing from strings as well as floats.
New APIs introduced in PyAleph 0.5.0 store the message time as timestampz and return it as ISO strings. This changes is compatible with both the old and new APIs.