Skip to content

Commit 748533f

Browse files
fivetran-data-model-botfivetran-catfritzfivetran-avinashgithub-actions[bot]
authored
Consolidate source + remove tests (#41)
* Consolidate dbt source into transform * Q2 FY26 Automatic Package Updates (#37) * Q2 FY26: Apply automated update. * Q2 FY26: Update auto-release workflow only. --------- Co-authored-by: fivetran-catfritz <111930712+fivetran-catfritz@users.noreply.github.com> Co-authored-by: Avinash Kunnath <108772760+fivetran-avinash@users.noreply.github.com> * dbt_project.yml + seed file additions + schema updates + documentation * Apply PR changes * Generate dbt docs via GitHub Actions --------- Co-authored-by: fivetran-catfritz <111930712+fivetran-catfritz@users.noreply.github.com> Co-authored-by: Avinash Kunnath <108772760+fivetran-avinash@users.noreply.github.com> Co-authored-by: Avinash Kunnath <avinash.kunnath@fivetran.com> Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
1 parent 84cf337 commit 748533f

64 files changed

Lines changed: 2135 additions & 130 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.buildkite/scripts/run_models.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ db=$1
1616
echo `pwd`
1717
cd integration_tests
1818
dbt deps
19-
dbt source freshness --target "$db" || echo "...Only verifying freshness runs…"
2019
dbt seed --target "$db" --full-refresh
20+
dbt source freshness --target "$db" || echo "...Only verifying freshness runs…"
2121
dbt run --target "$db" --full-refresh
2222
dbt test --target "$db"
2323
dbt run --vars '{apple_store__using_subscriptions: true}' --target "$db" --full-refresh

.github/PULL_REQUEST_TEMPLATE/maintainer_pull_request_template.md

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,15 @@ Before marking this PR as "ready for review":
1212

1313
## PR Overview
1414
**Package version introduced in this PR:**
15-
15+
-
16+
1617
**This PR addresses the following Issue/Feature(s):**
1718
<!-- Add Issue # or internal ticket reference -->
19+
-
1820

1921
**Summary of changes:**
2022
<!-- 1-2 sentences describing PR changes. -->
21-
23+
-
2224

2325
### Submission Checklist
2426
- [ ] Alignment meeting with the reviewer (if needed)
@@ -27,9 +29,10 @@ Before marking this PR as "ready for review":
2729
- [ ] **Validation Steps:** Check for unintentional effects (e.g., add/run consistency & integrity tests)
2830
- [ ] **Testing Instructions:** Confirm the change addresses the issue(s)
2931
- [ ] **Focus Areas:** Complex logic or queries that need extra attention
32+
- [ ] Merge any relevant open PRs into this PR
3033

3134
### Changelog
3235
<!-- Recommend drafting changelog notes, then refining via ChatGPT using:
3336
"Draft a changelog entry based on the following notes." -->
3437
- [ ] Draft changelog for PR
35-
- [ ] Final changelog for release review
38+
- [ ] Final changelog for release review

.github/workflows/auto-release.yml

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,12 @@ on:
33
pull_request:
44
types:
55
- closed
6-
branches:
7-
- main
6+
- labeled
87

98
jobs:
10-
call-workflow-passing-data:
11-
if: github.event.pull_request.merged
9+
release:
10+
if: |
11+
(github.event.pull_request.merged == true && github.event.pull_request.base.ref == 'main') ||
12+
github.event.label.name == 'pre-release'
1213
uses: fivetran/dbt_package_automations/.github/workflows/auto-release.yml@main
13-
secrets: inherit
14+
secrets: inherit
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
name: 'generate dbt docs'
2+
on:
3+
pull_request:
4+
types:
5+
- labeled
6+
7+
jobs:
8+
generate-docs:
9+
if: github.event.label.name == 'docs:ready'
10+
uses: fivetran/dbt_package_automations/.github/workflows/generate-docs.yml@main
11+
secrets: inherit
12+
with:
13+
schema_var_name: apple_store_schema

.gitignore

Lines changed: 71 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,73 @@
1-
2-
target/
1+
# dbt
2+
**/package-lock.yml
3+
package-lock.yml
4+
.dbt/
5+
dbt_modules/
36
dbt_packages/
47
logs/
5-
package-lock.yml
6-
env/
8+
profiles.yml
9+
target/
10+
*.log
11+
12+
# IDE files
13+
.idea/
14+
.vscode/
15+
*~
16+
*.swp
17+
*.swo
18+
19+
# Jupyter Notebook
20+
.ipynb_checkpoints
21+
22+
# OS generated files
23+
**/.DS_Store
24+
.DS_Store
25+
.Spotlight-V100
26+
.Trashes
27+
._*
28+
Thumbs.db
29+
ehthumbs.db
30+
31+
# Python
32+
*.egg
33+
*.egg-info/
34+
*.py[cod]
35+
*.so
36+
*$py.class
37+
.Python
38+
__pycache__/
39+
build/
40+
develop-eggs/
41+
dist/
42+
downloads/
43+
eggs/
44+
.env
45+
.installed.cfg
46+
lib/
47+
lib64/
48+
MANIFEST
49+
parts/
50+
sdist/
51+
var/
52+
wheels/
53+
54+
# Secrets and credentials
55+
.env.*
56+
.secrets
57+
credentials.json
58+
service-account.json
59+
60+
# Temporary files
61+
.cache/
62+
*.temp
63+
*.tmp
64+
65+
# Virtual environments
66+
.conda/
67+
.env
68+
.venv
69+
ENV/
70+
env/
71+
env.bak/
72+
venv/
73+
venv.bak/

CHANGELOG.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,26 @@
1+
# dbt_apple_store v1.0.0
2+
[PR #41](https://github.com/fivetran/dbt_apple_store/pull/41) includes the following updates:
3+
4+
## Breaking Changes
5+
6+
### Source Package Consolidation
7+
- Removed the dependency on the `fivetran/apple_store_source` package.
8+
- All functionality from the source package has been merged into this transformation package for improved maintainability and clarity.
9+
- If you reference `fivetran/apple_store_source` in your `packages.yml`, you must remove this dependency to avoid conflicts.
10+
- Any source overrides referencing the `fivetran/apple_store_source` package will also need to be removed or updated to reference this package.
11+
- Update any apple_store_source-scoped variables to be scoped to only under this package. See the [README](https://github.com/fivetran/dbt_apple_store/blob/main/README.md) for how to configure the build schema of staging models.
12+
- As part of the consolidation, vars are no longer used to reference staging models, and only sources are represented by vars. Staging models are now referenced directly with `ref()` in downstream models.
13+
14+
### dbt Fusion Compatibility Updates
15+
- Updated package to maintain compatibility with dbt-core versions both before and after v1.10.6, which introduced a breaking change to multi-argument test syntax (e.g., `unique_combination_of_columns`).
16+
- Temporarily removed unsupported tests to avoid errors and ensure smoother upgrades across different dbt-core versions. These tests will be reintroduced once a safe migration path is available.
17+
- Removed all `dbt_utils.unique_combination_of_columns` tests.
18+
- Moved `loaded_at_field: _fivetran_synced` under the `config:` block in `src_apple_store.yml`.
19+
20+
### Under the Hood
21+
- Updated conditions in `.github/workflows/auto-release.yml`.
22+
- Added `.github/workflows/generate-docs.yml`.
23+
124
# dbt_apple_store v0.6.0
225
[PR #36](https://github.com/fivetran/dbt_apple_store/pull/36) includes the following updates:
326

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@
186186
same "printed page" as the copyright notice for easier
187187
identification within third-party archives.
188188

189-
Copyright [yyyy] [name of copyright owner]
189+
Copyright © 2025 Fivetran Inc.
190190

191191
Licensed under the Apache License, Version 2.0 (the "License");
192192
you may not use this file except in compliance with the License.

README.md

Lines changed: 19 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,22 @@
1-
# Apple App Store Transformation dbt Package ([Docs](https://fivetran.github.io/dbt_apple_store/))
1+
# Apple App Store dbt Package ([Docs](https://fivetran.github.io/dbt_apple_store/))
22

33
<p align="left">
44
<a alt="License"
55
href="https://github.com/fivetran/dbt_apple_store/blob/main/LICENSE">
66
<img src="https://img.shields.io/badge/License-Apache%202.0-blue.svg" /></a>
7-
<a alt="Fivetran-Release"
8-
href="https://fivetran.com/docs/getting-started/core-concepts#releasephases">
9-
<img src="https://img.shields.io/badge/Fivetran Release Phase-_Beta-orange.svg" /></a>
107
<a alt="dbt-core">
118
<img src="https://img.shields.io/badge/dbt_Core™_version->=1.3.0_,<2.0.0-orange.svg" /></a>
129
<a alt="Maintained?">
1310
<img src="https://img.shields.io/badge/Maintained%3F-yes-green.svg" /></a>
1411
<a alt="PRs">
1512
<img src="https://img.shields.io/badge/Contributions-welcome-blueviolet" /></a>
13+
<a alt="Fivetran Quickstart Compatible"
14+
href="https://fivetran.com/docs/transformations/dbt/quickstart">
15+
<img src="https://img.shields.io/badge/Fivetran_Quickstart_Compatible%3F-yes-green.svg" /></a>
1616
</p>
1717

1818
## What does this dbt package do?
19-
- Produces modeled tables that leverage Apple App Store data from [Fivetran's connector](https://fivetran.com/docs/connectors/applications/apple-app-store) in the format described by [this ERD](https://fivetran.com/docs/connectors/applications/apple-app-store#salesandfinancereportschema) and build off the output of our [Apple App Store source package](https://github.com/fivetran/dbt_apple_store_source).
19+
- Produces modeled tables that leverage Apple App Store data from [Fivetran's connector](https://fivetran.com/docs/connectors/applications/apple-app-store) in the format described by [this ERD](https://fivetran.com/docs/connectors/applications/apple-app-store#salesandfinancereportschema).
2020
- Enables you to better understand your Apple App Store metrics at different granularities. It achieves this by:
2121
- Providing intuitive reporting at the App Version, Platform Version, Device, Source Type, Territory, Subscription and Overview levels
2222
- Aggregates all relevant application metrics into each of the reporting levels above
@@ -55,11 +55,10 @@ Include the following apple_store package version in your `packages.yml` file:
5555
```yaml
5656
packages:
5757
- package: fivetran/apple_store
58-
version: [">=0.6.0", "<0.7.0"]
58+
version: [">=1.0.0", "<1.1.0"]
5959
```
6060
61-
Do NOT include the `apple_store_source` package in this file. The transformation package itself has a dependency on it and will install the source package as well.
62-
61+
> All required sources and staging models are now bundled into this transformation package. Do not include `fivetran/apple_store_source` in your `packages.yml` since this package has been deprecated.
6362

6463
### Step 3: Define database and schema variables
6564
By default, this package runs using your destination and the `apple_store` schema. If this is not where your apple_store data is (for example, if your apple_store schema is named `apple_store_fivetran`), add the following configuration to your root `dbt_project.yml` file:
@@ -82,7 +81,7 @@ vars:
8281

8382
In order to map longform territory names to their ISO country codes, we have adapted the CSV from [lukes/ISO-3166-Countries-with-Regional-Codes](https://github.com/lukes/ISO-3166-Countries-with-Regional-Codes) to align with Apple's country output [format](https://developer.apple.com/help/app-store-connect/reference/app-store-localizations/).
8483

85-
You will need to `dbt seed` the `apple_store_country_codes` [file](https://github.com/fivetran/dbt_apple_store_source/blob/main/seeds/apple_store_country_codes.csv) just once.
84+
You will need to `dbt seed` the `apple_store_country_codes` [file](https://github.com/fivetran/dbt_apple_store/blob/main/seeds/apple_store_country_codes.csv) just once.
8685

8786
### (Optional) Step 6: Additional configurations
8887
<details open><summary>Expand/collapse configurations</summary>
@@ -112,20 +111,20 @@ By default, `Subscribe`, `Renew` and `Cancel` subscription events are included a
112111
```
113112

114113
#### Change the build schema
115-
By default, this package builds the apple_store staging models within a schema titled (`<target_schema>` + `_stg_apple_store`) and your apple_store modeling models within a schema titled (`<target_schema>` + `_apple_store`) in your destination. If this is not where you would like your apple_store data to be written to, add the following configuration to your root `dbt_project.yml` file:
114+
By default, this package builds the apple_store staging models within a schema titled (`<target_schema>` + `apple_store_source`) and your apple_store modeling models within a schema titled (`<target_schema>` + `_apple_store`) in your destination. If this is not where you would like your apple_store data to be written to, add the following configuration to your root `dbt_project.yml` file:
116115

117116
```yml
118117
models:
119-
apple_store_source:
120-
+schema: my_new_schema_name # leave blank for just the target_schema
121118
apple_store:
122-
+schema: my_new_schema_name # leave blank for just the target_schema
119+
+schema: my_new_schema_name # Leave +schema: blank to use the default target_schema.
120+
staging:
121+
+schema: my_new_schema_name # Leave +schema: blank to use the default target_schema.
123122
```
124-
123+
125124
#### Change the source table references
126125
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:
127126

128-
> IMPORTANT: See this project's [`dbt_project.yml`](https://github.com/fivetran/dbt_apple_store_source/blob/main/dbt_project.yml) variable declarations to see the expected names.
127+
> IMPORTANT: See this project's [`dbt_project.yml`](https://github.com/fivetran/dbt_apple_store/blob/main/dbt_project.yml) variable declarations to see the expected names.
129128

130129
```yml
131130
vars:
@@ -136,24 +135,24 @@ vars:
136135
### (Optional) Step 7: Orchestrate your models with Fivetran Transformations for dbt Core™
137136
<details><summary>Expand for details</summary>
138137
<br>
139-
138+
140139
Fivetran offers the ability for you to orchestrate your dbt project through [Fivetran Transformations for dbt Core™](https://fivetran.com/docs/transformations/dbt). Learn how to set up your project for orchestration through Fivetran in our [Transformations for dbt Core setup guides](https://fivetran.com/docs/transformations/dbt#setupguide).
141140
</details>
142141

143142
## Does this package have dependencies?
144143
This dbt package is dependent on the following dbt packages. These dependencies are installed by default within this package. For more information on the following packages, refer to the [dbt hub](https://hub.getdbt.com/) site.
145144
> IMPORTANT: If you have any of these dependent packages in your own `packages.yml` file, we highly recommend that you remove them from your root `packages.yml` to avoid package version conflicts.
146-
145+
147146
```yml
148147
packages:
149-
- package: fivetran/apple_store_source
150-
version: [">=0.6.0", "<0.7.0"]
151-
152148
- package: fivetran/fivetran_utils
153149
version: [">=0.4.0", "<0.5.0"]
154150
155151
- package: dbt-labs/dbt_utils
156152
version: [">=1.0.0", "<2.0.0"]
153+
154+
- package: dbt-labs/spark_utils
155+
version: [">=0.3.0", "<0.4.0"]
157156
```
158157
## How is this package maintained and can I contribute?
159158
### Package Maintenance

dbt_project.yml

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
11
name: 'apple_store'
2-
version: '0.6.0'
2+
version: '1.0.0'
33
config-version: 2
44
require-dbt-version: [">=1.3.0", "<2.0.0"]
55
vars:
66
apple_store:
7-
app_store_app: "{{ ref('stg_apple_store__app_store_app') }}"
8-
sales_account: "{{ ref('stg_apple_store__sales_account') }}"
9-
sales_subscription_events: "{{ ref('stg_apple_store__sales_subscription_events') }}"
10-
sales_subscription_summary: "{{ ref('stg_apple_store__sales_subscription_summary') }}"
7+
app_store_app: "{{ source('apple_store', 'app_store_app') }}"
8+
sales_account: "{{ source('apple_store', 'sales_account') }}"
9+
sales_subscription_events: "{{ source('apple_store', 'sales_subscription_events') }}"
10+
sales_subscription_summary: "{{ source('apple_store', 'sales_subscription_summary') }}"
1111
apple_store_country_codes: "{{ ref('apple_store_country_codes') }}"
12-
app_store_discovery_and_engagement_standard_daily: "{{ ref('stg_apple_store__app_store_discovery_and_engagement_daily')}}"
13-
app_crash_daily: "{{ ref('stg_apple_store__app_crash_daily')}}"
14-
app_store_download_standard_daily: "{{ ref('stg_apple_store__app_store_download_daily')}}"
15-
app_session_standard_daily: "{{ ref('stg_apple_store__app_session_daily')}}"
16-
app_store_installation_and_deletion_standard_daily: "{{ ref('stg_apple_store__app_store_installation_and_deletion_daily')}}"
12+
app_store_discovery_and_engagement_standard_daily: "{{ source('apple_store', 'app_store_discovery_and_engagement_daily')}}"
13+
app_crash_daily: "{{ source('apple_store', 'app_crash_daily')}}"
14+
app_store_download_standard_daily: "{{ source('apple_store', 'app_store_download_daily')}}"
15+
app_session_standard_daily: "{{ source('apple_store', 'app_session_daily')}}"
16+
app_store_installation_and_deletion_standard_daily: "{{ source('apple_store', 'app_store_installation_and_deletion_daily')}}"
1717
apple_store__subscription_events:
1818
- 'Renew'
1919
- 'Cancel'
@@ -27,3 +27,8 @@ models:
2727
+materialized: ephemeral
2828
reporting_grain:
2929
+materialized: table
30+
staging:
31+
+materialized: table
32+
+schema: apple_store_source
33+
tmp:
34+
+materialized: view

docs/catalog.json

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)