Skip to content

Silence pydantic protected namespace warnings #2955

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

Merged
merged 2 commits into from
Aug 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions src/zenml/models/v2/core/pipeline_run.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,8 @@ class PipelineRunRequest(WorkspaceScopedRequest):
default=None,
)

model_config = ConfigDict(protected_namespaces=())


# ------------------ Update Model ------------------

Expand All @@ -143,6 +145,8 @@ class PipelineRunUpdate(BaseModel):
default=None, title="Tags to remove from the pipeline run."
)

model_config = ConfigDict(protected_namespaces=())


# ------------------ Response Model ------------------

Expand Down Expand Up @@ -180,6 +184,8 @@ class PipelineRunResponseBody(WorkspaceScopedResponseBody):
default=None,
)

model_config = ConfigDict(protected_namespaces=())


class PipelineRunResponseMetadata(WorkspaceScopedResponseMetadata):
"""Response metadata for pipeline runs."""
Expand Down
4 changes: 4 additions & 0 deletions src/zenml/models/v2/core/step_run.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,8 @@ class StepRunRequest(WorkspaceScopedRequest):
default=None,
)

model_config = ConfigDict(protected_namespaces=())


# ------------------ Update Model ------------------

Expand Down Expand Up @@ -146,6 +148,7 @@ class StepRunUpdate(BaseModel):
"configured by this step run explicitly.",
default=None,
)
model_config = ConfigDict(protected_namespaces=())


# ------------------ Response Model ------------------
Expand All @@ -166,6 +169,7 @@ class StepRunResponseBody(WorkspaceScopedResponseBody):
"configured by this step run explicitly.",
default=None,
)
model_config = ConfigDict(protected_namespaces=())


class StepRunResponseMetadata(WorkspaceScopedResponseMetadata):
Expand Down
3 changes: 3 additions & 0 deletions src/zenml/zen_stores/schemas/pipeline_run_schemas.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
from typing import TYPE_CHECKING, Any, List, Optional
from uuid import UUID

from pydantic import ConfigDict
from sqlalchemy import UniqueConstraint
from sqlmodel import TEXT, Column, Field, Relationship

Expand Down Expand Up @@ -213,6 +214,8 @@ class PipelineRunSchema(NamedSchema, table=True):
),
)

model_config = ConfigDict(protected_namespaces=()) # type: ignore[assignment]

@classmethod
def from_request(
cls, request: "PipelineRunRequest"
Expand Down
3 changes: 3 additions & 0 deletions src/zenml/zen_stores/schemas/step_run_schemas.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
from typing import TYPE_CHECKING, Any, List, Optional
from uuid import UUID

from pydantic import ConfigDict
from sqlalchemy import TEXT, Column, String
from sqlalchemy.dialects.mysql import MEDIUMTEXT
from sqlmodel import Field, Relationship, SQLModel
Expand Down Expand Up @@ -161,6 +162,8 @@ class StepRunSchema(NamedSchema, table=True):
back_populates="step_runs",
)

model_config = ConfigDict(protected_namespaces=()) # type: ignore[assignment]

@classmethod
def from_request(cls, request: StepRunRequest) -> "StepRunSchema":
"""Create a step run schema from a step run request model.
Expand Down
Loading