From 4dacab372237633533b329d65580fe19ec87af14 Mon Sep 17 00:00:00 2001 From: Tzu-ping Chung Date: Tue, 16 May 2023 13:24:07 +0800 Subject: [PATCH] Always pass named type_ arg to drop_constraint (#31306) It seems Alembic recently starts to enforce this argument being passed using a keyword (instead of positional). These are failing since the upstream change. --- .../0089_2_2_0_make_xcom_pkey_columns_non_nullable.py | 2 +- .../versions/0093_2_2_0_taskinstance_keyed_to_dagrun.py | 4 ++-- .../0100_2_3_0_add_taskmap_and_map_id_on_taskinstance.py | 4 ++-- docs/apache-airflow/img/airflow_erd.sha256 | 2 +- docs/apache-airflow/img/airflow_erd.svg | 4 ++-- 5 files changed, 8 insertions(+), 8 deletions(-) diff --git a/airflow/migrations/versions/0089_2_2_0_make_xcom_pkey_columns_non_nullable.py b/airflow/migrations/versions/0089_2_2_0_make_xcom_pkey_columns_non_nullable.py index 68ef900a2db98..9ddfaa12c7646 100644 --- a/airflow/migrations/versions/0089_2_2_0_make_xcom_pkey_columns_non_nullable.py +++ b/airflow/migrations/versions/0089_2_2_0_make_xcom_pkey_columns_non_nullable.py @@ -54,7 +54,7 @@ def downgrade(): # columns were always non-nullable for mysql, sqlite and postgres, so leave them alone if conn.dialect.name == "mssql": - bop.drop_constraint("pk_xcom", "primary") + bop.drop_constraint("pk_xcom", type_="primary") # execution_date and key wasn't nullable in the other databases bop.alter_column("key", type_=StringID(length=512), nullable=True) bop.alter_column("execution_date", type_=TIMESTAMP, nullable=True) diff --git a/airflow/migrations/versions/0093_2_2_0_taskinstance_keyed_to_dagrun.py b/airflow/migrations/versions/0093_2_2_0_taskinstance_keyed_to_dagrun.py index 219eb973c1222..ff4e3984655c4 100644 --- a/airflow/migrations/versions/0093_2_2_0_taskinstance_keyed_to_dagrun.py +++ b/airflow/migrations/versions/0093_2_2_0_taskinstance_keyed_to_dagrun.py @@ -351,8 +351,8 @@ def downgrade(): if dialect_name == "mssql": with op.batch_alter_table("dag_run", schema=None) as batch_op: - batch_op.drop_constraint("dag_run_dag_id_execution_date_key", "unique") - batch_op.drop_constraint("dag_run_dag_id_run_id_key", "unique") + batch_op.drop_constraint("dag_run_dag_id_execution_date_key", type_="unique") + batch_op.drop_constraint("dag_run_dag_id_run_id_key", type_="unique") batch_op.drop_index("dag_id_state") batch_op.drop_index("idx_dag_run_running_dags") batch_op.drop_index("idx_dag_run_queued_dags") diff --git a/airflow/migrations/versions/0100_2_3_0_add_taskmap_and_map_id_on_taskinstance.py b/airflow/migrations/versions/0100_2_3_0_add_taskmap_and_map_id_on_taskinstance.py index d11953009aeed..9cac7cbc01f24 100644 --- a/airflow/migrations/versions/0100_2_3_0_add_taskmap_and_map_id_on_taskinstance.py +++ b/airflow/migrations/versions/0100_2_3_0_add_taskmap_and_map_id_on_taskinstance.py @@ -45,7 +45,7 @@ def upgrade(): """ # We need to first remove constraints on task_reschedule since they depend on task_instance. with op.batch_alter_table("task_reschedule") as batch_op: - batch_op.drop_constraint("task_reschedule_ti_fkey", "foreignkey") + batch_op.drop_constraint("task_reschedule_ti_fkey", type_="foreignkey") batch_op.drop_index("idx_task_reschedule_dag_task_run") # Change task_instance's primary key. @@ -100,7 +100,7 @@ def downgrade(): op.drop_table("task_map") with op.batch_alter_table("task_reschedule") as batch_op: - batch_op.drop_constraint("task_reschedule_ti_fkey", "foreignkey") + batch_op.drop_constraint("task_reschedule_ti_fkey", type_="foreignkey") batch_op.drop_index("idx_task_reschedule_dag_task_run") batch_op.drop_column("map_index", mssql_drop_default=True) diff --git a/docs/apache-airflow/img/airflow_erd.sha256 b/docs/apache-airflow/img/airflow_erd.sha256 index 596d8925617b6..f3c719fe42d97 100644 --- a/docs/apache-airflow/img/airflow_erd.sha256 +++ b/docs/apache-airflow/img/airflow_erd.sha256 @@ -1 +1 @@ -d3e1272db6e730812ad1c6c317e8de0147aee7b4c02cc33cb096645a408eedd5 \ No newline at end of file +4995c94849a5848e551e85ffeb99d3dda9f652f3c2d7b3cf3aa16c02911690d3 \ No newline at end of file diff --git a/docs/apache-airflow/img/airflow_erd.svg b/docs/apache-airflow/img/airflow_erd.svg index 017bff5c8f755..8439c226f8b98 100644 --- a/docs/apache-airflow/img/airflow_erd.svg +++ b/docs/apache-airflow/img/airflow_erd.svg @@ -1232,7 +1232,7 @@ task_instance--xcom -1 +0..N 1 @@ -1246,7 +1246,7 @@ task_instance--xcom -0..N +1 1