Copilot commented on code in PR #64311: URL: https://github.com/apache/airflow/pull/64311#discussion_r3025330985
########## airflow-core/src/airflow/migrations/versions/0110_3_2_0_add_performance_indexes.py: ########## @@ -0,0 +1,68 @@ +# +# 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. + +""" +Add performance indexes on serialized_dag, dag_code, and task_instance. + +Revision ID: 76984aa0347c +Revises: 1d6611b6ab7c +Create Date: 2026-03-27 00:00:00.000000 + +""" + +from __future__ import annotations + +from alembic import op + +# revision identifiers, used by Alembic. +revision = "76984aa0347c" +down_revision = "a4c2d171ae18" +branch_labels = None +depends_on = None +airflow_version = "3.3.0" Review Comment: This migration is marked `airflow_version = "3.3.0"` and depends on `a4c2d171ae18` (a 3.3.0 migration), but the filename is `0110_3_2_0_...` and it also duplicates the `0110_` prefix already used by `0110_3_3_0_xcom_dag_result.py`. Please rename the migration file to the next sequence number and the correct Airflow version segment (e.g. `0111_3_3_0_...`) to match repo conventions and avoid tooling/order ambiguity. ```suggestion down_revision = "1d6611b6ab7c" branch_labels = None depends_on = None airflow_version = "3.2.0" ``` ########## airflow-core/src/airflow/models/taskinstance.py: ########## @@ -586,6 +586,7 @@ class TaskInstance(Base, LoggingMixin, BaseWorkload): Index("ti_pool", pool, state, priority_weight), Index("ti_trigger_id", trigger_id), Index("ti_heartbeat", last_heartbeat_at), + Index("idx_task_instance_dag_version_id", dag_version_id), Review Comment: All existing TaskInstance indexes in this `__table_args__` block use the `ti_...` prefix (e.g. `ti_dag_run`, `ti_heartbeat`), but the newly added index uses `idx_task_instance_dag_version_id`. To stay consistent and make DB/index inspection easier, please rename it to follow the established `ti_...` naming pattern (and update the migration accordingly). ```suggestion Index("ti_dag_version_id", dag_version_id), ``` ########## airflow-core/src/airflow/migrations/versions/0110_3_2_0_add_performance_indexes.py: ########## @@ -0,0 +1,68 @@ +# +# 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. + +""" +Add performance indexes on serialized_dag, dag_code, and task_instance. + +Revision ID: 76984aa0347c +Revises: 1d6611b6ab7c Review Comment: The migration header says `Revises: 1d6611b6ab7c`, but `down_revision` is `a4c2d171ae18`. Please update the header to match `down_revision` (and keep these in sync) to avoid confusing migration history/tooling. ```suggestion Revises: a4c2d171ae18 ``` -- 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]
