Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature: Add Quickstart Model Counts to README #26

Merged
merged 8 commits into from
Jan 17, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,5 @@
target/
dbt_packages/
logs/
.DS_Store
package-lock.yml
6 changes: 5 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
# dbt_app_reporting vNEXTRELEASE
# dbt_app_reporting version.version

## Documentation
- Added Quickstart model counts to README. ([#26](https://github.com/fivetran/dbt_app_reporting/pull/26))
- Corrected references to connectors and connections in the README. ([#26](https://github.com/fivetran/dbt_app_reporting/pull/26))

## Under the Hood
- Addition of a section tag within the README so the model descriptions may be accessible within the Fivetran UI for Quickstart.
Expand Down
27 changes: 18 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,15 +32,23 @@ Refer to the table below for a detailed view of final tables materialized by def

> The individual Google Play and Apple App Store tables have additional platform-specific metrics better suited for deep-dive analyses.

### Materialized Models
Each Quickstart transformation job run materializes the following model counts for each selected connector. The total model count represents all staging, intermediate, and final models, materialized as `view`, `table`, or `incremental`:

| **Connector** | **Model Count** |
| ------------- | --------------- |
| App Reporting | 18 |
| [Apple App Store](https://github.com/fivetran/dbt_apple_store) | 38 |
| [Google Play](https://github.com/fivetran/dbt_google_play) | 40 |
<!--section-end-->

## How do I use the dbt package?
### Step 1: Pre-Requisites
- **Connector**: Have all relevant Fivetran app platform connectors syncing data into your warehouse. This package currently supports:
- Have all relevant Fivetran app platform connections syncing data into your destination. This package currently supports:
- [Apple App Store](https://fivetran.com/docs/applications/apple-app-store)
- [Google Play](https://fivetran.com/docs/applications/google-play)
- **Database support**: This package has been tested on **BigQuery**, **Snowflake**, **Redshift**, **Postgres** and **Databricks**. Ensure you are using one of these supported databases.
- **dbt Version**: This dbt package requires you have a functional dbt project that utilizes a dbt version within the respective range `>=1.0.0, <2.0.0`.
- This package has been tested on **BigQuery**, **Snowflake**, **Redshift**, **Postgres** and **Databricks**. Ensure you are using one of these supported databases.
- This dbt package requires you have a functional dbt project that utilizes a dbt version within the respective range `>=1.0.0, <2.0.0`.

### Step 2: Installing the Package
Include the following github package version in your `packages.yml`
Expand All @@ -54,9 +62,9 @@ packages:
Do NOT include the individual app platform packages in this file. The app reporting package itself has dependencies on these packages and will install them as well.

### Step 3: Configure Database and Schema Variables
By default, this package looks for your app platform data in your target database. If this is not where your app platform data is stored, add the relevant `<connector>_database` variables to your `dbt_project.yml` file (see below).
By default, this package looks for your app platform data in your target database. If this is not where your app platform data is stored, add the relevant `<connection>_database` variables to your `dbt_project.yml` file (see below).

By default, this package also looks for your connector data in specific schemas (`itunes_connect` and `google_play` for Apple App Store and Google Play, respectively). If your data is stored in a different schema, add the relevant `<connector>_schema` variables to your `dbt_project.yml` file (see below).
By default, this package also looks for your connection data in specific schemas (`itunes_connect` and `google_play` for Apple App Store and Google Play, respectively). If your data is stored in a different schema, add the relevant `<connection>_schema` variables to your `dbt_project.yml` file (see below).

```yml
vars:
Expand All @@ -68,7 +76,7 @@ vars:
```

### Step 4: Disable and Enable Source Tables
Your app platform connectors might not sync every table that this package expects. If your syncs exclude certain tables, it is because you either don't use that functionality in your respective app platforms or have actively excluded some tables from your syncs.
Your app platform connections might not sync every table that this package expects. If your syncs exclude certain tables, it is because you either don't use that functionality in your respective app platforms or have actively excluded some tables from your syncs.

If you use subscriptions and have the follow tables enabled for:
- Apple App Store
Expand Down Expand Up @@ -119,8 +127,8 @@ models:
### (Optional) Step 7: Additional configurations
<details open><summary>Expand/collapse configurations</summary>

#### Union multiple connectors
If you have multiple app reporting connectors in Fivetran and would like to use this package on all of them simultaneously, we have provided functionality to do so. The package will union all of the data together and pass the unioned table into the transformations. You will be able to see which source it came from in the `source_relation` column of each model. To use this functionality, you will need to set either the `<package_name>_union_schemas` OR `<package_name>_union_databases` variables (cannot do both) in your root `dbt_project.yml` file. Below are the variables and examples for each connector:
#### Union multiple connections
If you have multiple app reporting connections in Fivetran and would like to use this package on all of them simultaneously, we have provided functionality to do so. The package will union all of the data together and pass the unioned table into the transformations. You will be able to see which source it came from in the `source_relation` column of each model. To use this functionality, you will need to set either the `<package_name>_union_schemas` OR `<package_name>_union_databases` variables (cannot do both) in your root `dbt_project.yml` file. Below are the variables and examples for each connection:

```yml
vars:
Expand All @@ -135,7 +143,8 @@ vars:
To connect your multiple schema/database sources to the package models, follow the steps outlined in the [Union Data Defined Sources Configuration](https://github.com/fivetran/dbt_fivetran_utils/tree/releases/v0.4.latest#union_data-source) section of the Fivetran Utils documentation for the union_data macro. This will ensure a proper configuration and correct visualization of connections in the DAG.

#### Change the source table references
If an individual source table has a different name than the package expects, add the table name as it appears in your destination to the respective variable:
If an individual source table has a different name than the package expects, add the table name as it appears in your destination to the respective variable. This is not available when running the package on multiple unioned connections.

> IMPORTANT: See the Apple Store [`dbt_project.yml`](https://github.com/fivetran/dbt_apple_store_source/blob/main/dbt_project.yml) and Google Play [`dbt_project.yml`](https://github.com/fivetran/dbt_google_play_source/blob/main/dbt_project.yml) variable declarations to see the expected names.

```yml
Expand Down
10 changes: 5 additions & 5 deletions integration_tests/ci/sample.profiles.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,13 @@ integration_tests:
pass: "{{ env_var('CI_REDSHIFT_DBT_PASS') }}"
dbname: "{{ env_var('CI_REDSHIFT_DBT_DBNAME') }}"
port: 5439
schema: app_reporting_integrations_test_5
schema: app_reporting_integrations_test_6
threads: 8
bigquery:
type: bigquery
method: service-account-json
project: 'dbt-package-testing'
schema: app_reporting_integrations_test_5
schema: app_reporting_integrations_test_6
threads: 8
keyfile_json: "{{ env_var('GCLOUD_SERVICE_KEY') | as_native }}"
snowflake:
Expand All @@ -33,7 +33,7 @@ integration_tests:
role: "{{ env_var('CI_SNOWFLAKE_DBT_ROLE') }}"
database: "{{ env_var('CI_SNOWFLAKE_DBT_DATABASE') }}"
warehouse: "{{ env_var('CI_SNOWFLAKE_DBT_WAREHOUSE') }}"
schema: app_reporting_integrations_test_5
schema: app_reporting_integrations_test_6
threads: 8
postgres:
type: postgres
Expand All @@ -42,13 +42,13 @@ integration_tests:
pass: "{{ env_var('CI_POSTGRES_DBT_PASS') }}"
dbname: "{{ env_var('CI_POSTGRES_DBT_DBNAME') }}"
port: 5432
schema: app_reporting_integrations_test_5
schema: app_reporting_integrations_test_6
threads: 8
databricks:
catalog: "{{ env_var('CI_DATABRICKS_DBT_CATALOG') }}"
host: "{{ env_var('CI_DATABRICKS_DBT_HOST') }}"
http_path: "{{ env_var('CI_DATABRICKS_DBT_HTTP_PATH') }}"
schema: app_reporting_integrations_test_5
schema: app_reporting_integrations_test_6
threads: 8
token: "{{ env_var('CI_DATABRICKS_DBT_TOKEN') }}"
type: databricks
4 changes: 2 additions & 2 deletions integration_tests/dbt_project.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ vars:
# apple_store__using_subscriptions: true # uncomment this line when generating docs!
# google_play__using_subscriptions: true # uncomment this line when regenerating docs!
# google_play__using_earnings: true # uncomment this line when regenerating docs!
google_play_schema: app_reporting_integrations_test_5
apple_store_schema: app_reporting_integrations_test_5
google_play_schema: app_reporting_integrations_test_6
apple_store_schema: app_reporting_integrations_test_6
google_play_source:
google_play_stats_installs_app_version_identifier: "stats_installs_app_version"
google_play_stats_crashes_app_version_identifier: "stats_crashes_app_version"
Expand Down
Loading