From f0971bcbd7b10a0464645f3f7c0d8eaff7759924 Mon Sep 17 00:00:00 2001 From: sungchun12 Date: Sun, 21 Feb 2021 18:11:40 -0600 Subject: [PATCH 1/6] inherit profile target db --- snapshots/orders_snapshot.sql | 1 - 1 file changed, 1 deletion(-) diff --git a/snapshots/orders_snapshot.sql b/snapshots/orders_snapshot.sql index 7450ce0..e4a4bae 100644 --- a/snapshots/orders_snapshot.sql +++ b/snapshots/orders_snapshot.sql @@ -13,7 +13,6 @@ {{ config ( - target_database='wam-bam-258119', target_schema='dbt_bq_example', unique_key='id', From 97bc24b9dba0a07c21b4656c6d771ba3b7393e3b Mon Sep 17 00:00:00 2001 From: sungchun12 Date: Sun, 21 Feb 2021 18:12:12 -0600 Subject: [PATCH 2/6] upgrade to 0.19.0 --- dbt_project.yml | 2 +- requirements.txt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/dbt_project.yml b/dbt_project.yml index 6432e53..af3a07b 100644 --- a/dbt_project.yml +++ b/dbt_project.yml @@ -1,6 +1,6 @@ name: "jaffle_shop" # Specify a requirement on an _exact_ version of dbt -require-dbt-version: 0.18.0 +require-dbt-version: 0.19.0 version: 1.0.0 config-version: 2 profile: "jaffle_shop" diff --git a/requirements.txt b/requirements.txt index bb7a973..38e8ae6 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1 +1 @@ -dbt==0.18.0 \ No newline at end of file +dbt==0.19.0 \ No newline at end of file From 3d151548a288a7ea042e328386a1473a41714c3c Mon Sep 17 00:00:00 2001 From: sungchun12 Date: Sun, 21 Feb 2021 18:12:22 -0600 Subject: [PATCH 3/6] have database be env_var --- models/sources/sources.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/models/sources/sources.yml b/models/sources/sources.yml index fb5ecf0..2a0bbf8 100644 --- a/models/sources/sources.yml +++ b/models/sources/sources.yml @@ -2,7 +2,7 @@ version: 2 sources: - name: dbt_bq_example - database: wam-bam-258119 + database: "{{ env_var('PROJECT_ID', 'dvc-demo-297316') }}" schema: dbt_bq_example freshness: From fe25af303d6c8f6d29c44435c2c03b315592c138 Mon Sep 17 00:00:00 2001 From: sungchun12 Date: Sun, 21 Feb 2021 18:12:32 -0600 Subject: [PATCH 4/6] remove scopes as it's not needed --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 3bb658e..18baeea 100644 --- a/README.md +++ b/README.md @@ -69,7 +69,7 @@ export DBT_PROFILES_DIR=$(pwd) export PROJECT_ID="your-project-id" # connect to GCP -gcloud auth application-default login --scopes=https://www.googleapis.com/auth/userinfo.email,https://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/drive.readonly +gcloud auth application-default login # check if the dbt files and connection work using oauth as the default dbt debug From e215437dc1cea6a8329a94c9027c8158e4eaf6e3 Mon Sep 17 00:00:00 2001 From: sungchun12 Date: Tue, 23 Feb 2021 14:37:52 -0600 Subject: [PATCH 5/6] update readme instructions for auth and project --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 18baeea..204a9b1 100644 --- a/README.md +++ b/README.md @@ -69,7 +69,7 @@ export DBT_PROFILES_DIR=$(pwd) export PROJECT_ID="your-project-id" # connect to GCP -gcloud auth application-default login +gcloud auth login # check if the dbt files and connection work using oauth as the default dbt debug @@ -159,7 +159,7 @@ gcloud services enable run.googleapis.com # build the docker image locally and tag it to eventually push to container registry # does not take into account gitignore constraints given it's built locally # ex: docker build . --tag gcr.io/wam-bam-258119/dbt-docs-cloud-run -export PROJECT_ID="wam-bam-258119" +export PROJECT_ID="dvc-demo-297316" export IMAGE="dbt-docs-cloud-run" export REGION="us-central1" From 40f4c640789700f2e3626d8b854146d61ef3764d Mon Sep 17 00:00:00 2001 From: sungchun12 Date: Tue, 23 Feb 2021 14:44:56 -0600 Subject: [PATCH 6/6] update github actions for project and python -v --- .github/workflows/cloud_run.yml | 4 ++-- .github/workflows/dbt_operations.yml | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/cloud_run.yml b/.github/workflows/cloud_run.yml index 17fa0d6..d9d6af4 100644 --- a/.github/workflows/cloud_run.yml +++ b/.github/workflows/cloud_run.yml @@ -8,7 +8,7 @@ on: env: #TODO(developer): update PROJECT_ID, REGION, IMAGE - PROJECT_ID: "wam-bam-258119" + PROJECT_ID: "dvc-demo-297316" REGION: "us-central1" IMAGE: "dbt-docs-cloud-run" DBT_PROFILES_DIR: ./ @@ -32,7 +32,7 @@ jobs: # Setup dbt configs - uses: actions/setup-python@v1 with: - python-version: "3.7.x" + python-version: "3.8.x" - run: pip3 install -r ./requirements.txt - run: dbt --version - run: 'echo "$KEYFILE" > ./service_account.json' # persist file in root dir diff --git a/.github/workflows/dbt_operations.yml b/.github/workflows/dbt_operations.yml index 3be09ed..75eec27 100644 --- a/.github/workflows/dbt_operations.yml +++ b/.github/workflows/dbt_operations.yml @@ -8,7 +8,7 @@ on: env: #TODO(developer): update PROJECT_ID - PROJECT_ID: "wam-bam-258119" + PROJECT_ID: "dvc-demo-297316" DBT_PROFILES_DIR: ./ DBT_GOOGLE_BIGQUERY_KEYFILE: ./service_account.json @@ -22,7 +22,7 @@ jobs: - uses: actions/checkout@master - uses: actions/setup-python@v1 with: - python-version: "3.7.x" + python-version: "3.8.x" - run: pip3 install -r ./requirements.txt - run: dbt --version - run: 'echo "$KEYFILE" > ./service_account.json' # persist file in root dir