From 19b9893b3012a2ce446e2be2183f5d75332bf2ff Mon Sep 17 00:00:00 2001 From: Kanaka Pothina Date: Sat, 16 May 2026 18:03:29 -0400 Subject: [PATCH 1/3] Added Env variables for Imp Properties --- .github/workflows/dbt-ci.yml | 7 +++++ marketing_insights/.dbt/profiles.yml | 8 +++--- marketing_insights/dbt_project.yml | 5 ++++ .../models/example/my_first_dbt_model.sql | 27 ------------------- .../models/example/my_second_dbt_model.sql | 6 ----- marketing_insights/models/example/schema.yml | 20 -------------- .../rpt_order_insights.sql | 0 7 files changed, 16 insertions(+), 57 deletions(-) delete mode 100644 marketing_insights/models/example/my_first_dbt_model.sql delete mode 100644 marketing_insights/models/example/my_second_dbt_model.sql delete mode 100644 marketing_insights/models/example/schema.yml rename marketing_insights/models/{mart => reporting}/rpt_order_insights.sql (100%) diff --git a/.github/workflows/dbt-ci.yml b/.github/workflows/dbt-ci.yml index 592773c..573e274 100644 --- a/.github/workflows/dbt-ci.yml +++ b/.github/workflows/dbt-ci.yml @@ -16,6 +16,10 @@ jobs: env: DBT_PRIVATE_KEY: ${{ secrets.DBT_PRIVATE_KEY }} DBT_PRIVATE_KEY_PATH: /home/runner/.dbt/rsa_key.p8 + DBT_SNOWFLAKE_ACCOUNT: ${{ secrets.DBT_SNOWFLAKE_ACCOUNT }} + DBT_SNOWFLAKE_ROLE: ${{ secrets.DBT_SNOWFLAKE_ROLE }} + DBT_SNOWFLAKE_USER: ${{ secrets.DBT_SNOWFLAKE_USER }} + DBT_SCHEMA: pr_{{ github.event.pull_request.number }}_ANALYTICS steps: - name: Checkout repo @@ -44,5 +48,8 @@ jobs: - name: Run dbt debug run: dbt debug --target ci + - name: Run dbt seed + run: dbt seed --target ci + - name: Run dbt run: dbt build --target ci \ No newline at end of file diff --git a/marketing_insights/.dbt/profiles.yml b/marketing_insights/.dbt/profiles.yml index b9a310f..3fbd8c6 100644 --- a/marketing_insights/.dbt/profiles.yml +++ b/marketing_insights/.dbt/profiles.yml @@ -1,13 +1,13 @@ marketing_insights: outputs: ci: - account: EBIUGTJ-FN06775 + account: "{{ env_var('DBT_SNOWFLAKE_ACCOUNT') }}" database: MARKETING_INSIGHTS_CI private_key_path: "{{ env_var('DBT_PRIVATE_KEY_PATH') }}" - role: ACCOUNTADMIN - schema: ANALYTICS_CI + role: "{{ env_var('DBT_SNOWFLAKE_ROLE') }}" + schema: "{{ env_var('DBT_SCHEMA') }}" threads: 1 type: snowflake - user: KIRANPOTHINA + user: "{{ env_var('DBT_SNOWFLAKE_USER') }}" warehouse: COMPUTE_WH target: ci \ No newline at end of file diff --git a/marketing_insights/dbt_project.yml b/marketing_insights/dbt_project.yml index 582ee16..98b19be 100644 --- a/marketing_insights/dbt_project.yml +++ b/marketing_insights/dbt_project.yml @@ -52,6 +52,11 @@ models: +schema: MART +meta: layer: gold + reporting: + +tags: ['business intelligence', 'gold'] + +schema: REPORTING + +meta: + layer: gold example: +materialized: view diff --git a/marketing_insights/models/example/my_first_dbt_model.sql b/marketing_insights/models/example/my_first_dbt_model.sql deleted file mode 100644 index f31a12d..0000000 --- a/marketing_insights/models/example/my_first_dbt_model.sql +++ /dev/null @@ -1,27 +0,0 @@ - -/* - Welcome to your first dbt model! - Did you know that you can also configure models directly within SQL files? - This will override configurations stated in dbt_project.yml - - Try changing "table" to "view" below -*/ - -{{ config(materialized='table') }} - -with source_data as ( - - select 1 as id - union all - select null as id - -) - -select * -from source_data - -/* - Uncomment the line below to remove records with null `id` values -*/ - --- where id is not null diff --git a/marketing_insights/models/example/my_second_dbt_model.sql b/marketing_insights/models/example/my_second_dbt_model.sql deleted file mode 100644 index c91f879..0000000 --- a/marketing_insights/models/example/my_second_dbt_model.sql +++ /dev/null @@ -1,6 +0,0 @@ - --- Use the `ref` function to select from other models - -select * -from {{ ref('my_first_dbt_model') }} -where id = 1 diff --git a/marketing_insights/models/example/schema.yml b/marketing_insights/models/example/schema.yml deleted file mode 100644 index f6c8ac1..0000000 --- a/marketing_insights/models/example/schema.yml +++ /dev/null @@ -1,20 +0,0 @@ - -version: 2 - -models: - - name: my_first_dbt_model - description: "A starter dbt model" - columns: - - name: id - description: "The primary key for this table" - data_tests: - - unique - - - name: my_second_dbt_model - description: "A starter dbt model" - columns: - - name: id - description: "The primary key for this table" - data_tests: - - unique - - not_null diff --git a/marketing_insights/models/mart/rpt_order_insights.sql b/marketing_insights/models/reporting/rpt_order_insights.sql similarity index 100% rename from marketing_insights/models/mart/rpt_order_insights.sql rename to marketing_insights/models/reporting/rpt_order_insights.sql From a9b95a3e4e27c63641c30ec913f5f3a89769a3e3 Mon Sep 17 00:00:00 2001 From: Kanaka Pothina Date: Sat, 16 May 2026 18:06:54 -0400 Subject: [PATCH 2/3] Added Env variables for Imp Properties --- .github/workflows/dbt-ci.yml | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/.github/workflows/dbt-ci.yml b/.github/workflows/dbt-ci.yml index 573e274..0550d6a 100644 --- a/.github/workflows/dbt-ci.yml +++ b/.github/workflows/dbt-ci.yml @@ -46,10 +46,7 @@ jobs: run: dbt deps - name: Run dbt debug - run: dbt debug --target ci - - - name: Run dbt seed - run: dbt seed --target ci + run: dbt debug --target ci - name: Run dbt run: dbt build --target ci \ No newline at end of file From c97bce426099d818707cb4006554246cd0fb80eb Mon Sep 17 00:00:00 2001 From: Kanaka Pothina Date: Sat, 16 May 2026 18:10:03 -0400 Subject: [PATCH 3/3] Added Env variables for Imp Properties --- .github/workflows/dbt-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/dbt-ci.yml b/.github/workflows/dbt-ci.yml index 0550d6a..f3ad0f4 100644 --- a/.github/workflows/dbt-ci.yml +++ b/.github/workflows/dbt-ci.yml @@ -19,7 +19,7 @@ jobs: DBT_SNOWFLAKE_ACCOUNT: ${{ secrets.DBT_SNOWFLAKE_ACCOUNT }} DBT_SNOWFLAKE_ROLE: ${{ secrets.DBT_SNOWFLAKE_ROLE }} DBT_SNOWFLAKE_USER: ${{ secrets.DBT_SNOWFLAKE_USER }} - DBT_SCHEMA: pr_{{ github.event.pull_request.number }}_ANALYTICS + DBT_SCHEMA: pr_${{ github.event.pull_request.number }}_ANALYTICS steps: - name: Checkout repo