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

Pydantic recommends not to use model_ prefix for model fields #1834

Closed
rapsealk opened this issue Jan 11, 2024 · 0 comments · Fixed by #2765
Closed

Pydantic recommends not to use model_ prefix for model fields #1834

rapsealk opened this issue Jan 11, 2024 · 0 comments · Fixed by #2765
Assignees
Labels
comp:manager Related to Manager component type:maintenance Maintenance issue.
Milestone

Comments

@rapsealk
Copy link
Member

What Operating System(s) are you seeing this problem on?

Linux (x86-64)

Backend.AI version

b835aff

Describe the bug

During the manager bootstrapping process, the following warning logs were identified:

/Users/rapsealk/Desktop/git/backend.ai-dev2/dist/export/python/virtualenvs/python-default/3.11.6/lib/python3.11/site-packages/pydantic/_internal/_fields.py:128: UserWarning: Field "model_version" conflicts with the protected namespace "model_".

You may resolve this warning by setting `model_config['protected_namespaces'] = ()`.
warnings.warn(
/Users/rapsealk/Desktop/git/backend.ai-dev2/dist/export/python/virtualenvs/python-default/3.11.6/lib/python3.11/site-packages/pydantic/_internal/_fields.py:128: UserWarning: Field "model_mount_destination" conflicts with the protected namespace "model_".

You may resolve this warning by setting `model_config['protected_namespaces'] = ()`.

model_version: int = Field(
validation_alias=AliasChoices("model_version", "modelVersion"),
description="Unused; Reserved for future works",
default=1,
)
model_mount_destination: str = Field(
validation_alias=AliasChoices("model_mount_destination", "modelMountDestination"),
default="/models",
description=(
"Mount destination for the model VFolder will be mounted inside the inference session"
),
)

As per Pydantic documentation, the protected_namespaces: tuple[str, ...] configuration is designed to prevent namespace collision or overwriting preexisting attributes. While this warning may not impact the running process itself yet, it is advisable to take action to suppress such warnings.

Please refer to Configuration - Pydantic for more comprehensive details.

To Reproduce

Execute the following command:

$ backend.ai mgr start-server --debug

Expected Behavior

No warnings.

Anything else?

No response

@rapsealk rapsealk added type:bug Reports about that are not working comp:manager Related to Manager component labels Jan 11, 2024
@rapsealk rapsealk added this to the 23.09 milestone Jan 11, 2024
@achimnol achimnol added type:maintenance Maintenance issue. and removed type:bug Reports about that are not working labels Aug 24, 2024
@achimnol achimnol self-assigned this Aug 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
comp:manager Related to Manager component type:maintenance Maintenance issue.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants