diff --git a/dev/dags/cosmos_seed_dag.py b/dev/dags/cosmos_seed_dag.py index 33416b0b3..afdf56c72 100644 --- a/dev/dags/cosmos_seed_dag.py +++ b/dev/dags/cosmos_seed_dag.py @@ -46,7 +46,7 @@ for seed in ["raw_customers", "raw_payments", "raw_orders"]: DbtRunOperationOperator( task_id=f"drop_{seed}_if_exists", - macro_name="drop_table", + macro_name="drop_table_by_name", args={"table_name": seed}, project_dir=DBT_ROOT_PATH / "jaffle_shop", profile_config=profile_config, diff --git a/dev/dags/dbt/jaffle_shop/macros/drop_table.sql b/dev/dags/dbt/jaffle_shop/macros/drop_table.sql index ebd19e2d3..37a8b21d7 100644 --- a/dev/dags/dbt/jaffle_shop/macros/drop_table.sql +++ b/dev/dags/dbt/jaffle_shop/macros/drop_table.sql @@ -1,4 +1,4 @@ -{%- macro drop_table(table_name) -%} +{%- macro drop_table_by_name(table_name) -%} {%- set drop_query -%} DROP TABLE IF EXISTS {{ target.schema }}.{{ table_name }} CASCADE {%- endset -%} diff --git a/dev/dags/dbt/jaffle_shop_python/macros/drop_table.sql b/dev/dags/dbt/jaffle_shop_python/macros/drop_table.sql deleted file mode 100644 index ebd19e2d3..000000000 --- a/dev/dags/dbt/jaffle_shop_python/macros/drop_table.sql +++ /dev/null @@ -1,6 +0,0 @@ -{%- macro drop_table(table_name) -%} - {%- set drop_query -%} - DROP TABLE IF EXISTS {{ target.schema }}.{{ table_name }} CASCADE - {%- endset -%} - {% do run_query(drop_query) %} -{%- endmacro -%}