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


##########
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:
   A column rename is cheap, but I’m more worried if tweaking the semantic 
would break some existing expectations that this should point to an actual file 
(instead of an abstract reference that might only make sense to importers).
   
   I actually feel if we do want to rename, we don’t even need the model-level 
synonym. However, we will need to expose `filename` in the API for 
compatibility. So perhaps a better approach would be to _add_ a new column 
instead, and keep `filename` as-is on database, model, and API for backward 
compatibility.



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