Skip to content

Commit 714abed

Browse files
--select tag:mart (#132)
2 parents 9480d29 + 0f185e1 commit 714abed

File tree

6 files changed

+47
-4
lines changed

6 files changed

+47
-4
lines changed

.github/hide_docs.py

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
import json
2+
3+
# modify manifest.json in dbt/target/ to hide things
4+
5+
with open('dbt/target/manifest.json', 'r') as f:
6+
data = json.loads(f.read())
7+
8+
for macro in data['macros']:
9+
data['macros'][macro]['docs']['show'] = False
10+
11+
for node in data['nodes']:
12+
if 'model.redshift' in node:
13+
data['nodes'][node]['docs']['show'] = False
14+
15+
if 'model.cdo_analytics' in node:
16+
config = data['nodes'][node]['config']
17+
if not config or 'released' not in config['tags']:
18+
data['nodes'][node]['docs']['show'] = False
19+
20+
with open('dbt/target/manifest.json', 'w') as f:
21+
json.dump(data, f)

.github/workflows/generate_docs.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,9 @@ jobs:
4747
working-directory: ./dbt
4848
run: dbt docs generate
4949

50+
- name: Hide unnecessary parts of docs
51+
run: python .github/hide_docs.py
52+
5053
- name: Upload artifact
5154
uses: actions/upload-pages-artifact@v3
5255
with:

dbt/dbt_project.yml

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,8 @@ models:
6868
tags:
6969
- "int"
7070
+materialized: table
71+
+docs:
72+
show: false
7173

7274
marts:
7375
tags:
@@ -78,6 +80,8 @@ models:
7880
tags:
7981
- "staging"
8082
+materialized: view
83+
+docs:
84+
show: false
8185

8286
dashboard:
8387
base:
@@ -104,9 +108,16 @@ models:
104108
tags:
105109
- "base"
106110
materialized: ephemeral
111+
+docs:
112+
show: false
107113

108114
amplitude:
109115
base:
110116
tags:
111117
- "base"
112-
materialized: ephemeral
118+
materialized: ephemeral
119+
120+
seeds:
121+
+docs:
122+
show: false
123+

dbt/macros/_macros.yml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,19 @@ macros:
44
- name: active_status_label
55
description: >
66
This macro is an attempt to engage in some DRY practice - to remove repeticious hard-coded labels for school, teacher, etc. activity. We have a method for determining whether a school, teacher, section is "active" (see: dim_school_status.) The method produces a 3-digit binary code. The key is below. This method is used in several locations where a label e.g. "active new" is applided. These 3 values can be combined into an ordered 3-char string representing the concatenated true/false combinations for Active|Prev|Ever. (e.g. "101" means the schools is 1. Active, 2. Was not active last year) therefore, we label it as "Active - Reacquired."
7+
docs:
8+
show: false
79

810
- name: pad_school_id
911
description: >
1012
This macro adjusts for known data quality issue where a `school_id` can be 11 or 12 characters in length.
13+
docs:
14+
show: false
1115

1216
- name: us_intl_label
1317
description: Quick and handy way to convert is_international to a reporting label.
18+
docs:
19+
show: false
1420

1521

1622
# template from chatgpt
@@ -30,4 +36,4 @@ macros:
3036
# - name: Example Usage
3137
# description: A brief description of the example.
3238
# code: |
33-
# {{ macro_name(argument='value') }}
39+
# {{ macro_name(argument='value') }}

dbt/models/marts/courses/_courses__models.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ models:
1515
# tests:
1616
# - unique
1717
# - not_null
18+
config:
19+
tags: ['released']
1820

1921

2022
- name: dim_levels
@@ -48,4 +50,4 @@ models:
4850
description: bit field does this level have a mapping for concept-difficulty
4951

5052
- name: course_family
51-
description: the short name for which course this script/level combo belongs to e.g. csf, csd, csp, csa, hoc, etc.
53+
description: the short name for which course this script/level combo belongs to e.g. csf, csd, csp, csa, hoc, etc.

dbt/models/staging/pegasus_pii/_pegasus_pii__sources.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,4 @@ sources:
77
tables:
88
- name: forms
99
- name: form_geos
10-
- name: hoc_activity
10+
- name: hoc_activity

0 commit comments

Comments
 (0)