Skip to content

Commit 14dce5a

Browse files
authored
move us_population to its own schema (#228)
* move us_population to its own schema * run observe model for post hook * Add S3 upload to deploy script
1 parent c0c268c commit 14dce5a

File tree

5 files changed

+51
-29
lines changed

5 files changed

+51
-29
lines changed

.github/workflows/10_integrate_dbt_changes.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,10 @@ jobs:
7979
##### Governance Checks
8080
# this first runs dbt but creates enpty tables, this is enough to then run the hooks and fail fast
8181

82+
# We need to run observe model so that post hook works
83+
- name: Run Observe Model
84+
run: "dbt build --fail-fast -s L1_inlets.observe"
85+
8286
# There is an issue with --empty and dynamic tables so need to exclude them
8387
- name: Governance run of dynamic tables
8488
run: "dbt build --fail-fast -s config.materialized:dynamic_table -s test_failures --defer --state logs"

.github/workflows/30_deploy_changes_to_production.yml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,25 @@ jobs:
104104
- name: Upload dbt artifacts
105105
run: "dbt run-operation upload_artifacts"
106106

107+
- name: Configure AWS credentials
108+
uses: aws-actions/configure-aws-credentials@v4
109+
with:
110+
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
111+
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
112+
aws-region: us-west-2
113+
114+
- name: Upload artifacts to S3 for Datahub
115+
run: |
116+
# Check and upload each file individually
117+
for file in target/sources.json target/manifest.json target/catalog.json target/run_results.json; do
118+
if [ -f "$file" ]; then
119+
echo "Uploading $file to S3..."
120+
aws s3 cp "$file" "s3://${DBT_ARTIFACTS_BUCKET}/dbt_artifacts/$(basename $file)"
121+
else
122+
echo "File $file does not exist, skipping..."
123+
fi
124+
done
125+
107126
- uses: fregante/setup-git-user@v2
108127
- name: Bump dbt project and git project version
109128
run: "../automate/dbt/bump_dbt_project.sh"

secure/databases.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,11 @@
99
schemas:
1010
- L1_ACCOUNT_USAGE
1111
- L1_COUNTRY_DATA
12-
- L1_GOOGLE_ANALYTICS_4
13-
- L1_DBT_ARTIFACTS
1412
- L1_COVID19_EPIDEMIOLOGICAL_DATA
13+
- L1_GOOGLE_ANALYTICS_4
1514
- L1_LOANS
1615
- L1_OBSERVE
16+
- L1_US_POPULATION
1717

1818
- L2_COUNTRY_DEMOGRAPHICS
1919
- L2_COVID_OBSERVATIONS

secure/roles.yml

Lines changed: 25 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -16,16 +16,15 @@
1616

1717
- z_schema_seeds
1818

19-
- z_schema_l1_dbt_artifacts
19+
- z_schema_dbt_test__audit
20+
2021
- z_schema_l1_account_usage
2122
- z_schema_l1_country_data
22-
- z_schema_l1_google_analytics_4
23-
- z_schema_l1_dbt_artifacts
2423
- z_schema_l1_covid19_epidemiological_data
24+
- z_schema_l1_google_analytics_4
2525
- z_schema_l1_loans
2626
- z_schema_l1_observe
27-
28-
- z_schema_dbt_test__audit
27+
- z_schema_l1_us_population
2928

3029
- z_schema_l2_country_demographics
3130
- z_schema_l2_covid_observations
@@ -355,66 +354,66 @@
355354
read:
356355
- raw.snapshots
357356

358-
# INLETS
359-
- z_schema_l1_account_usage:
357+
- z_schema_resources:
360358
privileges:
361359
schemas:
362360
read:
363-
- balboa.l1_account_usage
361+
- balboa_apps.resources
364362

365-
- z_schema_l1_country_data:
363+
- z_schema_seeds:
366364
privileges:
367365
schemas:
368366
read:
369-
- balboa.l1_country_data
367+
- balboa.seeds
370368

371-
- z_schema_l1_google_analytics_4:
369+
- z_schema_dbt_test__audit:
372370
privileges:
373371
schemas:
374372
read:
375-
- balboa.l1_google_analytics_4
373+
- balboa.dbt_test__audit
376374

377-
- z_schema_l1_covid19_epidemiological_data:
375+
# INLETS
376+
- z_schema_l1_account_usage:
378377
privileges:
379378
schemas:
380379
read:
381-
- balboa.l1_covid19_epidemiological_data
380+
- balboa.l1_account_usage
382381

383-
- z_schema_l1_dbt_artifacts:
382+
- z_schema_l1_country_data:
384383
privileges:
385384
schemas:
386385
read:
387-
- balboa.l1_dbt_artifacts
386+
- balboa.l1_country_data
388387

389-
- z_schema_l1_loans:
388+
- z_schema_l1_covid19_epidemiological_data:
390389
privileges:
391390
schemas:
392391
read:
393-
- balboa.l1_loans
392+
- balboa.l1_covid19_epidemiological_data
394393

395-
- z_schema_l1_observe:
394+
- z_schema_l1_google_analytics_4:
396395
privileges:
397396
schemas:
398397
read:
399-
- balboa.l1_observe
398+
- balboa.l1_google_analytics_4
400399

401-
- z_schema_resources:
400+
- z_schema_l1_loans:
402401
privileges:
403402
schemas:
404403
read:
405-
- balboa_apps.resources
404+
- balboa.l1_loans
406405

407-
- z_schema_seeds:
406+
- z_schema_l1_observe:
408407
privileges:
409408
schemas:
410409
read:
411-
- balboa.seeds
410+
- balboa.l1_observe
412411

413-
- z_schema_dbt_test__audit:
412+
- z_schema_l1_us_population:
414413
privileges:
415414
schemas:
416415
read:
417-
- balboa.dbt_test__audit
416+
- balboa.l1_us_population
418417

419418
# BAYS
420419
- z_schema_l2_country_demographics:

transform/dbt_project.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ models:
7777
observe:
7878
+schema: L1_OBSERVE
7979
us_population:
80-
+schema: L1_COUNTRY_DATA
80+
+schema: L1_US_POPULATION
8181

8282
L2_bays:
8383
+group: marketing

0 commit comments

Comments
 (0)