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 tag and task_tag variable configs #37

Merged
merged 14 commits into from
Feb 18, 2025
2 changes: 2 additions & 0 deletions .buildkite/scripts/run_models.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,7 @@ dbt deps
dbt seed --target "$db" --full-refresh
dbt run --target "$db" --full-refresh
dbt test --target "$db"
dbt run --vars '{asana__using_tags: false, asana__using_task_tags: false, asana_tag_identifier: missing, asana_task_tag_identifier: missing}' --target "$db" --full-refresh
dbt test --target "$db"

dbt run-operation fivetran_utils.drop_schemas_automation --target "$db"
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,6 @@ target/
dbt_modules/
logs/
.DS_Store
dbt_packages/
dbt_packages/
env/
package-lock.yml
11 changes: 10 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,16 @@
# dbt_asana_source version.version
# dbt_asana_source v0.8.1
This release introduces the following updates.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
This release introduces the following updates.
This release introduces the following updates:


## Feature Updates
- Introduces variables `asana__using_tags` and `asana__using_task_tags` to disable the `stg_asana__tag` and `stg_asana__task_tag` models respectively. This allows the downstream models to run even if the respective source `tag` and `task_tag` tables don't exist. ([#37](https://github.com/fivetran/dbt_asana_source/pull/37))
- For more information on how to configure these variables, refer to the [README](https://github.com/fivetran/dbt_asana_source/blob/main/README.md#step-4-enablingdisabling-models).

## Under the Hood
- Added False configurations for `asana__using_tags` and `asana__using_task_tags` to our Buildkite `run_models.sh` script. ([#37](https://github.com/fivetran/dbt_asana_source/pull/37))

## Documentation
- Corrected references to connectors and connections in the README. ([#36](https://github.com/fivetran/dbt_asana_source/pull/36))
- Updated `src_asana.yml` with the above variable configurations to the source tables `tag` and `task_tag`. ([#37](https://github.com/fivetran/dbt_asana_source/pull/37))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would put this in Under the hood since it is functional.


# dbt_asana_source v0.8.0
## 🎉 Feature Update 🎉
Expand Down
17 changes: 15 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,20 @@ vars:
asana_database: your_database_name
asana_schema: your_schema_name
```
### (Optional) Step 4: Additional configurations

### Step 4: Enabling/Disabling Models

Your Asana connection might not sync every table that this package expects. If your syncs exclude certain tables, it is either because you do not use that functionality in Asana or have actively excluded some tables from your syncs. In order to enable or disable the relevant tables in the package, you will need to add the following variable(s) to your `dbt_project.yml` file.

By default, all variables are assumed to be `true`.

```yml
vars:
asana__using_tags: false # default is true
asana__using_task_tags: false # default is true
```

### (Optional) Step 5: Additional configurations
<details><summary>Expand for configurations</summary>

#### Passing Through Additional Columns
Expand Down Expand Up @@ -80,7 +93,7 @@ vars:

</details>

### (Optional) Step 5: Orchestrate your models with Fivetran Transformations for dbt Core™
### (Optional) Step 6: Orchestrate your models with Fivetran Transformations for dbt Core™
<details><summary>Expand for more details</summary>

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).
Expand Down
2 changes: 1 addition & 1 deletion dbt_project.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
config-version: 2
name: 'asana_source'
version: 0.8.0
version: 0.8.1
require-dbt-version: [">=1.3.0", "<2.0.0"]
models:
asana_source:
Expand Down
2 changes: 1 addition & 1 deletion docs/catalog.json

Large diffs are not rendered by default.

274 changes: 211 additions & 63 deletions docs/index.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/manifest.json

Large diffs are not rendered by default.

1 change: 0 additions & 1 deletion docs/run_results.json

This file was deleted.

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: asana_source_integrations_tests_02
schema: asana_source_integrations_tests_3
threads: 8
bigquery:
type: bigquery
method: service-account-json
project: 'dbt-package-testing'
schema: asana_source_integrations_tests_02
schema: asana_source_integrations_tests_3
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: asana_source_integrations_tests_02
schema: asana_source_integrations_tests_3
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: asana_source_integrations_tests_02
schema: asana_source_integrations_tests_3
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: asana_source_integrations_tests_02
schema: asana_source_integrations_tests_3
threads: 8
token: "{{ env_var('CI_DATABRICKS_DBT_TOKEN') }}"
type: databricks
5 changes: 3 additions & 2 deletions integration_tests/dbt_project.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
config-version: 2
name: 'asana_source_integration_tests'
version: 0.8.0
version: 0.8.1
profile: 'integration_tests'
vars:
asana_schema: asana_source_integrations_tests_02
asana_schema: asana_source_integrations_tests_3
asana_source:
asana_user_identifier: "user_data"
asana_project_identifier: "project_data"
Expand All @@ -16,6 +16,7 @@ vars:
asana_task_tag_identifier: "task_tag_data"
asana_section_identifier: "section_data"
asana_task_section_identifier: "task_section_data"

seeds:
+quote_columns: "{{ true if target.type == 'redshift' else false }}"
asana_source_integration_tests:
Expand Down
4 changes: 4 additions & 0 deletions models/src_asana.yml
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,8 @@ sources:
- name: tag
identifier: "{{ var('asana_tag_identifier', 'tag')}}"
description: Table of the custom tags made in the organization
config:
enabled: "{{ var('asana__using_tags', True) }}" # Disable if asana__using_tags is False
freshness: null
columns:
- name: id
Expand Down Expand Up @@ -185,6 +187,8 @@ sources:
- name: task_tag
identifier: "{{ var('asana_task_tag_identifier', 'task_tag')}}"
description: Table of tasks with the tags attached to them. Tasks without tags (and vice versa) do not appear here.
config:
enabled: "{{ var('asana__using_task_tags', True) }}" # Disable if asana__using_task_tags is False
freshness: null
columns:
- name: task_id
Expand Down
5 changes: 0 additions & 5 deletions models/stg_asana.yml
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,6 @@ models:
description: System generated unique ID of the tag
tests:
- unique
- not_null
- name: tag_name
description: User-facing name of the tag.
- name: created_at
Expand Down Expand Up @@ -162,12 +161,8 @@ models:
columns:
- name: tag_id
description: Foreign key referencing the ID of the TAG attached to the task
tests:
- not_null
- name: task_id
description: Foreign key referencing the ID of the TASK
tests:
- not_null

- name: stg_asana__team
description: Table of the teams within the organization
Expand Down
3 changes: 2 additions & 1 deletion models/stg_asana__tag.sql
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{{ config(enabled=var('asana__using_tags', True)) }}

with base as (

Expand Down Expand Up @@ -30,4 +31,4 @@ final as (
)

select *
from final
from final
3 changes: 2 additions & 1 deletion models/stg_asana__task_tag.sql
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{{ config(enabled=var('asana__using_task_tags', True)) }}

with base as (

Expand Down Expand Up @@ -28,4 +29,4 @@ final as (
)

select *
from final
from final
4 changes: 3 additions & 1 deletion models/tmp/stg_asana__tag_tmp.sql
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
{{ config(enabled=var('asana__using_tags', True)) }}

select *
from {{ var('tag') }}
from {{ var('tag') }}
4 changes: 3 additions & 1 deletion models/tmp/stg_asana__task_tag_tmp.sql
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
{{ config(enabled=var('asana__using_task_tags', True)) }}

select *
from {{ var('task_tag') }}
from {{ var('task_tag') }}