Skip to content

Commit a4f44d5

Browse files
keshavmohta09OpenMetadata Release Bot
authored andcommitted
Fix: ValidationError handling for Pydantic v2 (#26014)
* fix: pydantic error - replace .model with .title * fix: code styling (cherry picked from commit 965381d)
1 parent 5f04d66 commit a4f44d5

1 file changed

Lines changed: 1 addition & 5 deletions

File tree

  • openmetadata-airflow-apis/openmetadata_managed_apis/workflows/ingestion

openmetadata-airflow-apis/openmetadata_managed_apis/workflows/ingestion/common.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -171,11 +171,7 @@ def build_source(ingestion_pipeline: IngestionPipeline) -> WorkflowSource:
171171
except (ValidationError, InvalidWorkflowException) as scoped_error:
172172
if isinstance(scoped_error, ValidationError):
173173
# Let's catch validations of internal Workflow models, not the Workflow itself
174-
object_error = (
175-
scoped_error.model.__name__
176-
if scoped_error.model is not None
177-
else "workflow"
178-
)
174+
object_error = getattr(scoped_error, "title", None) or "workflow"
179175
raise ParsingConfigurationError(
180176
f"We encountered an error parsing the configuration of your {object_error}.\n"
181177
f"{parse_validation_err(scoped_error)}"

0 commit comments

Comments
 (0)