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

Update pydantic import to fix b/343572011 in g3 #369

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

YuncongZhou
Copy link

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.

The commit is a mirror of cl/638491582 by ayzhou@

As indicated in b/343572011, the issue affect all Python SDK 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.
@github-actions github-actions bot added status:awaiting review PR awaiting review from a maintainer component:python sdk Issue/PR related to Python SDK labels May 31, 2024
@MarkDaoust
Copy link
Collaborator

Thanks, I'll take a look.

@MarkDaoust
Copy link
Collaborator

Interesting.

  1. 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?

Change-Id: I48f985e409e664ef90a83257f798a5fb6a5ac9c7
Change-Id: I3473afc0e61bb73c3af527927c1a45c475e89219
@MarkDaoust
Copy link
Collaborator

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
.

@MarkDaoust
Copy link
Collaborator

  1. It looks like pydantic1 handles the nested TypedDicts differently from pydantic2
  2. It looks like nullable is handled differently

@MarkDaoust
Copy link
Collaborator

b/342443131

@MarkDaoust
Copy link
Collaborator

Sorry about the delay. Fixing this internally.

cl/691199002

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component:python sdk Issue/PR related to Python SDK status:awaiting review PR awaiting review from a maintainer
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants