Skip to content

Commit 98a6758

Browse files
authored
Merge pull request #4 from TechArtists/multiple-project-source
get rid of overbase. long live ta
2 parents bee29b0 + 0816a13 commit 98a6758

30 files changed

Lines changed: 678 additions & 227 deletions

README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ Welcome to your new dbt project!
44

55

66
This library works by default for one google cloud project:
7-
# "OVERBASE:SOURCES":
7+
# "TA:SOURCES":
88
# - {project_id: google_cloud_project_id,
99
# analytics_dataset_id: schema_id,
1010
# events_table: events_table_prefix*,
@@ -14,12 +14,12 @@ This library works by default for one google cloud project:
1414
Adding more project_ids and multiple dataset_ids for specific datasets is also possible.
1515
A few additional steps are required for multiple sources to be added as sources.
1616

17-
1) OVERBASE:SOURCES_READY must be set to false (default).
18-
2) add projects and datasets to the OVERBASE:SOURCES variable in your dbt project
17+
1) TA:SOURCES_READY must be set to false (default).
18+
2) add projects and datasets to the TA:SOURCES variable in your dbt project
1919
3) run the following command to generate sources for all projects:
2020
dbt run-operation -q generate_firebase_sources > models/firebase_sources.yml
21-
4) change OVERBASE:SOURCES_READY to true
22-
# "OVERBASE:SOURCES":
21+
4) change TA:SOURCES_READY to true
22+
# "TA:SOURCES":
2323
# - {project_id: google_cloud_project_id,
2424
# analytics_dataset_id: schema_id,
2525
# events_table: events_table_prefix*,

analyses/measure_dimension_rollup_explosion.sql

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,19 +5,19 @@
55
] -%}
66

77

8-
{%- set miniColumnsToIgnoreInGroupBy = overbase_firebase.get_mini_columns_to_ignore_when_rolling_up() -%}
8+
{%- set miniColumnsToIgnoreInGroupBy = ta_firebase..get_mini_columns_to_ignore_when_rolling_up() -%}
99

1010
{# Ignore all time zones except the first & last (they're all the same, just save the computational effort) #}
11-
{%- set timezones = overbase_firebase.generate_date_timezone_age_struct('dont care') | map(attribute=0) | list -%}
11+
{%- set timezones = ta_firebase..generate_date_timezone_age_struct('dont care') | map(attribute=0) | list -%}
1212
{%- set timezones = timezones[1:-1] -%}
13-
{%- set miniColumnsToIgnoreInGroupBy = miniColumnsToIgnoreInGroupBy + overbase_firebase.list_map_and_add_prefix(timezones, 'event_dates.') + overbase_firebase.list_map_and_add_prefix(timezones, 'install_dates.') -%}
13+
{%- set miniColumnsToIgnoreInGroupBy = miniColumnsToIgnoreInGroupBy + ta_firebase..list_map_and_add_prefix(timezones, 'event_dates.') + ta_firebase..list_map_and_add_prefix(timezones, 'install_dates.') -%}
1414

1515

16-
{%- set tmp_res = overbase_firebase.get_filtered_columns_for_table("fb_analytics_events_raw", columnNamesEventDimensions, miniColumnsToIgnoreInGroupBy) -%}
16+
{%- set tmp_res = ta_firebase..get_filtered_columns_for_table("fb_analytics_events_raw", columnNamesEventDimensions, miniColumnsToIgnoreInGroupBy) -%}
1717
{%- set columnsForEventDimensions = tmp_res[0] -%}
1818

1919

20-
{%- set minicolumns = overbase_firebase.unpack_columns_into_minicolumns_array(columnsForEventDimensions, miniColumnsToIgnoreInGroupBy, [], "", "") -%}
20+
{%- set minicolumns = ta_firebase..unpack_columns_into_minicolumns_array(columnsForEventDimensions, miniColumnsToIgnoreInGroupBy, [], "", "") -%}
2121
{%- set unionAllSelects = [] -%}
2222

2323
WITH

dbt_project.yml

Lines changed: 28 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
name: 'overbase_firebase'
2-
version: '0.9.10'
1+
name: 'ta_firebase'
2+
version: '0.9.13'
33
config-version: 2
44

55
# This setting configures which "profile" dbt uses for this project.
@@ -18,23 +18,23 @@ clean-targets: # directories to be removed by `dbt clean`
1818
- "dbt_packages"
1919

2020
models:
21-
overbase_firebase:
21+
ta_firebase:
2222
# Applies to all files under models/example/
2323
materialized: table
24-
schema: overbase
24+
schema: ta_firebase
2525
+persist_docs:
2626
relation: true
2727
columns: true
2828

2929
seeds:
30-
overbase_firebase:
31-
schema: overbase
30+
ta_firebase:
31+
schema: ta
3232

3333
vars:
34-
overbase_firebase:
35-
"OVERBASE:DONT_CARE": "MAKE_YAML_WORK" # optional
36-
"OVERBASE:SOURCES_READY" : false
37-
# "OVERBASE:SOURCES":
34+
ta_firebase:
35+
"TA:DONT_CARE": "MAKE_YAML_WORK" # optional
36+
"TA:SOURCES_READY" : false
37+
# "TA:SOURCES":
3838
# - {project_id: watermark-maker,
3939
# analytics_dataset_id: analytics_150733022,
4040
# events_table: events_*,
@@ -50,24 +50,24 @@ vars:
5050
# don't define variables here, because if they aren't overwritten in the client yml, then they will resolve to "None".
5151
# Instead, use them in the package where you need them with them with the appropriate default value
5252
# Furthermore, whatever we use in sources.yml, we can't define in this package's dbt_project.yml, or else they won't be able to be overwritten by the client
53-
# Any mandatory variables you want to be enforced should go into overbase_mandatory_vars.sql
53+
# Any mandatory variables you want to be enforced should go into ta_mandatory_vars.sql
5454
# The comments liste here is just for our sanity & easier c/p in client configs
55-
# "OVERBASE:FIREBASE_ANALYTICS_CUSTOM_INSTALL_EVENT": "" # optional e.g. attributed_first_open
56-
# "OVERBASE:CUSTOM_PLATFORM_PREPROCESSOR": "IF(app_info.version LIKE '%nexus', 'nexus', platform)"
57-
# "OVERBASE:FIREBASE_ANALYTICS_DEFAULT_INCREMENTAL_DAYS": # optional
58-
# "OVERBASE:FIREBASE_CRASHLYTICS_DEFAULT_INCREMENTAL_DAYS": # optional
59-
# "OVERBASE:FIREBASE_ANALYTICS_FULL_REFRESH_START_DATE": "2018-01-01" # mandatory
60-
# "OVERBASE:FIREBASE_ANALYTICS_FULL_REFRESH_END_DATE": "2019-01-05" #optional, if you want to make
61-
# "OVERBASE:FIREBASE_CRASHLYTICS_FULL_REFRESH_START_DATE": "2018-01-01" # mandatory
62-
# "OVERBASE:FIREBASE_CRASHLYTICS_FULL_REFRESH_END_DATE": "20219-01-05" #optional, if you want to make
63-
# "OVERBASE:OB_DIMENSION_TO_EXCLUDE_IN_ROLLUPS": # optional, what built-in OB dimensions to exclude from bubbling up in the rollups (& save the row count)
55+
# "TA:FIREBASE_ANALYTICS_CUSTOM_INSTALL_EVENT": "" # optional e.g. attributed_first_open
56+
# "TA:CUSTOM_PLATFORM_PREPROCESSOR": "IF(app_info.version LIKE '%nexus', 'nexus', platform)"
57+
# "TA:FIREBASE_ANALYTICS_DEFAULT_INCREMENTAL_DAYS": # optional
58+
# "TA:FIREBASE_CRASHLYTICS_DEFAULT_INCREMENTAL_DAYS": # optional
59+
# "TA:FIREBASE_ANALYTICS_FULL_REFRESH_START_DATE": "2018-01-01" # mandatory
60+
# "TA:FIREBASE_ANALYTICS_FULL_REFRESH_END_DATE": "2019-01-05" #optional, if you want to make
61+
# "TA:FIREBASE_CRASHLYTICS_FULL_REFRESH_START_DATE": "2018-01-01" # mandatory
62+
# "TA:FIREBASE_CRASHLYTICS_FULL_REFRESH_END_DATE": "20219-01-05" #optional, if you want to make
63+
# "TA:DIMENSION_TO_EXCLUDE_IN_ROLLUPS": # optional, what built-in TA dimensions to exclude from bubbling up in the rollups (& save the row count)
6464
# - geo.city
6565
# - geo.metro
66-
# "OVERBASE:CUSTOM_USER_PROPERTIES": # data_types : "string", "int", "double"
66+
# "TA:CUSTOM_USER_PROPERTIES": # data_types : "string", "int", "double"
6767
# - { key_name: up_just_in_raw, data_type: 'string'}
6868
# - { key_name: first_open_time, data_type: 'int'}
6969
# - { key_name: poorly_set_variable, data_type: 'double'}
70-
# "OVERBASE:CUSTOM_EVENT_PARAMETERS": # data_types : "string", "int", "double"
70+
# "TA:CUSTOM_EVENT_PARAMETERS": # data_types : "string", "int", "double"
7171
# - { key_name: quantity, data_type: 'int', rollup_type: 'metric'}
7272
# - { key_name: quantity, data_type: 'int', rollup_type: 'metric', metric_rollup_transformation: 'SUM(##)', struct_field_name: 'quantity_int2' }
7373
# - { key_name: quantity, data_type: 'int', rollup_type: 'metric', metric_rollup_transformation: 'AVG(##)', struct_field_name: 'quantity_int3', rollup_struct_field_name: 'cm_quantity_avg' }
@@ -97,13 +97,13 @@ vars:
9797
# - { key_name: quantity, data_type: 'int', rollup_type: 'metric', metric_rollup_transformation: 'AVG(##)', struct_field_name: 'quantity_avg' }
9898
# - { key_name: quantity, data_type: 'int', rollup_type: 'metricOnly', metric_rollup_transformation: 'SUM(##)', struct_field_name: 'quantity_int_sum2' }
9999
# - { key_name: server_sent_ts, data_type: 'string', rollup_type: 'raw', extract_transformation: 'TIMESTAMP(##)', output_data_type: 'TIMESTAMP', struct_field_name: 'server_sent_ts' }
100-
# "OVERBASE:CUSTOM_CRASHLYTICS_KEYS": # data_types : "string", "int", "float", "double"
100+
# "TA:CUSTOM_CRASHLYTICS_KEYS": # data_types : "string", "int", "float", "double"
101101
# - { key_name: network_state, data_type: 'string'}
102-
# "OVERBASE:CUSTOM_APP_HEALTH_MEASURES": # optional, any custom measures that you want rolled up in the app_health model
102+
# "TA:CUSTOM_APP_HEALTH_MEASURES": # optional, any custom measures that you want rolled up in the app_health model
103103
# - name: signup_step_1 #no spaces, needs to be a proper column name
104104
# model: analytics_forced_nulls # optional. It can either be analytics/analytics-forced-nulls/crashlytics. Default is analytics
105105
# agg: SUM(##)
106-
# event_name: ui_view_shown
106+
# event_name: ui_view_show
107107
# # mini_measures: ["cnt", "users"] # optional, the default it aggregates over if unspecified
108108
# additional_filter : event_parameters.view_name_string = 'signup step 1'
109109
# - name: svc_inbound_duration
@@ -115,11 +115,11 @@ vars:
115115
# model: crashlytics
116116
# agg: SUM(##)
117117
# additional_filter: error_type = 'FATAL' AND custom_keys.call_state = 'duringCall'
118-
# "OVERBASE:CUSTOM_APP_HEALTH_METRICS": # TODO later on, forward to the BI tool as the semantic layer
118+
# "TA:CUSTOM_APP_HEALTH_METRICS": # TODO later on, forward to the BI tool as the semantic layer
119119
# NOT IMPLEMENTED ATM
120120
# - name: signup_ratio
121121
# type: ratio
122122
# numerator_agg: SUM(##)
123-
# numerator_filter : event_name LIKE '%view_shown' AND event_parameters.view_name_string = 'signup step 1' AND event_parameters.view_type_string = 'ob-forced-null'
123+
# numerator_filter : event_name LIKE '%view_show' AND event_parameters.view_name_string = 'signup step 1' AND event_parameters.view_type_string = 'ta-forced-null'
124124
# denominator_agg: SUM(##)
125-
# denominator_filter: event_name LIKE '%view_shown' AND event_parameters.view_name_string = 'signup step 5' AND event_parameters.view_type_string = 'ob-forced-null'
125+
# denominator_filter: event_name LIKE '%view_show' AND event_parameters.view_name_string = 'signup step 5' AND event_parameters.view_type_string = 'ta-forced-null'

0 commit comments

Comments
 (0)