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 Pydantic 2 warnings #3622

Merged
merged 1 commit into from
Apr 23, 2024
Merged

Conversation

cmaddalozzo
Copy link
Contributor

@cmaddalozzo cmaddalozzo commented Apr 22, 2024

What this PR does / why we need it:
Currently Pydantic 2 is emitting two errors.

Field "model_name" has conflict with protected namespace "model_".

Type of changes
Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

Currently these warnings are being emitted by Pydantic.

kserve/venv/lib/python3.11/site-packages/pydantic/_internal/_config.py:322
  /Users/cmaddalozzo/Code/kserve/python/kserve/venv/lib/python3.11/site-packages/pydantic/_internal/_config.py:322: UserWarning: Valid config keys have changed in V2:
  * 'json_loads' has been removed
    warnings.warn(message, UserWarning)

kserve/venv/lib/python3.11/site-packages/pydantic/_internal/_fields.py:151
  /Users/cmaddalozzo/Code/kserve/python/kserve/venv/lib/python3.11/site-packages/pydantic/_internal/_fields.py:151: UserWarning: Field "model_name" has conflict with protected namespace "model_".

  You may be able to resolve this warning by setting `model_config['protected_namespaces'] = ()`.
    warnings.warn(

kserve/venv/lib/python3.11/site-packages/pydantic/_internal/_fields.py:151
  /Users/cmaddalozzo/Code/kserve/python/kserve/venv/lib/python3.11/site-packages/pydantic/_internal/_fields.py:151: UserWarning: Field "model_version" has conflict with protected namespace "model_".

  You may be able to resolve this warning by setting `model_config['protected_namespaces'] = ()`.
    warnings.warn(

Special notes for your reviewer:

  1. Please confirm that if this PR changes any image versions, then that's the sole change this PR makes.

Checklist:

  • Have you added unit/e2e tests that prove your fix is effective or that this feature works?
  • Has code been commented, particularly in hard-to-understand areas?
  • Have you made corresponding changes to the documentation?

Release note:


Signed-off-by: Curtis Maddalozzo <cmaddalozzo@bloomberg.net>
@cmaddalozzo cmaddalozzo changed the title Ignore protected namespaces. Don't set json_loads Fix Pydantic 2 warnings Apr 22, 2024
@yuzisun
Copy link
Member

yuzisun commented Apr 23, 2024

/lgtm
/approve

Copy link

oss-prow-bot bot commented Apr 23, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: cmaddalozzo, yuzisun

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

The pull request process is described here

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

@yuzisun yuzisun merged commit ec59f43 into kserve:master Apr 23, 2024
56 of 57 checks passed
cmaddalozzo added a commit to cmaddalozzo/kserve that referenced this pull request Apr 26, 2024
* master:
  Add OpenAI API support to Huggingfaceserver (kserve#3582)
  Allow rerunning failed workflows by comment (kserve#3550)
  Fix CVE-2023-45288 for qpext (kserve#3618)
  chore: v0.12.1 install files (kserve#3619)
  build: Fix CRD copying in generate-install.sh (kserve#3620)
  Fix Pydantic 2 warnings (kserve#3622)
  Fix make deploy-dev-storage-initializer not working (kserve#3617)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants