kaxil commented on code in PR #69038:
URL: https://github.com/apache/airflow/pull/69038#discussion_r3484746509


##########
airflow-core/src/airflow/models/trigger.py:
##########
@@ -92,6 +92,7 @@ class Trigger(Base):
     """
 
     __tablename__ = "trigger"
+    __table_args__ = (Index("dt_flow_idx_trigger_triggerer_queue_id", 
"triggerer_id", "queue", "id"),)

Review Comment:
   The index name carries a `dt_flow_` prefix: 
`dt_flow_idx_trigger_triggerer_queue_id`. That prefix appears nowhere else in 
the Airflow codebase, so it looks like a leftover from an internal/local 
tooling convention rather than an intended name. The PR description itself 
proposes the unprefixed `idx_trigger_triggerer_queue_id`, so the code and the 
description disagree on the name.
   
   This also will not be caught by the ORM-vs-migration drift test, because the 
model (`__table_args__` here) and the migration both hard-code the same 
`dt_flow_`-prefixed name, so they agree with each other even though both carry 
the prefix.
   
   Suggest renaming to `idx_trigger_triggerer_queue_id` in both this line and 
the migration `0124_3_3_0_add_new_index_for_trigger.py` (the `create_index` and 
`drop_index` calls).



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