From ec1bda4ce2d0fdac7ebac0c6d30549ff77f45f5d Mon Sep 17 00:00:00 2001 From: Niall Woodward Date: Thu, 17 Feb 2022 20:14:51 +0000 Subject: [PATCH] Use built-in create_artifact_resources (#90) --- .../macros/replace_artifact_resources.sql | 29 ------------------- tox.ini | 2 +- 2 files changed, 1 insertion(+), 30 deletions(-) delete mode 100644 integration_test_project/macros/replace_artifact_resources.sql diff --git a/integration_test_project/macros/replace_artifact_resources.sql b/integration_test_project/macros/replace_artifact_resources.sql deleted file mode 100644 index 2360d98e..00000000 --- a/integration_test_project/macros/replace_artifact_resources.sql +++ /dev/null @@ -1,29 +0,0 @@ -{% macro create_or_replace_artifact_resources() %} - -{% set src_dbt_artifacts = source('dbt_artifacts', 'artifacts') %} - -{{ create_schema(src_dbt_artifacts) }} - -{% set create_stage_query %} -create or replace stage {{ src_dbt_artifacts }} -file_format = (type = json); -{% endset %} - -{% set create_table_query %} -create or replace table {{ src_dbt_artifacts }} ( - data variant, - generated_at timestamp, - path string, - artifact_type string -); - -{% endset %} - - -{% do log("Creating Stage: " ~ create_stage_query, info=True) %} -{% do run_query(create_stage_query) %} - -{% do log("Creating Table: " ~ create_table_query, info=True) %} -{% do run_query(create_table_query) %} - -{% endmacro %} diff --git a/tox.ini b/tox.ini index 2c7a0e3b..9c25d384 100644 --- a/tox.ini +++ b/tox.ini @@ -94,7 +94,7 @@ commands = sqlfluff fix models --ignore parsing changedir = integration_test_project commands = dbt deps - dbt run-operation create_or_replace_artifact_resources + dbt run-operation create_artifact_resources dbt run-operation upload_dbt_artifacts --args '\{filenames: [manifest, run_results], prefix: artifacts/schema_v4/build/\}' dbt run-operation upload_dbt_artifacts --args '\{filenames: [manifest, run_results], prefix: artifacts/schema_v4/build_full_refresh/\}' dbt run-operation upload_dbt_artifacts --args '\{filenames: [manifest, run_results], prefix: artifacts/schema_v4/run/\}'