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

Fix example to work with Pydantic V2, add test for examples #99

Merged
merged 4 commits into from
Feb 1, 2024

Conversation

dantheman39
Copy link
Contributor

@dantheman39 dantheman39 commented Feb 1, 2024

Summary

  • Fix examples/departments.py to comply with changes in how Pydantic handles Optional and null fields.
  • Add test for this example so we automatically catch regressions in the future.
  • Add vim .swp and .swo files to the gitignore.

Details

One thing we missed in the review of the PR to add support for pydantic v2: #94, is that the example no longer works and errors out.

This is due to a breaking change in the behavior of Pydantic V2 in regards to optional fields. See this section of the v1 to v2 migration guide, and this long github issue for more discussion on their treatment of optional / nullable fields: pydantic/pydantic#1223

@@ -1,6 +1,6 @@
[tool.poetry]
name = "graphene_pydantic"
version = "0.6.0"
version = "0.6.1"
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@necaris any opinions on the version bump being in the same or separate PR? Happy to comply.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Same PR seems fine to me.

@dantheman39 dantheman39 merged commit 9712453 into main Feb 1, 2024
26 checks passed
@dantheman39 dantheman39 deleted the fix-example branch February 1, 2024 18:33
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