dilnazanlid commented on code in PR #72474:
URL: https://github.com/apache/airflow/pull/72474#discussion_r4116816578
##########
airflow-core/src/airflow/api_fastapi/core_api/datamodels/import_error.py:
##########
@@ -31,6 +31,7 @@ class ImportErrorResponse(BaseModel):
id: int = Field(alias="import_error_id")
timestamp: datetime
filename: str
+ source_reference: str | None = None
Review Comment:
Done. `source_reference` is now `str | None` with no default.
##########
airflow-core/src/airflow/models/dagwarning.py:
##########
@@ -105,3 +108,25 @@ class DagWarningType(str, Enum):
DUPLICATE_DAG_ID = "duplicate dag id"
NONEXISTENT_POOL = "non-existent pool"
RUNTIME_VARYING_VALUE = "runtime varying value"
+
+
+ImporterWarningType = Annotated[
+ str,
+ StringConstraints(pattern=r"^[a-z][a-z0-9_]*:[a-z0-9_.\-]+$",
max_length=WARNING_TYPE_MAX_LENGTH),
+]
+"""Warning type reported by a Dag importer, prefixed with its namespace (e.g.
``yaml:deprecated_field``)."""
+
+DagWarningTypeValue = DagWarningType | ImporterWarningType
+"""Any valid ``warning_type``: a built-in :class:`DagWarningType` or an
:data:`ImporterWarningType`."""
+
+_warning_type_adapter: TypeAdapter[DagWarningType | str] =
TypeAdapter(DagWarningTypeValue)
Review Comment:
Done. It's now `TypeAdapter[DagWarningTypeValue]`.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]