code: def reorder_columns(columns):
      """Reorder the columns for creating constraint.
      Preserve primary key ordering
      ``['task_id', 'dag_id', 'execution_date']``
  
      :param columns: columns retrieved from DB related to constraint
      :return: ordered column
      """
      ordered_columns = []
      for column in ["task_id", "dag_id", "execution_date"]:
          if column in columns:
              ordered_columns.append(column)
  
      for column in columns:
          if column not in ["task_id", "dag_id", "execution_date"]:
              ordered_columns.append(column)
  
      return ordered_columns
  
file_path: airflow/airflow/migrations/versions/0046_1_10_5_change_datetime_to_datetime2_6_on_mssql_.py
imports: from __future__ import annotations
  from collections import defaultdict
  from alembic import op
  from sqlalchemy import text
  from sqlalchemy.dialects import mssql
label_desc: Use image node_id 4 for calling a global function with example usage: reorder_columns(columns) and returns: ordered_columns