Skip to content

Conversation

darinkishore
Copy link

Summary

  • bump the runtime requirement to Pydantic v2
  • migrate schemas, validators, and helpers off v1-only APIs
  • update client utilities and tests so evaluation results still serialize cleanly

Testing

  • make format
  • make lint
  • make tests

Notes

  • Warnings about pydantic v2 old .dict() / .json() helpers are there; they don't impact functionality .

Fixes #2029 .

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

Codex Review: Here are some suggestions.

About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you open a pull request for review, mark a draft as ready, or comment "@codex review". If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex fix this CI failure" or "@codex address that feedback".

Comment on lines +221 to 224
@model_validator(mode="before")
def infer_defaults(cls, values: dict[str, Any]) -> dict[str, Any]:
"""Assign name to the run."""
if values.get("name") is None and values.get("serialized") is not None:

Choose a reason for hiding this comment

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

[P1] Decorate RunTree pre-validator as classmethod

The new infer_defaults validator is registered with @model_validator(mode="before") but isn’t a classmethod. Pydantic v2 invokes mode="before" validators on the class, so defining it as an instance method causes a TypeError when constructing a RunTree (infer_defaults() is missing the positional values argument) and prevents any run tree from being created. Add @classmethod (and keep cls as the first parameter) so the validator runs correctly.

Useful? React with 👍 / 👎.

Copy link
Author

Choose a reason for hiding this comment

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

nvm the ai is wrong here this is untrue

@darinkishore
Copy link
Author

@codex fix comments

Copy link

To use Codex here, create an environment for this repo.

@darinkishore
Copy link
Author

requesting reviewers please. also currently running this PR in prod, no issues yet.

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.

pydantic v2 compatibility

2 participants