Update pydantic import to fix b/343572011 in g3
The commit is a mirror of cl/638491582 by ayzhou@
As indicated in b/343572011, the issue affect all Python SDK FC usage in g3 including the official function calling colab.
The issue is very similar to b/325114802, b/331534434, which are then fixed with cl/619453719.
Description of the change
Update pydantic import to fix b/343572011. It is a mirror of cl/638491582 by ayzhou@
Motivation
b/343572011
Type of change
Bug fix
Checklist
- [ X] I have performed a self-review of my code.
- [ X] I have added detailed comments to my code where applicable.
- [ X] I have verified that my change does not break existing code.
- [ X] My PR is based on the latest changes of the main branch (if unsure, please run
git pull --rebase upstream main). - [X ] I am familiar with the Google Style Guide for the language I have coded in.
- [ X] I have read through the Contributing Guide and signed the Contributor License Agreement.
Thanks, I'll take a look.
Interesting.
- it looks like v1 isn't just a google thing. It's in the OSS installation too:
import pydantic
pydantic.version.VERSION
# 2.7.3
pydantic.v1.version.VERSION
# 1.10.15
So even if you have v2 you get v2 (that's why the tests here are failing)
I think we need a way to get the basics all running in v1 and ... the output is different?
Added a test workflow to test with pydantic-1.
If we want this to successfully close that bug, we need to get those tests working, or expolicitly choose some acceptable subset of them and tag the others with a skipif .
- It looks like pydantic1 handles the nested TypedDicts differently from pydantic2
- It looks like nullable is handled differently
b/342443131
Sorry about the delay. Fixing this internally.
cl/691199002
Fixing internally.
cl/691199002