jason810496 commented on code in PR #72474:
URL: https://github.com/apache/airflow/pull/72474#discussion_r4024371869


##########
airflow-core/src/airflow/api_fastapi/core_api/datamodels/dag_warning.py:
##########
@@ -23,14 +23,13 @@
 from pydantic import AliasPath, Field
 
 from airflow.api_fastapi.core_api.base import BaseModel
-from airflow.models.dagwarning import DagWarningType
 
 
 class DAGWarningResponse(BaseModel):
     """Dag Warning serializer for responses."""
 
     dag_id: str
-    warning_type: DagWarningType
+    warning_type: str

Review Comment:
   How about `DagWarningType | str` instead of dropping the `DagWarningType` 
enum at all?



##########
airflow-core/src/airflow/migrations/versions/0135_3_4_0_rename_filename_to_source_reference_in_import_error.py:
##########
@@ -0,0 +1,50 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+"""
+Rename filename to source_reference in import_error.
+
+Revision ID: ca8499dc1004
+Revises: b6a9c2e7d410
+Create Date: 2026-08-27 12:45:02.276898
+
+"""
+
+from __future__ import annotations
+
+import sqlalchemy as sa
+from alembic import op
+
+# revision identifiers, used by Alembic.
+revision = "ca8499dc1004"
+down_revision = "b6a9c2e7d410"
+branch_labels = None
+depends_on = None
+airflow_version = "3.4.0"
+
+
+def upgrade():
+    """Apply rename filename to source_reference in import_error."""
+    with op.batch_alter_table("import_error", schema=None) as batch_op:
+        batch_op.alter_column("filename", new_column_name="source_reference", 
type_=sa.String(length=1024))

Review Comment:
   I'm not sure if it worthwhile or make sense to rename the column.



##########
airflow-core/src/airflow/migrations/versions/0135_3_4_0_rename_filename_to_source_reference_in_import_error.py:
##########
@@ -0,0 +1,50 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+"""
+Rename filename to source_reference in import_error.
+
+Revision ID: ca8499dc1004
+Revises: b6a9c2e7d410
+Create Date: 2026-08-27 12:45:02.276898
+
+"""
+
+from __future__ import annotations
+
+import sqlalchemy as sa
+from alembic import op
+
+# revision identifiers, used by Alembic.
+revision = "ca8499dc1004"
+down_revision = "b6a9c2e7d410"
+branch_labels = None
+depends_on = None
+airflow_version = "3.4.0"
+
+
+def upgrade():
+    """Apply rename filename to source_reference in import_error."""
+    with op.batch_alter_table("import_error", schema=None) as batch_op:
+        batch_op.alter_column("filename", new_column_name="source_reference", 
type_=sa.String(length=1024))
+
+

Review Comment:
   If I understand the purpose of this PR correctly, should we introduce the 
new `language` on the `DagCode` model rather than renaming the existing 
`filename` column?
   
   So that `DagImporter` can provide the "language" field to persist and show 
them properly on the UI (syntax highlighting based on the persisted "language" 
field).



-- 
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]

Reply via email to