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

chore(schemas): update to pydantic v2 #11304

Merged
merged 5 commits into from
Sep 9, 2024

Conversation

mikewilli
Copy link
Contributor

Because

  • the schemas package is used by a lot of data tooling
  • the data tooling is starting to complain about schemas requiring pydantic v1 due to other dependencies
  • the pydantic-to-typescript package is outdated and does not support pydantic v2

This commit

  • updates the schemas package to v2
  • changes the typescript generation to a script internal to experimenter

Fixes #11214

@mikewilli mikewilli marked this pull request as ready for review September 6, 2024 21:51
@@ -0,0 +1,134 @@
"""
Copy link
Collaborator

Choose a reason for hiding this comment

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

Eeeeehhhhhh I wish we didn't have to do this. There's not something else that works off the shelf?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

So yea, I agree. I think there may be some options, but nothing that jumped out at me when doing some initial searching. I also know Beth was interested in pursuing something like Zod and I don't really have the time to evaluate things like that at the moment. This is becoming more of an issue for data so I saw this as a bit of a stopgap, but taking inspiration from tooling we already use.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Okey doke fair enough. Let's do it for now to unblock things and maybe we can find a better solution in the future. Thanks for taking this on @mikewilli 🙏

Comment on lines 3 to 8

# from mozilla_nimbus_schemas import experiments, jetstream

# __all__ = [f"experiments.{m}" for m in experiments.__all__] + [
# f"jetstream.{m}" for m in jetstream.__all__
# ]
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
# from mozilla_nimbus_schemas import experiments, jetstream
# __all__ = [f"experiments.{m}" for m in experiments.__all__] + [
# f"jetstream.{m}" for m in jetstream.__all__
# ]

Can this be removed?

Copy link
Collaborator

@jaredlockhart jaredlockhart left a comment

Choose a reason for hiding this comment

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

Awesome ty @mikewilli 🙏

@@ -0,0 +1,134 @@
"""
Copy link
Collaborator

Choose a reason for hiding this comment

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

Okey doke fair enough. Let's do it for now to unblock things and maybe we can find a better solution in the future. Thanks for taking this on @mikewilli 🙏

@mikewilli mikewilli added this pull request to the merge queue Sep 9, 2024
Merged via the queue into mozilla:main with commit a65feef Sep 9, 2024
16 checks passed
@mikewilli mikewilli deleted the 11214-pydantic-v2 branch September 9, 2024 18:41
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.

Update schemas pydantic to v2
3 participants