Skip to content

fix: migrate deprecated Pydantic v1 class Config with ConfigDict for pydantic v2 compatabilty#496

Open
haroon0x wants to merge 2 commits into
kubeflow:mainfrom
haroon0x:fix/pydantic-v2-configdict
Open

fix: migrate deprecated Pydantic v1 class Config with ConfigDict for pydantic v2 compatabilty#496
haroon0x wants to merge 2 commits into
kubeflow:mainfrom
haroon0x:fix/pydantic-v2-configdict

Conversation

@haroon0x
Copy link
Copy Markdown

@haroon0x haroon0x commented May 18, 2026

fix: replace deprecated Pydantic v1 class Config with ConfigDict

Description

Replaces all instances of the deprecated Pydantic v1 class Config pattern with the Pydantic v2 equivalent model_config = ConfigDict(...).

This resolves the PydanticDeprecatedSince20 warnings that appear when using these models with Pydantic v2.

Changes

File Class Change
kubeflow/common/types.py KubernetesBackendConfig class Configmodel_config = ConfigDict(arbitrary_types_allowed=True)
kubeflow/trainer/backends/localprocess/types.py LocalBackendStep Same
kubeflow/trainer/backends/localprocess/types.py LocalBackendJobs Same

Verification

  • Ruff linting passes on all edited files
  • Python syntax verified via py_compile
  • Project requires pydantic >= 2.10.0 so ConfigDict is available

Copilot AI review requested due to automatic review settings May 18, 2026 18:04
@google-oss-prow
Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign kramaranya for approval. For more information see the Kubernetes Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@github-actions
Copy link
Copy Markdown
Contributor

🎉 Welcome to the Kubeflow SDK! 🎉

Thanks for opening your first PR! We're happy to have you as part of our community 🚀

Here's what happens next:

  • If you haven't already, please check out our Contributing Guide for repo-specific guidelines and the Kubeflow Contributor Guide for general community standards
  • Our team will review your PR soon! cc @kubeflow/kubeflow-sdk-team

Join the community:

Feel free to ask questions in the comments if you need any help or clarification!
Thanks again for contributing to Kubeflow! 🙏

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Replaces deprecated Pydantic v1 class Config pattern with v2 model_config = ConfigDict(...) to eliminate PydanticDeprecatedSince20 warnings.

Changes:

  • Updated LocalBackendStep and LocalBackendJobs to use ConfigDict.
  • Updated KubernetesBackendConfig to use ConfigDict.
  • Added ConfigDict imports.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
kubeflow/trainer/backends/localprocess/types.py Migrates two model configs to ConfigDict.
kubeflow/common/types.py Migrates one model config to ConfigDict.

Replace all instances of Pydantic v1 class Config pattern with the Pydantic v2 equivalent using model_config = ConfigDict() to resolve PydanticDeprecatedSince20 warnings.

Signed-off-by: haroon0x <haroonbmc0@gmail.com>
@haroon0x haroon0x force-pushed the fix/pydantic-v2-configdict branch from ad0da42 to ce54ca6 Compare May 18, 2026 18:07
@haroon0x haroon0x changed the title fix: replace deprecated Pydantic v1 class Config with ConfigDict fix: migrate deprecated Pydantic v1 class Config with ConfigDict for pydantic v2 compatabilty May 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants