Skip to content

Commit 715be7f

Browse files
authored
Silence pydantic protected namespace warnings (#2955)
* Silence pydantic protected namespace warnings * Add type ignores
1 parent 83b414f commit 715be7f

File tree

4 files changed

+16
-0
lines changed

4 files changed

+16
-0
lines changed

src/zenml/models/v2/core/pipeline_run.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,8 @@ class PipelineRunRequest(WorkspaceScopedRequest):
121121
default=None,
122122
)
123123

124+
model_config = ConfigDict(protected_namespaces=())
125+
124126

125127
# ------------------ Update Model ------------------
126128

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

148+
model_config = ConfigDict(protected_namespaces=())
149+
146150

147151
# ------------------ Response Model ------------------
148152

@@ -180,6 +184,8 @@ class PipelineRunResponseBody(WorkspaceScopedResponseBody):
180184
default=None,
181185
)
182186

187+
model_config = ConfigDict(protected_namespaces=())
188+
183189

184190
class PipelineRunResponseMetadata(WorkspaceScopedResponseMetadata):
185191
"""Response metadata for pipeline runs."""

src/zenml/models/v2/core/step_run.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,8 @@ class StepRunRequest(WorkspaceScopedRequest):
114114
default=None,
115115
)
116116

117+
model_config = ConfigDict(protected_namespaces=())
118+
117119

118120
# ------------------ Update Model ------------------
119121

@@ -146,6 +148,7 @@ class StepRunUpdate(BaseModel):
146148
"configured by this step run explicitly.",
147149
default=None,
148150
)
151+
model_config = ConfigDict(protected_namespaces=())
149152

150153

151154
# ------------------ Response Model ------------------
@@ -166,6 +169,7 @@ class StepRunResponseBody(WorkspaceScopedResponseBody):
166169
"configured by this step run explicitly.",
167170
default=None,
168171
)
172+
model_config = ConfigDict(protected_namespaces=())
169173

170174

171175
class StepRunResponseMetadata(WorkspaceScopedResponseMetadata):

src/zenml/zen_stores/schemas/pipeline_run_schemas.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
from typing import TYPE_CHECKING, Any, List, Optional
1919
from uuid import UUID
2020

21+
from pydantic import ConfigDict
2122
from sqlalchemy import UniqueConstraint
2223
from sqlmodel import TEXT, Column, Field, Relationship
2324

@@ -213,6 +214,8 @@ class PipelineRunSchema(NamedSchema, table=True):
213214
),
214215
)
215216

217+
model_config = ConfigDict(protected_namespaces=()) # type: ignore[assignment]
218+
216219
@classmethod
217220
def from_request(
218221
cls, request: "PipelineRunRequest"

src/zenml/zen_stores/schemas/step_run_schemas.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
from typing import TYPE_CHECKING, Any, List, Optional
1919
from uuid import UUID
2020

21+
from pydantic import ConfigDict
2122
from sqlalchemy import TEXT, Column, String
2223
from sqlalchemy.dialects.mysql import MEDIUMTEXT
2324
from sqlmodel import Field, Relationship, SQLModel
@@ -161,6 +162,8 @@ class StepRunSchema(NamedSchema, table=True):
161162
back_populates="step_runs",
162163
)
163164

165+
model_config = ConfigDict(protected_namespaces=()) # type: ignore[assignment]
166+
164167
@classmethod
165168
def from_request(cls, request: StepRunRequest) -> "StepRunSchema":
166169
"""Create a step run schema from a step run request model.

0 commit comments

Comments
 (0)