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

Expand dendrite json and Pyandtic v2 Upgrade #1633

Merged
merged 8 commits into from
Jan 8, 2024

Conversation

ifrit98
Copy link
Contributor

@ifrit98 ifrit98 commented Dec 20, 2023

This updates several things:

  • synapse.dict() -> json.loads(synapse.json())
  • pydantic to 2.5.2 (latest version) with a massive overhaul
  • fastapi to 0.105.0 (latest version)
  • updates related synapse code to leverage these upgrades

This effectively increases the types that can be serialized over the bittensor network natively, e.g. datetime

One major bug that this fixes is the limited scope for what kind of objects can be serialized and sent over the wire. For example, datetime objects currently are not serializable because of calling synapse.dict(). The synapse.json() method calls an internal pydantic serialization routine which natively supports datetime objects.

@ifrit98 ifrit98 requested a review from Eugene-hu December 21, 2023 00:29
@ifrit98 ifrit98 self-assigned this Dec 21, 2023
Copy link
Contributor

@Eugene-hu Eugene-hu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, mind expanding a bit about the differences between .dict() vs json.loads? What bug does this fix?

@ifrit98
Copy link
Contributor Author

ifrit98 commented Jan 2, 2024

Looks good, mind expanding a bit about the differences between .dict() vs json.loads? What bug does this fix?

Yes, will expand in the main comment.

@ifrit98 ifrit98 merged commit c3e8e2a into staging Jan 8, 2024
@ifrit98 ifrit98 mentioned this pull request Jan 8, 2024
@ifrit98 ifrit98 changed the title Bugfix/expand dendrite json Expand dendrite json and Pyandtic v2 Upgrade Jan 9, 2024
@unconst unconst deleted the bugfix/expand-dendrite-json branch March 27, 2024 20:03
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