diff --git a/.buildkite/hooks/pre-command b/.buildkite/hooks/pre-command new file mode 100644 index 0000000..04c85c0 --- /dev/null +++ b/.buildkite/hooks/pre-command @@ -0,0 +1,24 @@ +#!/bin/bash + +set -e + +# Export secrets for Docker containers. +# Restrict exposing secrets only to the steps that need them +export GCLOUD_SERVICE_KEY=$(gcloud secrets versions access latest --secret="GCLOUD_SERVICE_KEY" --project="dbt-package-testing-363917") +export CI_POSTGRES_DBT_HOST=$(gcloud secrets versions access latest --secret="CI_POSTGRES_DBT_HOST" --project="dbt-package-testing-363917") +export CI_POSTGRES_DBT_USER=$(gcloud secrets versions access latest --secret="CI_POSTGRES_DBT_USER" --project="dbt-package-testing-363917") +export CI_POSTGRES_DBT_PASS=$(gcloud secrets versions access latest --secret="CI_POSTGRES_DBT_PASS" --project="dbt-package-testing-363917") +export CI_POSTGRES_DBT_DBNAME=$(gcloud secrets versions access latest --secret="CI_POSTGRES_DBT_DBNAME" --project="dbt-package-testing-363917") +export CI_REDSHIFT_DBT_DBNAME=$(gcloud secrets versions access latest --secret="CI_REDSHIFT_DBT_DBNAME" --project="dbt-package-testing-363917") +export CI_REDSHIFT_DBT_HOST=$(gcloud secrets versions access latest --secret="CI_REDSHIFT_DBT_HOST" --project="dbt-package-testing-363917") +export CI_REDSHIFT_DBT_PASS=$(gcloud secrets versions access latest --secret="CI_REDSHIFT_DBT_PASS" --project="dbt-package-testing-363917") +export CI_REDSHIFT_DBT_USER=$(gcloud secrets versions access latest --secret="CI_REDSHIFT_DBT_USER" --project="dbt-package-testing-363917") +export CI_SNOWFLAKE_DBT_ACCOUNT=$(gcloud secrets versions access latest --secret="CI_SNOWFLAKE_DBT_ACCOUNT" --project="dbt-package-testing-363917") +export CI_SNOWFLAKE_DBT_DATABASE=$(gcloud secrets versions access latest --secret="CI_SNOWFLAKE_DBT_DATABASE" --project="dbt-package-testing-363917") +export CI_SNOWFLAKE_DBT_PASS=$(gcloud secrets versions access latest --secret="CI_SNOWFLAKE_DBT_PASS" --project="dbt-package-testing-363917") +export CI_SNOWFLAKE_DBT_ROLE=$(gcloud secrets versions access latest --secret="CI_SNOWFLAKE_DBT_ROLE" --project="dbt-package-testing-363917") +export CI_SNOWFLAKE_DBT_USER=$(gcloud secrets versions access latest --secret="CI_SNOWFLAKE_DBT_USER" --project="dbt-package-testing-363917") +export CI_SNOWFLAKE_DBT_WAREHOUSE=$(gcloud secrets versions access latest --secret="CI_SNOWFLAKE_DBT_WAREHOUSE" --project="dbt-package-testing-363917") +export CI_DATABRICKS_DBT_HOST=$(gcloud secrets versions access latest --secret="CI_DATABRICKS_DBT_HOST" --project="dbt-package-testing-363917") +export CI_DATABRICKS_DBT_HTTP_PATH=$(gcloud secrets versions access latest --secret="CI_DATABRICKS_DBT_HTTP_PATH" --project="dbt-package-testing-363917") +export CI_DATABRICKS_DBT_TOKEN=$(gcloud secrets versions access latest --secret="CI_DATABRICKS_DBT_TOKEN" --project="dbt-package-testing-363917") \ No newline at end of file diff --git a/.buildkite/pipeline.yml b/.buildkite/pipeline.yml new file mode 100644 index 0000000..526c516 --- /dev/null +++ b/.buildkite/pipeline.yml @@ -0,0 +1,59 @@ +steps: + - label: ":postgres: Run Tests - Postgres" + key: "run-dbt-postgres" + plugins: + - docker#v3.13.0: + image: "python:3.8" + shell: [ "/bin/bash", "-e", "-c" ] + environment: + - "BASH_ENV=/tmp/.bashrc" + - "CI_POSTGRES_DBT_DBNAME" + - "CI_POSTGRES_DBT_HOST" + - "CI_POSTGRES_DBT_PASS" + - "CI_POSTGRES_DBT_USER" + commands: | + bash .buildkite/scripts/run_models.sh postgres + + - label: ":snowflake-db: Run Tests - Snowflake" + key: "run_dbt_snowflake" + plugins: + - docker#v3.13.0: + image: "python:3.8" + shell: [ "/bin/bash", "-e", "-c" ] + environment: + - "BASH_ENV=/tmp/.bashrc" + - "CI_SNOWFLAKE_DBT_ACCOUNT" + - "CI_SNOWFLAKE_DBT_DATABASE" + - "CI_SNOWFLAKE_DBT_PASS" + - "CI_SNOWFLAKE_DBT_ROLE" + - "CI_SNOWFLAKE_DBT_USER" + - "CI_SNOWFLAKE_DBT_WAREHOUSE" + commands: | + bash .buildkite/scripts/run_models.sh snowflake + + - label: ":gcloud: Run Tests - BigQuery" + key: "run_dbt_bigquery" + plugins: + - docker#v3.13.0: + image: "python:3.8" + shell: [ "/bin/bash", "-e", "-c" ] + environment: + - "BASH_ENV=/tmp/.bashrc" + - "GCLOUD_SERVICE_KEY" + commands: | + bash .buildkite/scripts/run_models.sh bigquery + + - label: ":amazon-redshift: Run Tests - Redshift" + key: "run_dbt_redshift" + plugins: + - docker#v3.13.0: + image: "python:3.8" + shell: [ "/bin/bash", "-e", "-c" ] + environment: + - "BASH_ENV=/tmp/.bashrc" + - "CI_REDSHIFT_DBT_DBNAME" + - "CI_REDSHIFT_DBT_HOST" + - "CI_REDSHIFT_DBT_PASS" + - "CI_REDSHIFT_DBT_USER" + commands: | + bash .buildkite/scripts/run_models.sh redshift diff --git a/.buildkite/scripts/run_models.sh b/.buildkite/scripts/run_models.sh new file mode 100644 index 0000000..9408f33 --- /dev/null +++ b/.buildkite/scripts/run_models.sh @@ -0,0 +1,21 @@ +#!/bin/bash + +set -euo pipefail + +apt-get update +apt-get install libsasl2-dev + +python3 -m venv venv +. venv/bin/activate +pip install --upgrade pip setuptools +pip install -r integration_tests/requirements.txt +mkdir -p ~/.dbt +cp integration_tests/ci/sample.profiles.yml ~/.dbt/profiles.yml + +db=$1 +echo `pwd` +cd integration_tests +dbt deps +dbt seed --target "$db" --full-refresh +dbt run --target "$db" --full-refresh +dbt test --target "$db" diff --git a/.circleci/config.yml b/.circleci/config.yml deleted file mode 100644 index a20989a..0000000 --- a/.circleci/config.yml +++ /dev/null @@ -1,71 +0,0 @@ -version: 2 - -jobs: - build: - docker: - - image: circleci/python:3.7.9-stretch - - steps: - - checkout - - - run: - run: setup_creds - command: | - echo $GCLOUD_SERVICE_KEY | base64 --decode --ignore-garbage > ${HOME}/gcloud-service-key.json - - run: - name: "Setup dbt" - command: | - sudo apt install libsasl2-dev - python3 -m venv venv - . venv/bin/activate - pip install --upgrade pip setuptools - pip install -r integration_tests/requirements.txt - mkdir -p ~/.dbt - cp integration_tests/ci/sample.profiles.yml ~/.dbt/profiles.yml - - run: - name: "Run Tests - Postgres" - command: | - . venv/bin/activate - echo `pwd` - cd integration_tests - dbt deps - dbt seed --target postgres --full-refresh - dbt run --target postgres --full-refresh - dbt test --target postgres - - run: - name: "Run Tests - Redshift" - command: | - . venv/bin/activate - echo `pwd` - cd integration_tests - dbt deps - dbt seed --target redshift --full-refresh - dbt run --target redshift --full-refresh - dbt test --target redshift - - run: - name: "Run Tests - Snowflake" - command: | - . venv/bin/activate - echo `pwd` - cd integration_tests - dbt deps - dbt seed --target snowflake --full-refresh - dbt run --target snowflake --full-refresh - dbt test --target snowflake - - run: - name: "Run Tests - BigQuery" - environment: - GCLOUD_SERVICE_KEY_PATH: "/home/circleci/gcloud-service-key.json" - - command: | - . venv/bin/activate - echo `pwd` - cd integration_tests - dbt deps - dbt seed --target bigquery --full-refresh - dbt run --target bigquery --full-refresh - dbt test --target bigquery - - save_cache: - key: deps2-{{ .Branch }} - paths: - - "venv" diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md index 35f658d..50ee0df 100644 --- a/.github/pull_request_template.md +++ b/.github/pull_request_template.md @@ -1,4 +1,3 @@ -Pull Request **Are you a current Fivetran customer?** @@ -29,9 +28,9 @@ Pull Request **How did you test the PR changes?** - + -- [ ] CircleCi +- [ ] Buildkite - [ ] Local (please provide additional testing details below) **Select which warehouse(s) were used to test the PR** diff --git a/CHANGELOG.md b/CHANGELOG.md index 2aad349..0d76620 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,43 @@ +# dbt_asana v0.7.0 + +## ๐Ÿšจ Breaking Changes ๐Ÿšจ: +[PR #23](https://github.com/fivetran/dbt_asana/pull/23) includes the following breaking changes: +- Dispatch update for dbt-utils to dbt-core cross-db macros migration. Specifically `{{ dbt_utils. }}` have been updated to `{{ dbt. }}` for the below macros: + - `any_value` + - `bool_or` + - `cast_bool_to_text` + - `concat` + - `date_trunc` + - `dateadd` + - `datediff` + - `escape_single_quotes` + - `except` + - `hash` + - `intersect` + - `last_day` + - `length` + - `listagg` + - `position` + - `replace` + - `right` + - `safe_cast` + - `split_part` + - `string_literal` + - `type_bigint` + - `type_float` + - `type_int` + - `type_numeric` + - `type_string` + - `type_timestamp` + - `array_append` + - `array_concat` + - `array_construct` +- For `current_timestamp` and `current_timestamp_in_utc` macros, the dispatch AND the macro names have been updated to the below, respectively: + - `dbt.current_timestamp_backcompat` + - `dbt.current_timestamp_in_utc_backcompat` +- `dbt_utils.surrogate_key` has also been updated to `dbt_utils.generate_surrogate_key`. Since the method for creating surrogate keys differ, we suggest all users do a `full-refresh` for the most accurate data. For more information, please refer to dbt-utils [release notes](https://github.com/dbt-labs/dbt-utils/releases) for this update. +- Dependencies on `fivetran/fivetran_utils` have been upgraded, previously `[">=0.3.0", "<0.4.0"]` now `[">=0.4.0", "<0.5.0"]`. + # dbt_asana v0.6.0 ๐Ÿ›  Deprecated columns fix ๐Ÿ›  ## ๐Ÿšจ Breaking Changes ๐Ÿšจ diff --git a/README.md b/README.md index d2a213f..2e822d2 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,7 @@ href="https://github.com/fivetran/dbt_asana_source/blob/main/LICENSE"> - + @@ -45,7 +45,7 @@ Include the following asana package version in your `packages.yml` file. ```yaml packages: - package: fivetran/asana - version: [">=0.6.0", "<0.7.0"] + version: [">=0.7.0", "<0.8.0"] ``` ## Step 3: Define database and schema variables @@ -109,13 +109,13 @@ This dbt package is dependent on the following dbt packages. Please be aware tha ```yml packages: - package: fivetran/asana_source - version: [">=0.6.0", "<0.7.0"] + version: [">=0.7.0", "<0.8.0"] - package: fivetran/fivetran_utils - version: [">=0.3.0", "<0.4.0"] + version: [">=0.4.0", "<0.5.0"] - package: dbt-labs/dbt_utils - version: [">=0.8.0", "<0.9.0"] + version: [">=1.0.0", "<2.0.0"] ``` # ๐Ÿ™Œ How is this package maintained and can I contribute? ## Package Maintenance diff --git a/dbt_project.yml b/dbt_project.yml index 3b59a28..0ca428c 100644 --- a/dbt_project.yml +++ b/dbt_project.yml @@ -1,17 +1,13 @@ config-version: 2 - name: 'asana' -version: '0.6.0' - -require-dbt-version: [">=1.0.0", "<2.0.0"] - +version: '0.7.0' +require-dbt-version: [">=1.3.0", "<2.0.0"] models: asana: +schema: asana +materialized: table intermediate: +materialized: ephemeral - vars: asana: project_task: "{{ ref('stg_asana__project_task') }}" diff --git a/docs/catalog.json b/docs/catalog.json index a562e4b..6697300 100644 --- a/docs/catalog.json +++ b/docs/catalog.json @@ -1 +1 @@ -{"metadata": {"dbt_schema_version": "https://schemas.getdbt.com/dbt/catalog/v1.json", "dbt_version": "1.2.0", "generated_at": "2022-09-19T15:40:23.792921Z", "invocation_id": "ca1d8c4c-7612-4d61-ac01-69647773b393", "env": {}}, "nodes": {"seed.asana_integration_tests.task_section_data": {"metadata": {"type": "table", "schema": "asana_source_integration_source", "name": "task_section_data", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"section_id": {"type": "INT64", "index": 1, "name": "section_id", "comment": null}, "task_id": {"type": "INT64", "index": 2, "name": "task_id", "comment": null}, "_fivetran_synced": {"type": "TIMESTAMP", "index": 3, "name": "_fivetran_synced", "comment": null}}, "stats": {"num_rows": {"id": "num_rows", "label": "# Rows", "value": 2.0, "include": true, "description": "Approximate count of rows in this table"}, "num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 48.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.asana_integration_tests.task_section_data"}, "seed.asana_integration_tests.tag_data": {"metadata": {"type": "table", "schema": "asana_source_integration_source", "name": "tag_data", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"id": {"type": "INT64", "index": 1, "name": "id", "comment": null}, "_fivetran_deleted": {"type": "BOOL", "index": 2, "name": "_fivetran_deleted", "comment": null}, "_fivetran_synced": {"type": "TIMESTAMP", "index": 3, "name": "_fivetran_synced", "comment": null}, "color": {"type": "INT64", "index": 4, "name": "color", "comment": null}, "created_at": {"type": "DATETIME", "index": 5, "name": "created_at", "comment": null}, "message": {"type": "INT64", "index": 6, "name": "message", "comment": null}, "name": {"type": "STRING", "index": 7, "name": "name", "comment": null}, "notes": {"type": "INT64", "index": 8, "name": "notes", "comment": null}, "workspace_id": {"type": "INT64", "index": 9, "name": "workspace_id", "comment": null}}, "stats": {"num_rows": {"id": "num_rows", "label": "# Rows", "value": 17.0, "include": true, "description": "Approximate count of rows in this table"}, "num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 1139.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.asana_integration_tests.tag_data"}, "seed.asana_integration_tests.project_task_data": {"metadata": {"type": "table", "schema": "asana_source_integration_source", "name": "project_task_data", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"project_id": {"type": "INT64", "index": 1, "name": "project_id", "comment": null}, "task_id": {"type": "INT64", "index": 2, "name": "task_id", "comment": null}, "_fivetran_synced": {"type": "TIMESTAMP", "index": 3, "name": "_fivetran_synced", "comment": null}}, "stats": {"num_rows": {"id": "num_rows", "label": "# Rows", "value": 2.0, "include": true, "description": "Approximate count of rows in this table"}, "num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 48.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.asana_integration_tests.project_task_data"}, "seed.asana_integration_tests.task_tag_data": {"metadata": {"type": "table", "schema": "asana_source_integration_source", "name": "task_tag_data", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"tag_id": {"type": "INT64", "index": 1, "name": "tag_id", "comment": null}, "task_id": {"type": "INT64", "index": 2, "name": "task_id", "comment": null}, "_fivetran_synced": {"type": "TIMESTAMP", "index": 3, "name": "_fivetran_synced", "comment": null}}, "stats": {"num_rows": {"id": "num_rows", "label": "# Rows", "value": 4.0, "include": true, "description": "Approximate count of rows in this table"}, "num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 96.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.asana_integration_tests.task_tag_data"}, "seed.asana_integration_tests.team_data": {"metadata": {"type": "table", "schema": "asana_source_integration_source", "name": "team_data", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"id": {"type": "INT64", "index": 1, "name": "id", "comment": null}, "_fivetran_deleted": {"type": "BOOL", "index": 2, "name": "_fivetran_deleted", "comment": null}, "_fivetran_synced": {"type": "TIMESTAMP", "index": 3, "name": "_fivetran_synced", "comment": null}, "name": {"type": "STRING", "index": 4, "name": "name", "comment": null}, "organization_id": {"type": "INT64", "index": 5, "name": "organization_id", "comment": null}}, "stats": {"num_rows": {"id": "num_rows", "label": "# Rows", "value": 25.0, "include": true, "description": "Approximate count of rows in this table"}, "num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 1475.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.asana_integration_tests.team_data"}, "seed.asana_integration_tests.project_data": {"metadata": {"type": "table", "schema": "asana_source_integration_source", "name": "project_data", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"id": {"type": "INT64", "index": 1, "name": "id", "comment": null}, "_fivetran_deleted": {"type": "BOOL", "index": 2, "name": "_fivetran_deleted", "comment": null}, "_fivetran_synced": {"type": "TIMESTAMP", "index": 3, "name": "_fivetran_synced", "comment": null}, "archived": {"type": "BOOL", "index": 4, "name": "archived", "comment": null}, "color": {"type": "STRING", "index": 5, "name": "color", "comment": null}, "created_at": {"type": "DATETIME", "index": 6, "name": "created_at", "comment": null}, "current_status": {"type": "STRING", "index": 7, "name": "current_status", "comment": null}, "due_date": {"type": "DATETIME", "index": 8, "name": "due_date", "comment": null}, "modified_at": {"type": "DATETIME", "index": 9, "name": "modified_at", "comment": null}, "name": {"type": "STRING", "index": 10, "name": "name", "comment": null}, "notes": {"type": "STRING", "index": 11, "name": "notes", "comment": null}, "owner_id": {"type": "INT64", "index": 12, "name": "owner_id", "comment": null}, "public": {"type": "INT64", "index": 13, "name": "public", "comment": null}, "team_id": {"type": "INT64", "index": 14, "name": "team_id", "comment": null}, "workspace_id": {"type": "INT64", "index": 15, "name": "workspace_id", "comment": null}}, "stats": {"num_rows": {"id": "num_rows", "label": "# Rows", "value": 16.0, "include": true, "description": "Approximate count of rows in this table"}, "num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 1710.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.asana_integration_tests.project_data"}, "seed.asana_integration_tests.task_follower_data": {"metadata": {"type": "table", "schema": "asana_source_integration_source", "name": "task_follower_data", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"task_id": {"type": "INT64", "index": 1, "name": "task_id", "comment": null}, "user_id": {"type": "INT64", "index": 2, "name": "user_id", "comment": null}, "_fivetran_synced": {"type": "TIMESTAMP", "index": 3, "name": "_fivetran_synced", "comment": null}}, "stats": {"num_rows": {"id": "num_rows", "label": "# Rows", "value": 1.0, "include": true, "description": "Approximate count of rows in this table"}, "num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 24.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.asana_integration_tests.task_follower_data"}, "seed.asana_integration_tests.story_data": {"metadata": {"type": "table", "schema": "asana_source_integration_source", "name": "story_data", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"id": {"type": "INT64", "index": 1, "name": "id", "comment": null}, "_fivetran_synced": {"type": "TIMESTAMP", "index": 2, "name": "_fivetran_synced", "comment": null}, "created_at": {"type": "DATETIME", "index": 3, "name": "created_at", "comment": null}, "created_by_id": {"type": "INT64", "index": 4, "name": "created_by_id", "comment": null}, "hearted": {"type": "INT64", "index": 5, "name": "hearted", "comment": null}, "num_hearts": {"type": "INT64", "index": 6, "name": "num_hearts", "comment": null}, "source": {"type": "STRING", "index": 7, "name": "source", "comment": null}, "target_id": {"type": "INT64", "index": 8, "name": "target_id", "comment": null}, "text": {"type": "STRING", "index": 9, "name": "text", "comment": null}, "type": {"type": "STRING", "index": 10, "name": "type", "comment": null}}, "stats": {"num_rows": {"id": "num_rows", "label": "# Rows", "value": 3.0, "include": true, "description": "Approximate count of rows in this table"}, "num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 285.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.asana_integration_tests.story_data"}, "seed.asana_integration_tests.task_data": {"metadata": {"type": "table", "schema": "asana_source_integration_source", "name": "task_data", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"id": {"type": "INT64", "index": 1, "name": "id", "comment": null}, "assignee_id": {"type": "INT64", "index": 2, "name": "assignee_id", "comment": null}, "completed": {"type": "BOOL", "index": 3, "name": "completed", "comment": null}, "completed_at": {"type": "TIMESTAMP", "index": 4, "name": "completed_at", "comment": null}, "completed_by_id": {"type": "INT64", "index": 5, "name": "completed_by_id", "comment": null}, "created_at": {"type": "TIMESTAMP", "index": 6, "name": "created_at", "comment": null}, "due_on": {"type": "TIMESTAMP", "index": 7, "name": "due_on", "comment": null}, "due_at": {"type": "TIMESTAMP", "index": 8, "name": "due_at", "comment": null}, "modified_at": {"type": "TIMESTAMP", "index": 9, "name": "modified_at", "comment": null}, "name": {"type": "STRING", "index": 10, "name": "name", "comment": null}, "parent_id": {"type": "INT64", "index": 11, "name": "parent_id", "comment": null}, "start_on": {"type": "TIMESTAMP", "index": 12, "name": "start_on", "comment": null}, "notes": {"type": "STRING", "index": 13, "name": "notes", "comment": null}, "workspace_id": {"type": "INT64", "index": 14, "name": "workspace_id", "comment": null}}, "stats": {"num_rows": {"id": "num_rows", "label": "# Rows", "value": 1.0, "include": true, "description": "Approximate count of rows in this table"}, "num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 80.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.asana_integration_tests.task_data"}, "seed.asana_integration_tests.user_data": {"metadata": {"type": "table", "schema": "asana_source_integration_source", "name": "user_data", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"id": {"type": "INT64", "index": 1, "name": "id", "comment": null}, "_fivetran_deleted": {"type": "BOOL", "index": 2, "name": "_fivetran_deleted", "comment": null}, "_fivetran_synced": {"type": "TIMESTAMP", "index": 3, "name": "_fivetran_synced", "comment": null}, "email": {"type": "STRING", "index": 4, "name": "email", "comment": null}, "name": {"type": "STRING", "index": 5, "name": "name", "comment": null}}, "stats": {"num_rows": {"id": "num_rows", "label": "# Rows", "value": 20.0, "include": true, "description": "Approximate count of rows in this table"}, "num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 1700.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.asana_integration_tests.user_data"}, "seed.asana_integration_tests.section_data": {"metadata": {"type": "table", "schema": "asana_source_integration_source", "name": "section_data", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"id": {"type": "INT64", "index": 1, "name": "id", "comment": null}, "_fivetran_synced": {"type": "TIMESTAMP", "index": 2, "name": "_fivetran_synced", "comment": null}, "created_at": {"type": "DATETIME", "index": 3, "name": "created_at", "comment": null}, "name": {"type": "STRING", "index": 4, "name": "name", "comment": null}, "project_id": {"type": "INT64", "index": 5, "name": "project_id", "comment": null}}, "stats": {"num_rows": {"id": "num_rows", "label": "# Rows", "value": 13.0, "include": true, "description": "Approximate count of rows in this table"}, "num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 858.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.asana_integration_tests.section_data"}, "model.asana_source.stg_asana__project": {"metadata": {"type": "table", "schema": "asana_source_integration_source_stg_asana", "name": "stg_asana__project", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"project_id": {"type": "INT64", "index": 1, "name": "project_id", "comment": null}, "is_archived": {"type": "BOOL", "index": 2, "name": "is_archived", "comment": null}, "created_at": {"type": "TIMESTAMP", "index": 3, "name": "created_at", "comment": null}, "current_status": {"type": "STRING", "index": 4, "name": "current_status", "comment": null}, "due_date": {"type": "TIMESTAMP", "index": 5, "name": "due_date", "comment": null}, "modified_at": {"type": "TIMESTAMP", "index": 6, "name": "modified_at", "comment": null}, "project_name": {"type": "STRING", "index": 7, "name": "project_name", "comment": null}, "owner_user_id": {"type": "INT64", "index": 8, "name": "owner_user_id", "comment": null}, "is_public": {"type": "INT64", "index": 9, "name": "is_public", "comment": null}, "team_id": {"type": "INT64", "index": 10, "name": "team_id", "comment": null}, "workspace_id": {"type": "INT64", "index": 11, "name": "workspace_id", "comment": null}, "notes": {"type": "STRING", "index": 12, "name": "notes", "comment": null}}, "stats": {"num_rows": {"id": "num_rows", "label": "# Rows", "value": 16.0, "include": true, "description": "Approximate count of rows in this table"}, "num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 1448.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.asana_source.stg_asana__project"}, "model.asana_source.stg_asana__task_tmp": {"metadata": {"type": "table", "schema": "asana_source_integration_source_stg_asana", "name": "stg_asana__task_tmp", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"id": {"type": "INT64", "index": 1, "name": "id", "comment": null}, "assignee_id": {"type": "INT64", "index": 2, "name": "assignee_id", "comment": null}, "completed": {"type": "BOOL", "index": 3, "name": "completed", "comment": null}, "completed_at": {"type": "TIMESTAMP", "index": 4, "name": "completed_at", "comment": null}, "completed_by_id": {"type": "INT64", "index": 5, "name": "completed_by_id", "comment": null}, "created_at": {"type": "TIMESTAMP", "index": 6, "name": "created_at", "comment": null}, "due_on": {"type": "TIMESTAMP", "index": 7, "name": "due_on", "comment": null}, "due_at": {"type": "TIMESTAMP", "index": 8, "name": "due_at", "comment": null}, "modified_at": {"type": "TIMESTAMP", "index": 9, "name": "modified_at", "comment": null}, "name": {"type": "STRING", "index": 10, "name": "name", "comment": null}, "parent_id": {"type": "INT64", "index": 11, "name": "parent_id", "comment": null}, "start_on": {"type": "TIMESTAMP", "index": 12, "name": "start_on", "comment": null}, "notes": {"type": "STRING", "index": 13, "name": "notes", "comment": null}, "workspace_id": {"type": "INT64", "index": 14, "name": "workspace_id", "comment": null}}, "stats": {"num_rows": {"id": "num_rows", "label": "# Rows", "value": 1.0, "include": true, "description": "Approximate count of rows in this table"}, "num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 80.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.asana_source.stg_asana__task_tmp"}, "model.asana_source.stg_asana__task_section": {"metadata": {"type": "table", "schema": "asana_source_integration_source_stg_asana", "name": "stg_asana__task_section", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"section_id": {"type": "INT64", "index": 1, "name": "section_id", "comment": null}, "task_id": {"type": "INT64", "index": 2, "name": "task_id", "comment": null}}, "stats": {"num_rows": {"id": "num_rows", "label": "# Rows", "value": 2.0, "include": true, "description": "Approximate count of rows in this table"}, "num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 32.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.asana_source.stg_asana__task_section"}, "model.asana_source.stg_asana__story_tmp": {"metadata": {"type": "table", "schema": "asana_source_integration_source_stg_asana", "name": "stg_asana__story_tmp", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"id": {"type": "INT64", "index": 1, "name": "id", "comment": null}, "_fivetran_synced": {"type": "TIMESTAMP", "index": 2, "name": "_fivetran_synced", "comment": null}, "created_at": {"type": "DATETIME", "index": 3, "name": "created_at", "comment": null}, "created_by_id": {"type": "INT64", "index": 4, "name": "created_by_id", "comment": null}, "hearted": {"type": "INT64", "index": 5, "name": "hearted", "comment": null}, "num_hearts": {"type": "INT64", "index": 6, "name": "num_hearts", "comment": null}, "source": {"type": "STRING", "index": 7, "name": "source", "comment": null}, "target_id": {"type": "INT64", "index": 8, "name": "target_id", "comment": null}, "text": {"type": "STRING", "index": 9, "name": "text", "comment": null}, "type": {"type": "STRING", "index": 10, "name": "type", "comment": null}}, "stats": {"num_rows": {"id": "num_rows", "label": "# Rows", "value": 3.0, "include": true, "description": "Approximate count of rows in this table"}, "num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 285.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.asana_source.stg_asana__story_tmp"}, "model.asana_source.stg_asana__team": {"metadata": {"type": "table", "schema": "asana_source_integration_source_stg_asana", "name": "stg_asana__team", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"team_id": {"type": "INT64", "index": 1, "name": "team_id", "comment": null}, "team_name": {"type": "STRING", "index": 2, "name": "team_name", "comment": null}}, "stats": {"num_rows": {"id": "num_rows", "label": "# Rows", "value": 25.0, "include": true, "description": "Approximate count of rows in this table"}, "num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 1050.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.asana_source.stg_asana__team"}, "model.asana_source.stg_asana__task": {"metadata": {"type": "table", "schema": "asana_source_integration_source_stg_asana", "name": "stg_asana__task", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"task_id": {"type": "INT64", "index": 1, "name": "task_id", "comment": null}, "assignee_user_id": {"type": "INT64", "index": 2, "name": "assignee_user_id", "comment": null}, "is_completed": {"type": "BOOL", "index": 3, "name": "is_completed", "comment": null}, "completed_at": {"type": "TIMESTAMP", "index": 4, "name": "completed_at", "comment": null}, "completed_by_user_id": {"type": "INT64", "index": 5, "name": "completed_by_user_id", "comment": null}, "created_at": {"type": "TIMESTAMP", "index": 6, "name": "created_at", "comment": null}, "due_date": {"type": "TIMESTAMP", "index": 7, "name": "due_date", "comment": null}, "modified_at": {"type": "TIMESTAMP", "index": 8, "name": "modified_at", "comment": null}, "task_name": {"type": "STRING", "index": 9, "name": "task_name", "comment": null}, "parent_task_id": {"type": "INT64", "index": 10, "name": "parent_task_id", "comment": null}, "start_date": {"type": "TIMESTAMP", "index": 11, "name": "start_date", "comment": null}, "task_description": {"type": "STRING", "index": 12, "name": "task_description", "comment": null}, "is_liked": {"type": "BOOL", "index": 13, "name": "is_liked", "comment": null}, "number_of_likes": {"type": "INT64", "index": 14, "name": "number_of_likes", "comment": null}, "workspace_id": {"type": "INT64", "index": 15, "name": "workspace_id", "comment": null}}, "stats": {"num_rows": {"id": "num_rows", "label": "# Rows", "value": 1.0, "include": true, "description": "Approximate count of rows in this table"}, "num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 80.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.asana_source.stg_asana__task"}, "model.asana_source.stg_asana__project_tmp": {"metadata": {"type": "table", "schema": "asana_source_integration_source_stg_asana", "name": "stg_asana__project_tmp", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"id": {"type": "INT64", "index": 1, "name": "id", "comment": null}, "_fivetran_deleted": {"type": "BOOL", "index": 2, "name": "_fivetran_deleted", "comment": null}, "_fivetran_synced": {"type": "TIMESTAMP", "index": 3, "name": "_fivetran_synced", "comment": null}, "archived": {"type": "BOOL", "index": 4, "name": "archived", "comment": null}, "color": {"type": "STRING", "index": 5, "name": "color", "comment": null}, "created_at": {"type": "DATETIME", "index": 6, "name": "created_at", "comment": null}, "current_status": {"type": "STRING", "index": 7, "name": "current_status", "comment": null}, "due_date": {"type": "DATETIME", "index": 8, "name": "due_date", "comment": null}, "modified_at": {"type": "DATETIME", "index": 9, "name": "modified_at", "comment": null}, "name": {"type": "STRING", "index": 10, "name": "name", "comment": null}, "notes": {"type": "STRING", "index": 11, "name": "notes", "comment": null}, "owner_id": {"type": "INT64", "index": 12, "name": "owner_id", "comment": null}, "public": {"type": "INT64", "index": 13, "name": "public", "comment": null}, "team_id": {"type": "INT64", "index": 14, "name": "team_id", "comment": null}, "workspace_id": {"type": "INT64", "index": 15, "name": "workspace_id", "comment": null}}, "stats": {"num_rows": {"id": "num_rows", "label": "# Rows", "value": 16.0, "include": true, "description": "Approximate count of rows in this table"}, "num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 1710.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.asana_source.stg_asana__project_tmp"}, "model.asana_source.stg_asana__story": {"metadata": {"type": "table", "schema": "asana_source_integration_source_stg_asana", "name": "stg_asana__story", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"story_id": {"type": "INT64", "index": 1, "name": "story_id", "comment": null}, "created_at": {"type": "TIMESTAMP", "index": 2, "name": "created_at", "comment": null}, "created_by_user_id": {"type": "INT64", "index": 3, "name": "created_by_user_id", "comment": null}, "target_task_id": {"type": "INT64", "index": 4, "name": "target_task_id", "comment": null}, "story_content": {"type": "STRING", "index": 5, "name": "story_content", "comment": null}, "event_type": {"type": "STRING", "index": 6, "name": "event_type", "comment": null}}, "stats": {"num_rows": {"id": "num_rows", "label": "# Rows", "value": 3.0, "include": true, "description": "Approximate count of rows in this table"}, "num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 222.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.asana_source.stg_asana__story"}, "model.asana_source.stg_asana__project_task": {"metadata": {"type": "table", "schema": "asana_source_integration_source_stg_asana", "name": "stg_asana__project_task", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"project_id": {"type": "INT64", "index": 1, "name": "project_id", "comment": null}, "task_id": {"type": "INT64", "index": 2, "name": "task_id", "comment": null}}, "stats": {"num_rows": {"id": "num_rows", "label": "# Rows", "value": 2.0, "include": true, "description": "Approximate count of rows in this table"}, "num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 32.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.asana_source.stg_asana__project_task"}, "model.asana_source.stg_asana__task_section_tmp": {"metadata": {"type": "table", "schema": "asana_source_integration_source_stg_asana", "name": "stg_asana__task_section_tmp", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"section_id": {"type": "INT64", "index": 1, "name": "section_id", "comment": null}, "task_id": {"type": "INT64", "index": 2, "name": "task_id", "comment": null}, "_fivetran_synced": {"type": "TIMESTAMP", "index": 3, "name": "_fivetran_synced", "comment": null}}, "stats": {"num_rows": {"id": "num_rows", "label": "# Rows", "value": 2.0, "include": true, "description": "Approximate count of rows in this table"}, "num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 48.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.asana_source.stg_asana__task_section_tmp"}, "model.asana_source.stg_asana__tag": {"metadata": {"type": "table", "schema": "asana_source_integration_source_stg_asana", "name": "stg_asana__tag", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"tag_id": {"type": "INT64", "index": 1, "name": "tag_id", "comment": null}, "tag_name": {"type": "STRING", "index": 2, "name": "tag_name", "comment": null}, "created_at": {"type": "TIMESTAMP", "index": 3, "name": "created_at", "comment": null}}, "stats": {"num_rows": {"id": "num_rows", "label": "# Rows", "value": 17.0, "include": true, "description": "Approximate count of rows in this table"}, "num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 850.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.asana_source.stg_asana__tag"}, "model.asana_source.stg_asana__tag_tmp": {"metadata": {"type": "table", "schema": "asana_source_integration_source_stg_asana", "name": "stg_asana__tag_tmp", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"id": {"type": "INT64", "index": 1, "name": "id", "comment": null}, "_fivetran_deleted": {"type": "BOOL", "index": 2, "name": "_fivetran_deleted", "comment": null}, "_fivetran_synced": {"type": "TIMESTAMP", "index": 3, "name": "_fivetran_synced", "comment": null}, "color": {"type": "INT64", "index": 4, "name": "color", "comment": null}, "created_at": {"type": "DATETIME", "index": 5, "name": "created_at", "comment": null}, "message": {"type": "INT64", "index": 6, "name": "message", "comment": null}, "name": {"type": "STRING", "index": 7, "name": "name", "comment": null}, "notes": {"type": "INT64", "index": 8, "name": "notes", "comment": null}, "workspace_id": {"type": "INT64", "index": 9, "name": "workspace_id", "comment": null}}, "stats": {"num_rows": {"id": "num_rows", "label": "# Rows", "value": 17.0, "include": true, "description": "Approximate count of rows in this table"}, "num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 1139.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.asana_source.stg_asana__tag_tmp"}, "model.asana_source.stg_asana__section_tmp": {"metadata": {"type": "table", "schema": "asana_source_integration_source_stg_asana", "name": "stg_asana__section_tmp", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"id": {"type": "INT64", "index": 1, "name": "id", "comment": null}, "_fivetran_synced": {"type": "TIMESTAMP", "index": 2, "name": "_fivetran_synced", "comment": null}, "created_at": {"type": "DATETIME", "index": 3, "name": "created_at", "comment": null}, "name": {"type": "STRING", "index": 4, "name": "name", "comment": null}, "project_id": {"type": "INT64", "index": 5, "name": "project_id", "comment": null}}, "stats": {"num_rows": {"id": "num_rows", "label": "# Rows", "value": 13.0, "include": true, "description": "Approximate count of rows in this table"}, "num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 858.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.asana_source.stg_asana__section_tmp"}, "model.asana_source.stg_asana__team_tmp": {"metadata": {"type": "table", "schema": "asana_source_integration_source_stg_asana", "name": "stg_asana__team_tmp", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"id": {"type": "INT64", "index": 1, "name": "id", "comment": null}, "_fivetran_deleted": {"type": "BOOL", "index": 2, "name": "_fivetran_deleted", "comment": null}, "_fivetran_synced": {"type": "TIMESTAMP", "index": 3, "name": "_fivetran_synced", "comment": null}, "name": {"type": "STRING", "index": 4, "name": "name", "comment": null}, "organization_id": {"type": "INT64", "index": 5, "name": "organization_id", "comment": null}}, "stats": {"num_rows": {"id": "num_rows", "label": "# Rows", "value": 25.0, "include": true, "description": "Approximate count of rows in this table"}, "num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 1475.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.asana_source.stg_asana__team_tmp"}, "model.asana_source.stg_asana__task_follower_tmp": {"metadata": {"type": "table", "schema": "asana_source_integration_source_stg_asana", "name": "stg_asana__task_follower_tmp", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"task_id": {"type": "INT64", "index": 1, "name": "task_id", "comment": null}, "user_id": {"type": "INT64", "index": 2, "name": "user_id", "comment": null}, "_fivetran_synced": {"type": "TIMESTAMP", "index": 3, "name": "_fivetran_synced", "comment": null}}, "stats": {"num_rows": {"id": "num_rows", "label": "# Rows", "value": 1.0, "include": true, "description": "Approximate count of rows in this table"}, "num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 24.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.asana_source.stg_asana__task_follower_tmp"}, "model.asana_source.stg_asana__user": {"metadata": {"type": "table", "schema": "asana_source_integration_source_stg_asana", "name": "stg_asana__user", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"user_id": {"type": "INT64", "index": 1, "name": "user_id", "comment": null}, "email": {"type": "STRING", "index": 2, "name": "email", "comment": null}, "user_name": {"type": "STRING", "index": 3, "name": "user_name", "comment": null}}, "stats": {"num_rows": {"id": "num_rows", "label": "# Rows", "value": 20.0, "include": true, "description": "Approximate count of rows in this table"}, "num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 1520.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.asana_source.stg_asana__user"}, "model.asana_source.stg_asana__user_tmp": {"metadata": {"type": "table", "schema": "asana_source_integration_source_stg_asana", "name": "stg_asana__user_tmp", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"id": {"type": "INT64", "index": 1, "name": "id", "comment": null}, "_fivetran_deleted": {"type": "BOOL", "index": 2, "name": "_fivetran_deleted", "comment": null}, "_fivetran_synced": {"type": "TIMESTAMP", "index": 3, "name": "_fivetran_synced", "comment": null}, "email": {"type": "STRING", "index": 4, "name": "email", "comment": null}, "name": {"type": "STRING", "index": 5, "name": "name", "comment": null}}, "stats": {"num_rows": {"id": "num_rows", "label": "# Rows", "value": 20.0, "include": true, "description": "Approximate count of rows in this table"}, "num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 1700.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.asana_source.stg_asana__user_tmp"}, "model.asana_source.stg_asana__project_task_tmp": {"metadata": {"type": "table", "schema": "asana_source_integration_source_stg_asana", "name": "stg_asana__project_task_tmp", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"project_id": {"type": "INT64", "index": 1, "name": "project_id", "comment": null}, "task_id": {"type": "INT64", "index": 2, "name": "task_id", "comment": null}, "_fivetran_synced": {"type": "TIMESTAMP", "index": 3, "name": "_fivetran_synced", "comment": null}}, "stats": {"num_rows": {"id": "num_rows", "label": "# Rows", "value": 2.0, "include": true, "description": "Approximate count of rows in this table"}, "num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 48.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.asana_source.stg_asana__project_task_tmp"}, "model.asana_source.stg_asana__task_tag": {"metadata": {"type": "table", "schema": "asana_source_integration_source_stg_asana", "name": "stg_asana__task_tag", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"tag_id": {"type": "INT64", "index": 1, "name": "tag_id", "comment": null}, "task_id": {"type": "INT64", "index": 2, "name": "task_id", "comment": null}}, "stats": {"num_rows": {"id": "num_rows", "label": "# Rows", "value": 4.0, "include": true, "description": "Approximate count of rows in this table"}, "num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 64.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.asana_source.stg_asana__task_tag"}, "model.asana_source.stg_asana__section": {"metadata": {"type": "table", "schema": "asana_source_integration_source_stg_asana", "name": "stg_asana__section", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"section_id": {"type": "INT64", "index": 1, "name": "section_id", "comment": null}, "created_at": {"type": "TIMESTAMP", "index": 2, "name": "created_at", "comment": null}, "section_name": {"type": "STRING", "index": 3, "name": "section_name", "comment": null}, "project_id": {"type": "INT64", "index": 4, "name": "project_id", "comment": null}}, "stats": {"num_rows": {"id": "num_rows", "label": "# Rows", "value": 13.0, "include": true, "description": "Approximate count of rows in this table"}, "num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 754.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.asana_source.stg_asana__section"}, "model.asana_source.stg_asana__task_follower": {"metadata": {"type": "table", "schema": "asana_source_integration_source_stg_asana", "name": "stg_asana__task_follower", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"task_id": {"type": "INT64", "index": 1, "name": "task_id", "comment": null}, "user_id": {"type": "INT64", "index": 2, "name": "user_id", "comment": null}}, "stats": {"num_rows": {"id": "num_rows", "label": "# Rows", "value": 1.0, "include": true, "description": "Approximate count of rows in this table"}, "num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 16.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.asana_source.stg_asana__task_follower"}, "model.asana_source.stg_asana__task_tag_tmp": {"metadata": {"type": "table", "schema": "asana_source_integration_source_stg_asana", "name": "stg_asana__task_tag_tmp", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"tag_id": {"type": "INT64", "index": 1, "name": "tag_id", "comment": null}, "task_id": {"type": "INT64", "index": 2, "name": "task_id", "comment": null}, "_fivetran_synced": {"type": "TIMESTAMP", "index": 3, "name": "_fivetran_synced", "comment": null}}, "stats": {"num_rows": {"id": "num_rows", "label": "# Rows", "value": 4.0, "include": true, "description": "Approximate count of rows in this table"}, "num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 96.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.asana_source.stg_asana__task_tag_tmp"}, "model.asana.asana__tag": {"metadata": {"type": "table", "schema": "asana_source_integration_source_asana", "name": "asana__tag", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"tag_id": {"type": "INT64", "index": 1, "name": "tag_id", "comment": null}, "tag_name": {"type": "STRING", "index": 2, "name": "tag_name", "comment": null}, "created_at": {"type": "TIMESTAMP", "index": 3, "name": "created_at", "comment": null}, "number_of_open_tasks": {"type": "INT64", "index": 4, "name": "number_of_open_tasks", "comment": null}, "number_of_assigned_open_tasks": {"type": "INT64", "index": 5, "name": "number_of_assigned_open_tasks", "comment": null}, "number_of_tasks_completed": {"type": "INT64", "index": 6, "name": "number_of_tasks_completed", "comment": null}, "avg_days_open": {"type": "FLOAT64", "index": 7, "name": "avg_days_open", "comment": null}, "avg_days_assigned": {"type": "FLOAT64", "index": 8, "name": "avg_days_assigned", "comment": null}}, "stats": {"num_rows": {"id": "num_rows", "label": "# Rows", "value": 17.0, "include": true, "description": "Approximate count of rows in this table"}, "num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 1258.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.asana.asana__tag"}, "model.asana.asana__task": {"metadata": {"type": "table", "schema": "asana_source_integration_source_asana", "name": "asana__task", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"task_id": {"type": "INT64", "index": 1, "name": "task_id", "comment": null}, "assignee_user_id": {"type": "INT64", "index": 2, "name": "assignee_user_id", "comment": null}, "is_completed": {"type": "BOOL", "index": 3, "name": "is_completed", "comment": null}, "completed_at": {"type": "TIMESTAMP", "index": 4, "name": "completed_at", "comment": null}, "completed_by_user_id": {"type": "INT64", "index": 5, "name": "completed_by_user_id", "comment": null}, "created_at": {"type": "TIMESTAMP", "index": 6, "name": "created_at", "comment": null}, "due_date": {"type": "TIMESTAMP", "index": 7, "name": "due_date", "comment": null}, "modified_at": {"type": "TIMESTAMP", "index": 8, "name": "modified_at", "comment": null}, "task_name": {"type": "STRING", "index": 9, "name": "task_name", "comment": null}, "parent_task_id": {"type": "INT64", "index": 10, "name": "parent_task_id", "comment": null}, "start_date": {"type": "TIMESTAMP", "index": 11, "name": "start_date", "comment": null}, "task_description": {"type": "STRING", "index": 12, "name": "task_description", "comment": null}, "is_liked": {"type": "BOOL", "index": 13, "name": "is_liked", "comment": null}, "number_of_likes": {"type": "INT64", "index": 14, "name": "number_of_likes", "comment": null}, "workspace_id": {"type": "INT64", "index": 15, "name": "workspace_id", "comment": null}, "task_link": {"type": "STRING", "index": 16, "name": "task_link", "comment": null}, "assignee_name": {"type": "STRING", "index": 17, "name": "assignee_name", "comment": null}, "assignee_email": {"type": "STRING", "index": 18, "name": "assignee_email", "comment": null}, "days_open": {"type": "INT64", "index": 19, "name": "days_open", "comment": null}, "is_currently_assigned": {"type": "BOOL", "index": 20, "name": "is_currently_assigned", "comment": null}, "has_been_assigned": {"type": "BOOL", "index": 21, "name": "has_been_assigned", "comment": null}, "days_since_last_assignment": {"type": "INT64", "index": 22, "name": "days_since_last_assignment", "comment": null}, "days_since_first_assignment": {"type": "INT64", "index": 23, "name": "days_since_first_assignment", "comment": null}, "last_assigned_at": {"type": "TIMESTAMP", "index": 24, "name": "last_assigned_at", "comment": null}, "first_assigned_at": {"type": "TIMESTAMP", "index": 25, "name": "first_assigned_at", "comment": null}, "first_modifier_user_id": {"type": "INT64", "index": 26, "name": "first_modifier_user_id", "comment": null}, "first_modifier_name": {"type": "STRING", "index": 27, "name": "first_modifier_name", "comment": null}, "conversation": {"type": "STRING", "index": 28, "name": "conversation", "comment": null}, "number_of_comments": {"type": "INT64", "index": 29, "name": "number_of_comments", "comment": null}, "followers": {"type": "STRING", "index": 30, "name": "followers", "comment": null}, "number_of_followers": {"type": "INT64", "index": 31, "name": "number_of_followers", "comment": null}, "tags": {"type": "STRING", "index": 32, "name": "tags", "comment": null}, "number_of_tags": {"type": "INT64", "index": 33, "name": "number_of_tags", "comment": null}, "projects_sections": {"type": "STRING", "index": 34, "name": "projects_sections", "comment": null}, "is_subtask": {"type": "BOOL", "index": 35, "name": "is_subtask", "comment": null}, "parent_task_name": {"type": "STRING", "index": 36, "name": "parent_task_name", "comment": null}, "parent_assignee_user_id": {"type": "INT64", "index": 37, "name": "parent_assignee_user_id", "comment": null}, "parent_assignee_name": {"type": "STRING", "index": 38, "name": "parent_assignee_name", "comment": null}, "parent_due_date": {"type": "TIMESTAMP", "index": 39, "name": "parent_due_date", "comment": null}, "parent_created_at": {"type": "TIMESTAMP", "index": 40, "name": "parent_created_at", "comment": null}}, "stats": {"num_rows": {"id": "num_rows", "label": "# Rows", "value": 1.0, "include": true, "description": "Approximate count of rows in this table"}, "num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 159.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.asana.asana__task"}, "model.asana.asana__user": {"metadata": {"type": "table", "schema": "asana_source_integration_source_asana", "name": "asana__user", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"user_id": {"type": "INT64", "index": 1, "name": "user_id", "comment": null}, "email": {"type": "STRING", "index": 2, "name": "email", "comment": null}, "user_name": {"type": "STRING", "index": 3, "name": "user_name", "comment": null}, "number_of_open_tasks": {"type": "INT64", "index": 4, "name": "number_of_open_tasks", "comment": null}, "number_of_tasks_completed": {"type": "INT64", "index": 5, "name": "number_of_tasks_completed", "comment": null}, "avg_close_time_days": {"type": "FLOAT64", "index": 6, "name": "avg_close_time_days", "comment": null}, "number_of_projects_owned": {"type": "INT64", "index": 7, "name": "number_of_projects_owned", "comment": null}, "number_of_projects_currently_assigned_to": {"type": "INT64", "index": 8, "name": "number_of_projects_currently_assigned_to", "comment": null}, "projects_working_on": {"type": "STRING", "index": 9, "name": "projects_working_on", "comment": null}}, "stats": {"num_rows": {"id": "num_rows", "label": "# Rows", "value": 20.0, "include": true, "description": "Approximate count of rows in this table"}, "num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 2160.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.asana.asana__user"}, "model.asana.asana__daily_metrics": {"metadata": {"type": "table", "schema": "asana_source_integration_source_asana", "name": "asana__daily_metrics", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"date_day": {"type": "DATETIME", "index": 1, "name": "date_day", "comment": null}, "number_of_tasks_open": {"type": "INT64", "index": 2, "name": "number_of_tasks_open", "comment": null}, "number_of_tasks_open_assigned": {"type": "INT64", "index": 3, "name": "number_of_tasks_open_assigned", "comment": null}, "number_of_tasks_created": {"type": "INT64", "index": 4, "name": "number_of_tasks_created", "comment": null}, "number_of_tasks_completed": {"type": "INT64", "index": 5, "name": "number_of_tasks_completed", "comment": null}, "avg_days_open": {"type": "FLOAT64", "index": 6, "name": "avg_days_open", "comment": null}, "avg_days_open_assigned": {"type": "FLOAT64", "index": 7, "name": "avg_days_open_assigned", "comment": null}}, "stats": {"num_rows": {"id": "num_rows", "label": "# Rows", "value": 1120.0, "include": true, "description": "Approximate count of rows in this table"}, "num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 44920.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.asana.asana__daily_metrics"}, "model.asana.asana__project": {"metadata": {"type": "table", "schema": "asana_source_integration_source_asana", "name": "asana__project", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"project_id": {"type": "INT64", "index": 1, "name": "project_id", "comment": null}, "project_name": {"type": "STRING", "index": 2, "name": "project_name", "comment": null}, "number_of_open_tasks": {"type": "INT64", "index": 3, "name": "number_of_open_tasks", "comment": null}, "number_of_assigned_open_tasks": {"type": "INT64", "index": 4, "name": "number_of_assigned_open_tasks", "comment": null}, "number_of_tasks_completed": {"type": "INT64", "index": 5, "name": "number_of_tasks_completed", "comment": null}, "avg_close_time_days": {"type": "FLOAT64", "index": 6, "name": "avg_close_time_days", "comment": null}, "avg_close_time_assigned_days": {"type": "FLOAT64", "index": 7, "name": "avg_close_time_assigned_days", "comment": null}, "project_link": {"type": "STRING", "index": 8, "name": "project_link", "comment": null}, "team_id": {"type": "INT64", "index": 9, "name": "team_id", "comment": null}, "team_name": {"type": "STRING", "index": 10, "name": "team_name", "comment": null}, "is_archived": {"type": "BOOL", "index": 11, "name": "is_archived", "comment": null}, "created_at": {"type": "TIMESTAMP", "index": 12, "name": "created_at", "comment": null}, "current_status": {"type": "STRING", "index": 13, "name": "current_status", "comment": null}, "due_date": {"type": "TIMESTAMP", "index": 14, "name": "due_date", "comment": null}, "last_modified_at": {"type": "TIMESTAMP", "index": 15, "name": "last_modified_at", "comment": null}, "owner_user_id": {"type": "INT64", "index": 16, "name": "owner_user_id", "comment": null}, "users_involved": {"type": "STRING", "index": 17, "name": "users_involved", "comment": null}, "number_of_users_involved": {"type": "INT64", "index": 18, "name": "number_of_users_involved", "comment": null}, "sections": {"type": "STRING", "index": 19, "name": "sections", "comment": null}, "notes": {"type": "STRING", "index": 20, "name": "notes", "comment": null}, "is_public": {"type": "INT64", "index": 21, "name": "is_public", "comment": null}}, "stats": {"num_rows": {"id": "num_rows", "label": "# Rows", "value": 16.0, "include": true, "description": "Approximate count of rows in this table"}, "num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 3304.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.asana.asana__project"}, "model.asana.asana__team": {"metadata": {"type": "table", "schema": "asana_source_integration_source_asana", "name": "asana__team", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"team_id": {"type": "INT64", "index": 1, "name": "team_id", "comment": null}, "team_name": {"type": "STRING", "index": 2, "name": "team_name", "comment": null}, "number_of_open_tasks": {"type": "INT64", "index": 3, "name": "number_of_open_tasks", "comment": null}, "number_of_assigned_open_tasks": {"type": "INT64", "index": 4, "name": "number_of_assigned_open_tasks", "comment": null}, "number_of_tasks_completed": {"type": "INT64", "index": 5, "name": "number_of_tasks_completed", "comment": null}, "avg_close_time_days": {"type": "FLOAT64", "index": 6, "name": "avg_close_time_days", "comment": null}, "avg_close_time_assigned_days": {"type": "FLOAT64", "index": 7, "name": "avg_close_time_assigned_days", "comment": null}, "number_of_active_projects": {"type": "INT64", "index": 8, "name": "number_of_active_projects", "comment": null}, "active_projects": {"type": "STRING", "index": 9, "name": "active_projects", "comment": null}, "number_of_archived_projects": {"type": "INT64", "index": 10, "name": "number_of_archived_projects", "comment": null}}, "stats": {"num_rows": {"id": "num_rows", "label": "# Rows", "value": 25.0, "include": true, "description": "Approximate count of rows in this table"}, "num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 2594.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.asana.asana__team"}}, "sources": {"source.asana_source.asana.task_follower": {"metadata": {"type": "table", "schema": "asana_integrations_tests", "name": "task_follower_data", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"task_id": {"type": "INT64", "index": 1, "name": "task_id", "comment": null}, "user_id": {"type": "INT64", "index": 2, "name": "user_id", "comment": null}, "_fivetran_synced": {"type": "TIMESTAMP", "index": 3, "name": "_fivetran_synced", "comment": null}}, "stats": {"num_rows": {"id": "num_rows", "label": "# Rows", "value": 1.0, "include": true, "description": "Approximate count of rows in this table"}, "num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 24.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.asana_source.asana.task_follower"}, "source.asana_source.asana.section": {"metadata": {"type": "table", "schema": "asana_integrations_tests", "name": "section_data", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"id": {"type": "INT64", "index": 1, "name": "id", "comment": null}, "_fivetran_synced": {"type": "TIMESTAMP", "index": 2, "name": "_fivetran_synced", "comment": null}, "created_at": {"type": "DATETIME", "index": 3, "name": "created_at", "comment": null}, "name": {"type": "STRING", "index": 4, "name": "name", "comment": null}, "project_id": {"type": "INT64", "index": 5, "name": "project_id", "comment": null}}, "stats": {"num_rows": {"id": "num_rows", "label": "# Rows", "value": 13.0, "include": true, "description": "Approximate count of rows in this table"}, "num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 858.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.asana_source.asana.section"}, "source.asana_source.asana.task_section": {"metadata": {"type": "table", "schema": "asana_integrations_tests", "name": "task_section_data", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"section_id": {"type": "INT64", "index": 1, "name": "section_id", "comment": null}, "task_id": {"type": "INT64", "index": 2, "name": "task_id", "comment": null}, "_fivetran_synced": {"type": "TIMESTAMP", "index": 3, "name": "_fivetran_synced", "comment": null}}, "stats": {"num_rows": {"id": "num_rows", "label": "# Rows", "value": 2.0, "include": true, "description": "Approximate count of rows in this table"}, "num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 48.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.asana_source.asana.task_section"}, "source.asana_source.asana.task_tag": {"metadata": {"type": "table", "schema": "asana_integrations_tests", "name": "task_tag_data", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"tag_id": {"type": "INT64", "index": 1, "name": "tag_id", "comment": null}, "task_id": {"type": "INT64", "index": 2, "name": "task_id", "comment": null}, "_fivetran_synced": {"type": "TIMESTAMP", "index": 3, "name": "_fivetran_synced", "comment": null}}, "stats": {"num_rows": {"id": "num_rows", "label": "# Rows", "value": 4.0, "include": true, "description": "Approximate count of rows in this table"}, "num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 96.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.asana_source.asana.task_tag"}, "source.asana_source.asana.story": {"metadata": {"type": "table", "schema": "asana_integrations_tests", "name": "story_data", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"id": {"type": "INT64", "index": 1, "name": "id", "comment": null}, "_fivetran_synced": {"type": "TIMESTAMP", "index": 2, "name": "_fivetran_synced", "comment": null}, "created_at": {"type": "DATETIME", "index": 3, "name": "created_at", "comment": null}, "created_by_id": {"type": "INT64", "index": 4, "name": "created_by_id", "comment": null}, "hearted": {"type": "INT64", "index": 5, "name": "hearted", "comment": null}, "num_hearts": {"type": "INT64", "index": 6, "name": "num_hearts", "comment": null}, "source": {"type": "STRING", "index": 7, "name": "source", "comment": null}, "target_id": {"type": "INT64", "index": 8, "name": "target_id", "comment": null}, "text": {"type": "STRING", "index": 9, "name": "text", "comment": null}, "type": {"type": "STRING", "index": 10, "name": "type", "comment": null}}, "stats": {"num_rows": {"id": "num_rows", "label": "# Rows", "value": 3.0, "include": true, "description": "Approximate count of rows in this table"}, "num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 285.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.asana_source.asana.story"}, "source.asana_source.asana.task": {"metadata": {"type": "table", "schema": "asana_integrations_tests", "name": "task_data", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"id": {"type": "INT64", "index": 1, "name": "id", "comment": null}, "assignee_id": {"type": "INT64", "index": 2, "name": "assignee_id", "comment": null}, "completed": {"type": "BOOL", "index": 3, "name": "completed", "comment": null}, "completed_at": {"type": "TIMESTAMP", "index": 4, "name": "completed_at", "comment": null}, "completed_by_id": {"type": "INT64", "index": 5, "name": "completed_by_id", "comment": null}, "created_at": {"type": "TIMESTAMP", "index": 6, "name": "created_at", "comment": null}, "due_on": {"type": "TIMESTAMP", "index": 7, "name": "due_on", "comment": null}, "due_at": {"type": "TIMESTAMP", "index": 8, "name": "due_at", "comment": null}, "modified_at": {"type": "TIMESTAMP", "index": 9, "name": "modified_at", "comment": null}, "name": {"type": "STRING", "index": 10, "name": "name", "comment": null}, "parent_id": {"type": "INT64", "index": 11, "name": "parent_id", "comment": null}, "start_on": {"type": "TIMESTAMP", "index": 12, "name": "start_on", "comment": null}, "notes": {"type": "STRING", "index": 13, "name": "notes", "comment": null}, "workspace_id": {"type": "INT64", "index": 14, "name": "workspace_id", "comment": null}}, "stats": {"num_rows": {"id": "num_rows", "label": "# Rows", "value": 1.0, "include": true, "description": "Approximate count of rows in this table"}, "num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 80.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.asana_source.asana.task"}, "source.asana_source.asana.project": {"metadata": {"type": "table", "schema": "asana_integrations_tests", "name": "project_data", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"id": {"type": "INT64", "index": 1, "name": "id", "comment": null}, "_fivetran_deleted": {"type": "BOOL", "index": 2, "name": "_fivetran_deleted", "comment": null}, "_fivetran_synced": {"type": "TIMESTAMP", "index": 3, "name": "_fivetran_synced", "comment": null}, "archived": {"type": "BOOL", "index": 4, "name": "archived", "comment": null}, "color": {"type": "STRING", "index": 5, "name": "color", "comment": null}, "created_at": {"type": "DATETIME", "index": 6, "name": "created_at", "comment": null}, "current_status": {"type": "STRING", "index": 7, "name": "current_status", "comment": null}, "due_date": {"type": "DATETIME", "index": 8, "name": "due_date", "comment": null}, "modified_at": {"type": "DATETIME", "index": 9, "name": "modified_at", "comment": null}, "name": {"type": "STRING", "index": 10, "name": "name", "comment": null}, "notes": {"type": "STRING", "index": 11, "name": "notes", "comment": null}, "owner_id": {"type": "INT64", "index": 12, "name": "owner_id", "comment": null}, "public": {"type": "INT64", "index": 13, "name": "public", "comment": null}, "team_id": {"type": "INT64", "index": 14, "name": "team_id", "comment": null}, "workspace_id": {"type": "INT64", "index": 15, "name": "workspace_id", "comment": null}}, "stats": {"num_rows": {"id": "num_rows", "label": "# Rows", "value": 16.0, "include": true, "description": "Approximate count of rows in this table"}, "num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 1710.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.asana_source.asana.project"}, "source.asana_source.asana.user": {"metadata": {"type": "table", "schema": "asana_integrations_tests", "name": "user_data", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"id": {"type": "INT64", "index": 1, "name": "id", "comment": null}, "_fivetran_deleted": {"type": "BOOL", "index": 2, "name": "_fivetran_deleted", "comment": null}, "_fivetran_synced": {"type": "TIMESTAMP", "index": 3, "name": "_fivetran_synced", "comment": null}, "email": {"type": "STRING", "index": 4, "name": "email", "comment": null}, "name": {"type": "STRING", "index": 5, "name": "name", "comment": null}}, "stats": {"num_rows": {"id": "num_rows", "label": "# Rows", "value": 20.0, "include": true, "description": "Approximate count of rows in this table"}, "num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 1700.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.asana_source.asana.user"}, "source.asana_source.asana.project_task": {"metadata": {"type": "table", "schema": "asana_integrations_tests", "name": "project_task_data", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"project_id": {"type": "INT64", "index": 1, "name": "project_id", "comment": null}, "task_id": {"type": "INT64", "index": 2, "name": "task_id", "comment": null}, "_fivetran_synced": {"type": "TIMESTAMP", "index": 3, "name": "_fivetran_synced", "comment": null}}, "stats": {"num_rows": {"id": "num_rows", "label": "# Rows", "value": 2.0, "include": true, "description": "Approximate count of rows in this table"}, "num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 48.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.asana_source.asana.project_task"}, "source.asana_source.asana.team": {"metadata": {"type": "table", "schema": "asana_integrations_tests", "name": "team_data", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"id": {"type": "INT64", "index": 1, "name": "id", "comment": null}, "_fivetran_deleted": {"type": "BOOL", "index": 2, "name": "_fivetran_deleted", "comment": null}, "_fivetran_synced": {"type": "TIMESTAMP", "index": 3, "name": "_fivetran_synced", "comment": null}, "name": {"type": "STRING", "index": 4, "name": "name", "comment": null}, "organization_id": {"type": "INT64", "index": 5, "name": "organization_id", "comment": null}}, "stats": {"num_rows": {"id": "num_rows", "label": "# Rows", "value": 25.0, "include": true, "description": "Approximate count of rows in this table"}, "num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 1475.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.asana_source.asana.team"}, "source.asana_source.asana.tag": {"metadata": {"type": "table", "schema": "asana_integrations_tests", "name": "tag_data", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"id": {"type": "INT64", "index": 1, "name": "id", "comment": null}, "_fivetran_deleted": {"type": "BOOL", "index": 2, "name": "_fivetran_deleted", "comment": null}, "_fivetran_synced": {"type": "TIMESTAMP", "index": 3, "name": "_fivetran_synced", "comment": null}, "color": {"type": "INT64", "index": 4, "name": "color", "comment": null}, "created_at": {"type": "DATETIME", "index": 5, "name": "created_at", "comment": null}, "message": {"type": "INT64", "index": 6, "name": "message", "comment": null}, "name": {"type": "STRING", "index": 7, "name": "name", "comment": null}, "notes": {"type": "INT64", "index": 8, "name": "notes", "comment": null}, "workspace_id": {"type": "INT64", "index": 9, "name": "workspace_id", "comment": null}}, "stats": {"num_rows": {"id": "num_rows", "label": "# Rows", "value": 17.0, "include": true, "description": "Approximate count of rows in this table"}, "num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 1139.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.asana_source.asana.tag"}}, "errors": null} \ No newline at end of file +{"metadata": {"dbt_schema_version": "https://schemas.getdbt.com/dbt/catalog/v1.json", "dbt_version": "1.3.0", "generated_at": "2022-12-19T20:30:19.920179Z", "invocation_id": "5399ad9a-7e64-4cd8-8664-6d244aa13f8f", "env": {}}, "nodes": {"seed.asana_integration_tests.project_data": {"metadata": {"type": "BASE TABLE", "schema": "asana_integrations_tests", "name": "project_data", "database": "postgres", "comment": null, "owner": "pguser"}, "columns": {"id": {"type": "bigint", "index": 1, "name": "id", "comment": null}, "_fivetran_deleted": {"type": "boolean", "index": 2, "name": "_fivetran_deleted", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 3, "name": "_fivetran_synced", "comment": null}, "archived": {"type": "boolean", "index": 4, "name": "archived", "comment": null}, "color": {"type": "text", "index": 5, "name": "color", "comment": null}, "created_at": {"type": "timestamp without time zone", "index": 6, "name": "created_at", "comment": null}, "current_status": {"type": "text", "index": 7, "name": "current_status", "comment": null}, "due_date": {"type": "timestamp without time zone", "index": 8, "name": "due_date", "comment": null}, "modified_at": {"type": "timestamp without time zone", "index": 9, "name": "modified_at", "comment": null}, "name": {"type": "text", "index": 10, "name": "name", "comment": null}, "notes": {"type": "text", "index": 11, "name": "notes", "comment": null}, "owner_id": {"type": "bigint", "index": 12, "name": "owner_id", "comment": null}, "public": {"type": "integer", "index": 13, "name": "public", "comment": null}, "team_id": {"type": "bigint", "index": 14, "name": "team_id", "comment": null}, "workspace_id": {"type": "bigint", "index": 15, "name": "workspace_id", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.asana_integration_tests.project_data"}, "seed.asana_integration_tests.project_task_data": {"metadata": {"type": "BASE TABLE", "schema": "asana_integrations_tests", "name": "project_task_data", "database": "postgres", "comment": null, "owner": "pguser"}, "columns": {"project_id": {"type": "bigint", "index": 1, "name": "project_id", "comment": null}, "task_id": {"type": "bigint", "index": 2, "name": "task_id", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 3, "name": "_fivetran_synced", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.asana_integration_tests.project_task_data"}, "seed.asana_integration_tests.section_data": {"metadata": {"type": "BASE TABLE", "schema": "asana_integrations_tests", "name": "section_data", "database": "postgres", "comment": null, "owner": "pguser"}, "columns": {"id": {"type": "bigint", "index": 1, "name": "id", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 2, "name": "_fivetran_synced", "comment": null}, "created_at": {"type": "timestamp without time zone", "index": 3, "name": "created_at", "comment": null}, "name": {"type": "text", "index": 4, "name": "name", "comment": null}, "project_id": {"type": "bigint", "index": 5, "name": "project_id", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.asana_integration_tests.section_data"}, "seed.asana_integration_tests.story_data": {"metadata": {"type": "BASE TABLE", "schema": "asana_integrations_tests", "name": "story_data", "database": "postgres", "comment": null, "owner": "pguser"}, "columns": {"id": {"type": "bigint", "index": 1, "name": "id", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 2, "name": "_fivetran_synced", "comment": null}, "created_at": {"type": "timestamp without time zone", "index": 3, "name": "created_at", "comment": null}, "created_by_id": {"type": "bigint", "index": 4, "name": "created_by_id", "comment": null}, "hearted": {"type": "integer", "index": 5, "name": "hearted", "comment": null}, "num_hearts": {"type": "integer", "index": 6, "name": "num_hearts", "comment": null}, "source": {"type": "text", "index": 7, "name": "source", "comment": null}, "target_id": {"type": "bigint", "index": 8, "name": "target_id", "comment": null}, "text": {"type": "text", "index": 9, "name": "text", "comment": null}, "type": {"type": "text", "index": 10, "name": "type", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.asana_integration_tests.story_data"}, "seed.asana_integration_tests.tag_data": {"metadata": {"type": "BASE TABLE", "schema": "asana_integrations_tests", "name": "tag_data", "database": "postgres", "comment": null, "owner": "pguser"}, "columns": {"id": {"type": "bigint", "index": 1, "name": "id", "comment": null}, "_fivetran_deleted": {"type": "boolean", "index": 2, "name": "_fivetran_deleted", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 3, "name": "_fivetran_synced", "comment": null}, "color": {"type": "integer", "index": 4, "name": "color", "comment": null}, "created_at": {"type": "timestamp without time zone", "index": 5, "name": "created_at", "comment": null}, "message": {"type": "integer", "index": 6, "name": "message", "comment": null}, "name": {"type": "text", "index": 7, "name": "name", "comment": null}, "notes": {"type": "integer", "index": 8, "name": "notes", "comment": null}, "workspace_id": {"type": "bigint", "index": 9, "name": "workspace_id", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.asana_integration_tests.tag_data"}, "seed.asana_integration_tests.task_data": {"metadata": {"type": "BASE TABLE", "schema": "asana_integrations_tests", "name": "task_data", "database": "postgres", "comment": null, "owner": "pguser"}, "columns": {"id": {"type": "bigint", "index": 1, "name": "id", "comment": null}, "assignee_id": {"type": "bigint", "index": 2, "name": "assignee_id", "comment": null}, "completed": {"type": "boolean", "index": 3, "name": "completed", "comment": null}, "completed_at": {"type": "timestamp without time zone", "index": 4, "name": "completed_at", "comment": null}, "completed_by_id": {"type": "bigint", "index": 5, "name": "completed_by_id", "comment": null}, "created_at": {"type": "timestamp without time zone", "index": 6, "name": "created_at", "comment": null}, "due_on": {"type": "timestamp without time zone", "index": 7, "name": "due_on", "comment": null}, "due_at": {"type": "timestamp without time zone", "index": 8, "name": "due_at", "comment": null}, "modified_at": {"type": "timestamp without time zone", "index": 9, "name": "modified_at", "comment": null}, "name": {"type": "text", "index": 10, "name": "name", "comment": null}, "parent_id": {"type": "bigint", "index": 11, "name": "parent_id", "comment": null}, "start_on": {"type": "timestamp without time zone", "index": 12, "name": "start_on", "comment": null}, "notes": {"type": "text", "index": 13, "name": "notes", "comment": null}, "workspace_id": {"type": "bigint", "index": 14, "name": "workspace_id", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.asana_integration_tests.task_data"}, "seed.asana_integration_tests.task_follower_data": {"metadata": {"type": "BASE TABLE", "schema": "asana_integrations_tests", "name": "task_follower_data", "database": "postgres", "comment": null, "owner": "pguser"}, "columns": {"task_id": {"type": "bigint", "index": 1, "name": "task_id", "comment": null}, "user_id": {"type": "bigint", "index": 2, "name": "user_id", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 3, "name": "_fivetran_synced", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.asana_integration_tests.task_follower_data"}, "seed.asana_integration_tests.task_section_data": {"metadata": {"type": "BASE TABLE", "schema": "asana_integrations_tests", "name": "task_section_data", "database": "postgres", "comment": null, "owner": "pguser"}, "columns": {"section_id": {"type": "bigint", "index": 1, "name": "section_id", "comment": null}, "task_id": {"type": "bigint", "index": 2, "name": "task_id", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 3, "name": "_fivetran_synced", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.asana_integration_tests.task_section_data"}, "seed.asana_integration_tests.task_tag_data": {"metadata": {"type": "BASE TABLE", "schema": "asana_integrations_tests", "name": "task_tag_data", "database": "postgres", "comment": null, "owner": "pguser"}, "columns": {"tag_id": {"type": "bigint", "index": 1, "name": "tag_id", "comment": null}, "task_id": {"type": "bigint", "index": 2, "name": "task_id", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 3, "name": "_fivetran_synced", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.asana_integration_tests.task_tag_data"}, "seed.asana_integration_tests.team_data": {"metadata": {"type": "BASE TABLE", "schema": "asana_integrations_tests", "name": "team_data", "database": "postgres", "comment": null, "owner": "pguser"}, "columns": {"id": {"type": "bigint", "index": 1, "name": "id", "comment": null}, "_fivetran_deleted": {"type": "boolean", "index": 2, "name": "_fivetran_deleted", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 3, "name": "_fivetran_synced", "comment": null}, "name": {"type": "text", "index": 4, "name": "name", "comment": null}, "organization_id": {"type": "bigint", "index": 5, "name": "organization_id", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.asana_integration_tests.team_data"}, "seed.asana_integration_tests.user_data": {"metadata": {"type": "BASE TABLE", "schema": "asana_integrations_tests", "name": "user_data", "database": "postgres", "comment": null, "owner": "pguser"}, "columns": {"id": {"type": "bigint", "index": 1, "name": "id", "comment": null}, "_fivetran_deleted": {"type": "boolean", "index": 2, "name": "_fivetran_deleted", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 3, "name": "_fivetran_synced", "comment": null}, "email": {"type": "text", "index": 4, "name": "email", "comment": null}, "name": {"type": "text", "index": 5, "name": "name", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.asana_integration_tests.user_data"}, "model.asana.asana__daily_metrics": {"metadata": {"type": "BASE TABLE", "schema": "asana_integrations_tests_asana", "name": "asana__daily_metrics", "database": "postgres", "comment": null, "owner": "pguser"}, "columns": {"date_day": {"type": "timestamp without time zone", "index": 1, "name": "date_day", "comment": null}, "number_of_tasks_open": {"type": "bigint", "index": 2, "name": "number_of_tasks_open", "comment": null}, "number_of_tasks_open_assigned": {"type": "bigint", "index": 3, "name": "number_of_tasks_open_assigned", "comment": null}, "number_of_tasks_created": {"type": "bigint", "index": 4, "name": "number_of_tasks_created", "comment": null}, "number_of_tasks_completed": {"type": "bigint", "index": 5, "name": "number_of_tasks_completed", "comment": null}, "avg_days_open": {"type": "numeric", "index": 6, "name": "avg_days_open", "comment": null}, "avg_days_open_assigned": {"type": "numeric", "index": 7, "name": "avg_days_open_assigned", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.asana.asana__daily_metrics"}, "model.asana.asana__project": {"metadata": {"type": "BASE TABLE", "schema": "asana_integrations_tests_asana", "name": "asana__project", "database": "postgres", "comment": null, "owner": "pguser"}, "columns": {"project_id": {"type": "bigint", "index": 1, "name": "project_id", "comment": null}, "project_name": {"type": "text", "index": 2, "name": "project_name", "comment": null}, "number_of_open_tasks": {"type": "bigint", "index": 3, "name": "number_of_open_tasks", "comment": null}, "number_of_assigned_open_tasks": {"type": "bigint", "index": 4, "name": "number_of_assigned_open_tasks", "comment": null}, "number_of_tasks_completed": {"type": "bigint", "index": 5, "name": "number_of_tasks_completed", "comment": null}, "avg_close_time_days": {"type": "numeric", "index": 6, "name": "avg_close_time_days", "comment": null}, "avg_close_time_assigned_days": {"type": "numeric", "index": 7, "name": "avg_close_time_assigned_days", "comment": null}, "project_link": {"type": "text", "index": 8, "name": "project_link", "comment": null}, "team_id": {"type": "bigint", "index": 9, "name": "team_id", "comment": null}, "team_name": {"type": "text", "index": 10, "name": "team_name", "comment": null}, "is_archived": {"type": "boolean", "index": 11, "name": "is_archived", "comment": null}, "created_at": {"type": "timestamp without time zone", "index": 12, "name": "created_at", "comment": null}, "current_status": {"type": "text", "index": 13, "name": "current_status", "comment": null}, "due_date": {"type": "timestamp without time zone", "index": 14, "name": "due_date", "comment": null}, "last_modified_at": {"type": "timestamp without time zone", "index": 15, "name": "last_modified_at", "comment": null}, "owner_user_id": {"type": "bigint", "index": 16, "name": "owner_user_id", "comment": null}, "users_involved": {"type": "text", "index": 17, "name": "users_involved", "comment": null}, "number_of_users_involved": {"type": "bigint", "index": 18, "name": "number_of_users_involved", "comment": null}, "sections": {"type": "text", "index": 19, "name": "sections", "comment": null}, "notes": {"type": "text", "index": 20, "name": "notes", "comment": null}, "is_public": {"type": "integer", "index": 21, "name": "is_public", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.asana.asana__project"}, "model.asana.asana__tag": {"metadata": {"type": "BASE TABLE", "schema": "asana_integrations_tests_asana", "name": "asana__tag", "database": "postgres", "comment": null, "owner": "pguser"}, "columns": {"tag_id": {"type": "bigint", "index": 1, "name": "tag_id", "comment": null}, "tag_name": {"type": "text", "index": 2, "name": "tag_name", "comment": null}, "created_at": {"type": "timestamp without time zone", "index": 3, "name": "created_at", "comment": null}, "number_of_open_tasks": {"type": "bigint", "index": 4, "name": "number_of_open_tasks", "comment": null}, "number_of_assigned_open_tasks": {"type": "bigint", "index": 5, "name": "number_of_assigned_open_tasks", "comment": null}, "number_of_tasks_completed": {"type": "bigint", "index": 6, "name": "number_of_tasks_completed", "comment": null}, "avg_days_open": {"type": "numeric", "index": 7, "name": "avg_days_open", "comment": null}, "avg_days_assigned": {"type": "numeric", "index": 8, "name": "avg_days_assigned", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.asana.asana__tag"}, "model.asana.asana__task": {"metadata": {"type": "BASE TABLE", "schema": "asana_integrations_tests_asana", "name": "asana__task", "database": "postgres", "comment": null, "owner": "pguser"}, "columns": {"task_id": {"type": "bigint", "index": 1, "name": "task_id", "comment": null}, "assignee_user_id": {"type": "bigint", "index": 2, "name": "assignee_user_id", "comment": null}, "is_completed": {"type": "boolean", "index": 3, "name": "is_completed", "comment": null}, "completed_at": {"type": "timestamp without time zone", "index": 4, "name": "completed_at", "comment": null}, "completed_by_user_id": {"type": "bigint", "index": 5, "name": "completed_by_user_id", "comment": null}, "created_at": {"type": "timestamp without time zone", "index": 6, "name": "created_at", "comment": null}, "due_date": {"type": "timestamp without time zone", "index": 7, "name": "due_date", "comment": null}, "modified_at": {"type": "timestamp without time zone", "index": 8, "name": "modified_at", "comment": null}, "task_name": {"type": "text", "index": 9, "name": "task_name", "comment": null}, "parent_task_id": {"type": "bigint", "index": 10, "name": "parent_task_id", "comment": null}, "start_date": {"type": "timestamp without time zone", "index": 11, "name": "start_date", "comment": null}, "task_description": {"type": "text", "index": 12, "name": "task_description", "comment": null}, "is_liked": {"type": "boolean", "index": 13, "name": "is_liked", "comment": null}, "number_of_likes": {"type": "integer", "index": 14, "name": "number_of_likes", "comment": null}, "workspace_id": {"type": "bigint", "index": 15, "name": "workspace_id", "comment": null}, "task_link": {"type": "text", "index": 16, "name": "task_link", "comment": null}, "assignee_name": {"type": "text", "index": 17, "name": "assignee_name", "comment": null}, "assignee_email": {"type": "text", "index": 18, "name": "assignee_email", "comment": null}, "days_open": {"type": "integer", "index": 19, "name": "days_open", "comment": null}, "is_currently_assigned": {"type": "boolean", "index": 20, "name": "is_currently_assigned", "comment": null}, "has_been_assigned": {"type": "boolean", "index": 21, "name": "has_been_assigned", "comment": null}, "days_since_last_assignment": {"type": "integer", "index": 22, "name": "days_since_last_assignment", "comment": null}, "days_since_first_assignment": {"type": "integer", "index": 23, "name": "days_since_first_assignment", "comment": null}, "last_assigned_at": {"type": "timestamp without time zone", "index": 24, "name": "last_assigned_at", "comment": null}, "first_assigned_at": {"type": "timestamp without time zone", "index": 25, "name": "first_assigned_at", "comment": null}, "first_modifier_user_id": {"type": "bigint", "index": 26, "name": "first_modifier_user_id", "comment": null}, "first_modifier_name": {"type": "text", "index": 27, "name": "first_modifier_name", "comment": null}, "conversation": {"type": "text", "index": 28, "name": "conversation", "comment": null}, "number_of_comments": {"type": "bigint", "index": 29, "name": "number_of_comments", "comment": null}, "followers": {"type": "text", "index": 30, "name": "followers", "comment": null}, "number_of_followers": {"type": "bigint", "index": 31, "name": "number_of_followers", "comment": null}, "tags": {"type": "text", "index": 32, "name": "tags", "comment": null}, "number_of_tags": {"type": "bigint", "index": 33, "name": "number_of_tags", "comment": null}, "projects_sections": {"type": "text", "index": 34, "name": "projects_sections", "comment": null}, "is_subtask": {"type": "boolean", "index": 35, "name": "is_subtask", "comment": null}, "parent_task_name": {"type": "text", "index": 36, "name": "parent_task_name", "comment": null}, "parent_assignee_user_id": {"type": "bigint", "index": 37, "name": "parent_assignee_user_id", "comment": null}, "parent_assignee_name": {"type": "text", "index": 38, "name": "parent_assignee_name", "comment": null}, "parent_due_date": {"type": "timestamp without time zone", "index": 39, "name": "parent_due_date", "comment": null}, "parent_created_at": {"type": "timestamp without time zone", "index": 40, "name": "parent_created_at", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.asana.asana__task"}, "model.asana.asana__team": {"metadata": {"type": "BASE TABLE", "schema": "asana_integrations_tests_asana", "name": "asana__team", "database": "postgres", "comment": null, "owner": "pguser"}, "columns": {"team_id": {"type": "bigint", "index": 1, "name": "team_id", "comment": null}, "team_name": {"type": "text", "index": 2, "name": "team_name", "comment": null}, "number_of_open_tasks": {"type": "numeric", "index": 3, "name": "number_of_open_tasks", "comment": null}, "number_of_assigned_open_tasks": {"type": "numeric", "index": 4, "name": "number_of_assigned_open_tasks", "comment": null}, "number_of_tasks_completed": {"type": "numeric", "index": 5, "name": "number_of_tasks_completed", "comment": null}, "avg_close_time_days": {"type": "numeric", "index": 6, "name": "avg_close_time_days", "comment": null}, "avg_close_time_assigned_days": {"type": "numeric", "index": 7, "name": "avg_close_time_assigned_days", "comment": null}, "number_of_active_projects": {"type": "bigint", "index": 8, "name": "number_of_active_projects", "comment": null}, "active_projects": {"type": "text", "index": 9, "name": "active_projects", "comment": null}, "number_of_archived_projects": {"type": "bigint", "index": 10, "name": "number_of_archived_projects", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.asana.asana__team"}, "model.asana.asana__user": {"metadata": {"type": "BASE TABLE", "schema": "asana_integrations_tests_asana", "name": "asana__user", "database": "postgres", "comment": null, "owner": "pguser"}, "columns": {"user_id": {"type": "bigint", "index": 1, "name": "user_id", "comment": null}, "email": {"type": "text", "index": 2, "name": "email", "comment": null}, "user_name": {"type": "text", "index": 3, "name": "user_name", "comment": null}, "number_of_open_tasks": {"type": "bigint", "index": 4, "name": "number_of_open_tasks", "comment": null}, "number_of_tasks_completed": {"type": "bigint", "index": 5, "name": "number_of_tasks_completed", "comment": null}, "avg_close_time_days": {"type": "numeric", "index": 6, "name": "avg_close_time_days", "comment": null}, "number_of_projects_owned": {"type": "bigint", "index": 7, "name": "number_of_projects_owned", "comment": null}, "number_of_projects_currently_assigned_to": {"type": "bigint", "index": 8, "name": "number_of_projects_currently_assigned_to", "comment": null}, "projects_working_on": {"type": "text", "index": 9, "name": "projects_working_on", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.asana.asana__user"}, "model.asana_source.stg_asana__project": {"metadata": {"type": "BASE TABLE", "schema": "asana_integrations_tests_stg_asana", "name": "stg_asana__project", "database": "postgres", "comment": null, "owner": "pguser"}, "columns": {"project_id": {"type": "bigint", "index": 1, "name": "project_id", "comment": null}, "is_archived": {"type": "boolean", "index": 2, "name": "is_archived", "comment": null}, "created_at": {"type": "timestamp without time zone", "index": 3, "name": "created_at", "comment": null}, "current_status": {"type": "text", "index": 4, "name": "current_status", "comment": null}, "due_date": {"type": "timestamp without time zone", "index": 5, "name": "due_date", "comment": null}, "modified_at": {"type": "timestamp without time zone", "index": 6, "name": "modified_at", "comment": null}, "project_name": {"type": "text", "index": 7, "name": "project_name", "comment": null}, "owner_user_id": {"type": "bigint", "index": 8, "name": "owner_user_id", "comment": null}, "is_public": {"type": "integer", "index": 9, "name": "is_public", "comment": null}, "team_id": {"type": "bigint", "index": 10, "name": "team_id", "comment": null}, "workspace_id": {"type": "bigint", "index": 11, "name": "workspace_id", "comment": null}, "notes": {"type": "text", "index": 12, "name": "notes", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.asana_source.stg_asana__project"}, "model.asana_source.stg_asana__project_task": {"metadata": {"type": "BASE TABLE", "schema": "asana_integrations_tests_stg_asana", "name": "stg_asana__project_task", "database": "postgres", "comment": null, "owner": "pguser"}, "columns": {"project_id": {"type": "bigint", "index": 1, "name": "project_id", "comment": null}, "task_id": {"type": "bigint", "index": 2, "name": "task_id", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.asana_source.stg_asana__project_task"}, "model.asana_source.stg_asana__project_task_tmp": {"metadata": {"type": "BASE TABLE", "schema": "asana_integrations_tests_stg_asana", "name": "stg_asana__project_task_tmp", "database": "postgres", "comment": null, "owner": "pguser"}, "columns": {"project_id": {"type": "bigint", "index": 1, "name": "project_id", "comment": null}, "task_id": {"type": "bigint", "index": 2, "name": "task_id", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 3, "name": "_fivetran_synced", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.asana_source.stg_asana__project_task_tmp"}, "model.asana_source.stg_asana__project_tmp": {"metadata": {"type": "BASE TABLE", "schema": "asana_integrations_tests_stg_asana", "name": "stg_asana__project_tmp", "database": "postgres", "comment": null, "owner": "pguser"}, "columns": {"id": {"type": "bigint", "index": 1, "name": "id", "comment": null}, "_fivetran_deleted": {"type": "boolean", "index": 2, "name": "_fivetran_deleted", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 3, "name": "_fivetran_synced", "comment": null}, "archived": {"type": "boolean", "index": 4, "name": "archived", "comment": null}, "color": {"type": "text", "index": 5, "name": "color", "comment": null}, "created_at": {"type": "timestamp without time zone", "index": 6, "name": "created_at", "comment": null}, "current_status": {"type": "text", "index": 7, "name": "current_status", "comment": null}, "due_date": {"type": "timestamp without time zone", "index": 8, "name": "due_date", "comment": null}, "modified_at": {"type": "timestamp without time zone", "index": 9, "name": "modified_at", "comment": null}, "name": {"type": "text", "index": 10, "name": "name", "comment": null}, "notes": {"type": "text", "index": 11, "name": "notes", "comment": null}, "owner_id": {"type": "bigint", "index": 12, "name": "owner_id", "comment": null}, "public": {"type": "integer", "index": 13, "name": "public", "comment": null}, "team_id": {"type": "bigint", "index": 14, "name": "team_id", "comment": null}, "workspace_id": {"type": "bigint", "index": 15, "name": "workspace_id", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.asana_source.stg_asana__project_tmp"}, "model.asana_source.stg_asana__section": {"metadata": {"type": "BASE TABLE", "schema": "asana_integrations_tests_stg_asana", "name": "stg_asana__section", "database": "postgres", "comment": null, "owner": "pguser"}, "columns": {"section_id": {"type": "bigint", "index": 1, "name": "section_id", "comment": null}, "created_at": {"type": "timestamp without time zone", "index": 2, "name": "created_at", "comment": null}, "section_name": {"type": "text", "index": 3, "name": "section_name", "comment": null}, "project_id": {"type": "bigint", "index": 4, "name": "project_id", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.asana_source.stg_asana__section"}, "model.asana_source.stg_asana__section_tmp": {"metadata": {"type": "BASE TABLE", "schema": "asana_integrations_tests_stg_asana", "name": "stg_asana__section_tmp", "database": "postgres", "comment": null, "owner": "pguser"}, "columns": {"id": {"type": "bigint", "index": 1, "name": "id", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 2, "name": "_fivetran_synced", "comment": null}, "created_at": {"type": "timestamp without time zone", "index": 3, "name": "created_at", "comment": null}, "name": {"type": "text", "index": 4, "name": "name", "comment": null}, "project_id": {"type": "bigint", "index": 5, "name": "project_id", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.asana_source.stg_asana__section_tmp"}, "model.asana_source.stg_asana__story": {"metadata": {"type": "BASE TABLE", "schema": "asana_integrations_tests_stg_asana", "name": "stg_asana__story", "database": "postgres", "comment": null, "owner": "pguser"}, "columns": {"story_id": {"type": "bigint", "index": 1, "name": "story_id", "comment": null}, "created_at": {"type": "timestamp without time zone", "index": 2, "name": "created_at", "comment": null}, "created_by_user_id": {"type": "bigint", "index": 3, "name": "created_by_user_id", "comment": null}, "target_task_id": {"type": "bigint", "index": 4, "name": "target_task_id", "comment": null}, "story_content": {"type": "text", "index": 5, "name": "story_content", "comment": null}, "event_type": {"type": "text", "index": 6, "name": "event_type", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.asana_source.stg_asana__story"}, "model.asana_source.stg_asana__story_tmp": {"metadata": {"type": "BASE TABLE", "schema": "asana_integrations_tests_stg_asana", "name": "stg_asana__story_tmp", "database": "postgres", "comment": null, "owner": "pguser"}, "columns": {"id": {"type": "bigint", "index": 1, "name": "id", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 2, "name": "_fivetran_synced", "comment": null}, "created_at": {"type": "timestamp without time zone", "index": 3, "name": "created_at", "comment": null}, "created_by_id": {"type": "bigint", "index": 4, "name": "created_by_id", "comment": null}, "hearted": {"type": "integer", "index": 5, "name": "hearted", "comment": null}, "num_hearts": {"type": "integer", "index": 6, "name": "num_hearts", "comment": null}, "source": {"type": "text", "index": 7, "name": "source", "comment": null}, "target_id": {"type": "bigint", "index": 8, "name": "target_id", "comment": null}, "text": {"type": "text", "index": 9, "name": "text", "comment": null}, "type": {"type": "text", "index": 10, "name": "type", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.asana_source.stg_asana__story_tmp"}, "model.asana_source.stg_asana__tag": {"metadata": {"type": "BASE TABLE", "schema": "asana_integrations_tests_stg_asana", "name": "stg_asana__tag", "database": "postgres", "comment": null, "owner": "pguser"}, "columns": {"tag_id": {"type": "bigint", "index": 1, "name": "tag_id", "comment": null}, "tag_name": {"type": "text", "index": 2, "name": "tag_name", "comment": null}, "created_at": {"type": "timestamp without time zone", "index": 3, "name": "created_at", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.asana_source.stg_asana__tag"}, "model.asana_source.stg_asana__tag_tmp": {"metadata": {"type": "BASE TABLE", "schema": "asana_integrations_tests_stg_asana", "name": "stg_asana__tag_tmp", "database": "postgres", "comment": null, "owner": "pguser"}, "columns": {"id": {"type": "bigint", "index": 1, "name": "id", "comment": null}, "_fivetran_deleted": {"type": "boolean", "index": 2, "name": "_fivetran_deleted", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 3, "name": "_fivetran_synced", "comment": null}, "color": {"type": "integer", "index": 4, "name": "color", "comment": null}, "created_at": {"type": "timestamp without time zone", "index": 5, "name": "created_at", "comment": null}, "message": {"type": "integer", "index": 6, "name": "message", "comment": null}, "name": {"type": "text", "index": 7, "name": "name", "comment": null}, "notes": {"type": "integer", "index": 8, "name": "notes", "comment": null}, "workspace_id": {"type": "bigint", "index": 9, "name": "workspace_id", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.asana_source.stg_asana__tag_tmp"}, "model.asana_source.stg_asana__task": {"metadata": {"type": "BASE TABLE", "schema": "asana_integrations_tests_stg_asana", "name": "stg_asana__task", "database": "postgres", "comment": null, "owner": "pguser"}, "columns": {"task_id": {"type": "bigint", "index": 1, "name": "task_id", "comment": null}, "assignee_user_id": {"type": "bigint", "index": 2, "name": "assignee_user_id", "comment": null}, "is_completed": {"type": "boolean", "index": 3, "name": "is_completed", "comment": null}, "completed_at": {"type": "timestamp without time zone", "index": 4, "name": "completed_at", "comment": null}, "completed_by_user_id": {"type": "bigint", "index": 5, "name": "completed_by_user_id", "comment": null}, "created_at": {"type": "timestamp without time zone", "index": 6, "name": "created_at", "comment": null}, "due_date": {"type": "timestamp without time zone", "index": 7, "name": "due_date", "comment": null}, "modified_at": {"type": "timestamp without time zone", "index": 8, "name": "modified_at", "comment": null}, "task_name": {"type": "text", "index": 9, "name": "task_name", "comment": null}, "parent_task_id": {"type": "bigint", "index": 10, "name": "parent_task_id", "comment": null}, "start_date": {"type": "timestamp without time zone", "index": 11, "name": "start_date", "comment": null}, "task_description": {"type": "text", "index": 12, "name": "task_description", "comment": null}, "is_liked": {"type": "boolean", "index": 13, "name": "is_liked", "comment": null}, "number_of_likes": {"type": "integer", "index": 14, "name": "number_of_likes", "comment": null}, "workspace_id": {"type": "bigint", "index": 15, "name": "workspace_id", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.asana_source.stg_asana__task"}, "model.asana_source.stg_asana__task_follower": {"metadata": {"type": "BASE TABLE", "schema": "asana_integrations_tests_stg_asana", "name": "stg_asana__task_follower", "database": "postgres", "comment": null, "owner": "pguser"}, "columns": {"task_id": {"type": "bigint", "index": 1, "name": "task_id", "comment": null}, "user_id": {"type": "bigint", "index": 2, "name": "user_id", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.asana_source.stg_asana__task_follower"}, "model.asana_source.stg_asana__task_follower_tmp": {"metadata": {"type": "BASE TABLE", "schema": "asana_integrations_tests_stg_asana", "name": "stg_asana__task_follower_tmp", "database": "postgres", "comment": null, "owner": "pguser"}, "columns": {"task_id": {"type": "bigint", "index": 1, "name": "task_id", "comment": null}, "user_id": {"type": "bigint", "index": 2, "name": "user_id", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 3, "name": "_fivetran_synced", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.asana_source.stg_asana__task_follower_tmp"}, "model.asana_source.stg_asana__task_section": {"metadata": {"type": "BASE TABLE", "schema": "asana_integrations_tests_stg_asana", "name": "stg_asana__task_section", "database": "postgres", "comment": null, "owner": "pguser"}, "columns": {"section_id": {"type": "bigint", "index": 1, "name": "section_id", "comment": null}, "task_id": {"type": "bigint", "index": 2, "name": "task_id", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.asana_source.stg_asana__task_section"}, "model.asana_source.stg_asana__task_section_tmp": {"metadata": {"type": "BASE TABLE", "schema": "asana_integrations_tests_stg_asana", "name": "stg_asana__task_section_tmp", "database": "postgres", "comment": null, "owner": "pguser"}, "columns": {"section_id": {"type": "bigint", "index": 1, "name": "section_id", "comment": null}, "task_id": {"type": "bigint", "index": 2, "name": "task_id", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 3, "name": "_fivetran_synced", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.asana_source.stg_asana__task_section_tmp"}, "model.asana_source.stg_asana__task_tag": {"metadata": {"type": "BASE TABLE", "schema": "asana_integrations_tests_stg_asana", "name": "stg_asana__task_tag", "database": "postgres", "comment": null, "owner": "pguser"}, "columns": {"tag_id": {"type": "bigint", "index": 1, "name": "tag_id", "comment": null}, "task_id": {"type": "bigint", "index": 2, "name": "task_id", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.asana_source.stg_asana__task_tag"}, "model.asana_source.stg_asana__task_tag_tmp": {"metadata": {"type": "BASE TABLE", "schema": "asana_integrations_tests_stg_asana", "name": "stg_asana__task_tag_tmp", "database": "postgres", "comment": null, "owner": "pguser"}, "columns": {"tag_id": {"type": "bigint", "index": 1, "name": "tag_id", "comment": null}, "task_id": {"type": "bigint", "index": 2, "name": "task_id", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 3, "name": "_fivetran_synced", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.asana_source.stg_asana__task_tag_tmp"}, "model.asana_source.stg_asana__task_tmp": {"metadata": {"type": "BASE TABLE", "schema": "asana_integrations_tests_stg_asana", "name": "stg_asana__task_tmp", "database": "postgres", "comment": null, "owner": "pguser"}, "columns": {"id": {"type": "bigint", "index": 1, "name": "id", "comment": null}, "assignee_id": {"type": "bigint", "index": 2, "name": "assignee_id", "comment": null}, "completed": {"type": "boolean", "index": 3, "name": "completed", "comment": null}, "completed_at": {"type": "timestamp without time zone", "index": 4, "name": "completed_at", "comment": null}, "completed_by_id": {"type": "bigint", "index": 5, "name": "completed_by_id", "comment": null}, "created_at": {"type": "timestamp without time zone", "index": 6, "name": "created_at", "comment": null}, "due_on": {"type": "timestamp without time zone", "index": 7, "name": "due_on", "comment": null}, "due_at": {"type": "timestamp without time zone", "index": 8, "name": "due_at", "comment": null}, "modified_at": {"type": "timestamp without time zone", "index": 9, "name": "modified_at", "comment": null}, "name": {"type": "text", "index": 10, "name": "name", "comment": null}, "parent_id": {"type": "bigint", "index": 11, "name": "parent_id", "comment": null}, "start_on": {"type": "timestamp without time zone", "index": 12, "name": "start_on", "comment": null}, "notes": {"type": "text", "index": 13, "name": "notes", "comment": null}, "workspace_id": {"type": "bigint", "index": 14, "name": "workspace_id", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.asana_source.stg_asana__task_tmp"}, "model.asana_source.stg_asana__team": {"metadata": {"type": "BASE TABLE", "schema": "asana_integrations_tests_stg_asana", "name": "stg_asana__team", "database": "postgres", "comment": null, "owner": "pguser"}, "columns": {"team_id": {"type": "bigint", "index": 1, "name": "team_id", "comment": null}, "team_name": {"type": "text", "index": 2, "name": "team_name", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.asana_source.stg_asana__team"}, "model.asana_source.stg_asana__team_tmp": {"metadata": {"type": "BASE TABLE", "schema": "asana_integrations_tests_stg_asana", "name": "stg_asana__team_tmp", "database": "postgres", "comment": null, "owner": "pguser"}, "columns": {"id": {"type": "bigint", "index": 1, "name": "id", "comment": null}, "_fivetran_deleted": {"type": "boolean", "index": 2, "name": "_fivetran_deleted", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 3, "name": "_fivetran_synced", "comment": null}, "name": {"type": "text", "index": 4, "name": "name", "comment": null}, "organization_id": {"type": "bigint", "index": 5, "name": "organization_id", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.asana_source.stg_asana__team_tmp"}, "model.asana_source.stg_asana__user": {"metadata": {"type": "BASE TABLE", "schema": "asana_integrations_tests_stg_asana", "name": "stg_asana__user", "database": "postgres", "comment": null, "owner": "pguser"}, "columns": {"user_id": {"type": "bigint", "index": 1, "name": "user_id", "comment": null}, "email": {"type": "text", "index": 2, "name": "email", "comment": null}, "user_name": {"type": "text", "index": 3, "name": "user_name", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.asana_source.stg_asana__user"}, "model.asana_source.stg_asana__user_tmp": {"metadata": {"type": "BASE TABLE", "schema": "asana_integrations_tests_stg_asana", "name": "stg_asana__user_tmp", "database": "postgres", "comment": null, "owner": "pguser"}, "columns": {"id": {"type": "bigint", "index": 1, "name": "id", "comment": null}, "_fivetran_deleted": {"type": "boolean", "index": 2, "name": "_fivetran_deleted", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 3, "name": "_fivetran_synced", "comment": null}, "email": {"type": "text", "index": 4, "name": "email", "comment": null}, "name": {"type": "text", "index": 5, "name": "name", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.asana_source.stg_asana__user_tmp"}}, "sources": {"source.asana_source.asana.project": {"metadata": {"type": "BASE TABLE", "schema": "asana_integrations_tests", "name": "project_data", "database": "postgres", "comment": null, "owner": "pguser"}, "columns": {"id": {"type": "bigint", "index": 1, "name": "id", "comment": null}, "_fivetran_deleted": {"type": "boolean", "index": 2, "name": "_fivetran_deleted", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 3, "name": "_fivetran_synced", "comment": null}, "archived": {"type": "boolean", "index": 4, "name": "archived", "comment": null}, "color": {"type": "text", "index": 5, "name": "color", "comment": null}, "created_at": {"type": "timestamp without time zone", "index": 6, "name": "created_at", "comment": null}, "current_status": {"type": "text", "index": 7, "name": "current_status", "comment": null}, "due_date": {"type": "timestamp without time zone", "index": 8, "name": "due_date", "comment": null}, "modified_at": {"type": "timestamp without time zone", "index": 9, "name": "modified_at", "comment": null}, "name": {"type": "text", "index": 10, "name": "name", "comment": null}, "notes": {"type": "text", "index": 11, "name": "notes", "comment": null}, "owner_id": {"type": "bigint", "index": 12, "name": "owner_id", "comment": null}, "public": {"type": "integer", "index": 13, "name": "public", "comment": null}, "team_id": {"type": "bigint", "index": 14, "name": "team_id", "comment": null}, "workspace_id": {"type": "bigint", "index": 15, "name": "workspace_id", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.asana_source.asana.project"}, "source.asana_source.asana.project_task": {"metadata": {"type": "BASE TABLE", "schema": "asana_integrations_tests", "name": "project_task_data", "database": "postgres", "comment": null, "owner": "pguser"}, "columns": {"project_id": {"type": "bigint", "index": 1, "name": "project_id", "comment": null}, "task_id": {"type": "bigint", "index": 2, "name": "task_id", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 3, "name": "_fivetran_synced", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.asana_source.asana.project_task"}, "source.asana_source.asana.section": {"metadata": {"type": "BASE TABLE", "schema": "asana_integrations_tests", "name": "section_data", "database": "postgres", "comment": null, "owner": "pguser"}, "columns": {"id": {"type": "bigint", "index": 1, "name": "id", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 2, "name": "_fivetran_synced", "comment": null}, "created_at": {"type": "timestamp without time zone", "index": 3, "name": "created_at", "comment": null}, "name": {"type": "text", "index": 4, "name": "name", "comment": null}, "project_id": {"type": "bigint", "index": 5, "name": "project_id", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.asana_source.asana.section"}, "source.asana_source.asana.story": {"metadata": {"type": "BASE TABLE", "schema": "asana_integrations_tests", "name": "story_data", "database": "postgres", "comment": null, "owner": "pguser"}, "columns": {"id": {"type": "bigint", "index": 1, "name": "id", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 2, "name": "_fivetran_synced", "comment": null}, "created_at": {"type": "timestamp without time zone", "index": 3, "name": "created_at", "comment": null}, "created_by_id": {"type": "bigint", "index": 4, "name": "created_by_id", "comment": null}, "hearted": {"type": "integer", "index": 5, "name": "hearted", "comment": null}, "num_hearts": {"type": "integer", "index": 6, "name": "num_hearts", "comment": null}, "source": {"type": "text", "index": 7, "name": "source", "comment": null}, "target_id": {"type": "bigint", "index": 8, "name": "target_id", "comment": null}, "text": {"type": "text", "index": 9, "name": "text", "comment": null}, "type": {"type": "text", "index": 10, "name": "type", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.asana_source.asana.story"}, "source.asana_source.asana.tag": {"metadata": {"type": "BASE TABLE", "schema": "asana_integrations_tests", "name": "tag_data", "database": "postgres", "comment": null, "owner": "pguser"}, "columns": {"id": {"type": "bigint", "index": 1, "name": "id", "comment": null}, "_fivetran_deleted": {"type": "boolean", "index": 2, "name": "_fivetran_deleted", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 3, "name": "_fivetran_synced", "comment": null}, "color": {"type": "integer", "index": 4, "name": "color", "comment": null}, "created_at": {"type": "timestamp without time zone", "index": 5, "name": "created_at", "comment": null}, "message": {"type": "integer", "index": 6, "name": "message", "comment": null}, "name": {"type": "text", "index": 7, "name": "name", "comment": null}, "notes": {"type": "integer", "index": 8, "name": "notes", "comment": null}, "workspace_id": {"type": "bigint", "index": 9, "name": "workspace_id", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.asana_source.asana.tag"}, "source.asana_source.asana.task": {"metadata": {"type": "BASE TABLE", "schema": "asana_integrations_tests", "name": "task_data", "database": "postgres", "comment": null, "owner": "pguser"}, "columns": {"id": {"type": "bigint", "index": 1, "name": "id", "comment": null}, "assignee_id": {"type": "bigint", "index": 2, "name": "assignee_id", "comment": null}, "completed": {"type": "boolean", "index": 3, "name": "completed", "comment": null}, "completed_at": {"type": "timestamp without time zone", "index": 4, "name": "completed_at", "comment": null}, "completed_by_id": {"type": "bigint", "index": 5, "name": "completed_by_id", "comment": null}, "created_at": {"type": "timestamp without time zone", "index": 6, "name": "created_at", "comment": null}, "due_on": {"type": "timestamp without time zone", "index": 7, "name": "due_on", "comment": null}, "due_at": {"type": "timestamp without time zone", "index": 8, "name": "due_at", "comment": null}, "modified_at": {"type": "timestamp without time zone", "index": 9, "name": "modified_at", "comment": null}, "name": {"type": "text", "index": 10, "name": "name", "comment": null}, "parent_id": {"type": "bigint", "index": 11, "name": "parent_id", "comment": null}, "start_on": {"type": "timestamp without time zone", "index": 12, "name": "start_on", "comment": null}, "notes": {"type": "text", "index": 13, "name": "notes", "comment": null}, "workspace_id": {"type": "bigint", "index": 14, "name": "workspace_id", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.asana_source.asana.task"}, "source.asana_source.asana.task_follower": {"metadata": {"type": "BASE TABLE", "schema": "asana_integrations_tests", "name": "task_follower_data", "database": "postgres", "comment": null, "owner": "pguser"}, "columns": {"task_id": {"type": "bigint", "index": 1, "name": "task_id", "comment": null}, "user_id": {"type": "bigint", "index": 2, "name": "user_id", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 3, "name": "_fivetran_synced", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.asana_source.asana.task_follower"}, "source.asana_source.asana.task_section": {"metadata": {"type": "BASE TABLE", "schema": "asana_integrations_tests", "name": "task_section_data", "database": "postgres", "comment": null, "owner": "pguser"}, "columns": {"section_id": {"type": "bigint", "index": 1, "name": "section_id", "comment": null}, "task_id": {"type": "bigint", "index": 2, "name": "task_id", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 3, "name": "_fivetran_synced", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.asana_source.asana.task_section"}, "source.asana_source.asana.task_tag": {"metadata": {"type": "BASE TABLE", "schema": "asana_integrations_tests", "name": "task_tag_data", "database": "postgres", "comment": null, "owner": "pguser"}, "columns": {"tag_id": {"type": "bigint", "index": 1, "name": "tag_id", "comment": null}, "task_id": {"type": "bigint", "index": 2, "name": "task_id", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 3, "name": "_fivetran_synced", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.asana_source.asana.task_tag"}, "source.asana_source.asana.team": {"metadata": {"type": "BASE TABLE", "schema": "asana_integrations_tests", "name": "team_data", "database": "postgres", "comment": null, "owner": "pguser"}, "columns": {"id": {"type": "bigint", "index": 1, "name": "id", "comment": null}, "_fivetran_deleted": {"type": "boolean", "index": 2, "name": "_fivetran_deleted", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 3, "name": "_fivetran_synced", "comment": null}, "name": {"type": "text", "index": 4, "name": "name", "comment": null}, "organization_id": {"type": "bigint", "index": 5, "name": "organization_id", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.asana_source.asana.team"}, "source.asana_source.asana.user": {"metadata": {"type": "BASE TABLE", "schema": "asana_integrations_tests", "name": "user_data", "database": "postgres", "comment": null, "owner": "pguser"}, "columns": {"id": {"type": "bigint", "index": 1, "name": "id", "comment": null}, "_fivetran_deleted": {"type": "boolean", "index": 2, "name": "_fivetran_deleted", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 3, "name": "_fivetran_synced", "comment": null}, "email": {"type": "text", "index": 4, "name": "email", "comment": null}, "name": {"type": "text", "index": 5, "name": "name", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.asana_source.asana.user"}}, "errors": null} \ No newline at end of file diff --git a/docs/index.html b/docs/index.html index 56291a2..182b6b4 100644 --- a/docs/index.html +++ b/docs/index.html @@ -24,7 +24,7 @@
icons
- diff --git a/docs/manifest.json b/docs/manifest.json index e004f5c..a6dfe00 100644 --- a/docs/manifest.json +++ b/docs/manifest.json @@ -1 +1 @@ -{"metadata": {"dbt_schema_version": "https://schemas.getdbt.com/dbt/manifest/v6.json", "dbt_version": "1.2.0", "generated_at": "2022-09-19T15:40:03.537301Z", "invocation_id": "ca1d8c4c-7612-4d61-ac01-69647773b393", "env": {}, "project_id": "eb4f71033fe45cc065e80cddb4b06583", "user_id": "8268eefe-e8f7-472e-ab2a-a92f0135d76d", "send_anonymous_usage_stats": true, "adapter_type": "bigquery"}, "nodes": {"seed.asana_integration_tests.project_task_data": {"raw_sql": "", "compiled": true, "resource_type": "seed", "depends_on": {"macros": [], "nodes": []}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "seed", "persist_docs": {}, "quoting": {}, "column_types": {"_fivetran_synced": "timestamp", "project_id": "int64", "task_id": "int64"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "quote_columns": false, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "asana_source_integration_source", "fqn": ["asana_integration_tests", "project_task_data"], "unique_id": "seed.asana_integration_tests.project_task_data", "package_name": "asana_integration_tests", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests", "path": "project_task_data.csv", "original_file_path": "seeds/project_task_data.csv", "name": "project_task_data", "alias": "project_task_data", "checksum": {"name": "sha256", "checksum": "b8ae363c3ab40609f8b5b0eee30e198bd124d781198ecda72e5409178aab17cd"}, "tags": [], "refs": [], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": null, "build_path": null, "deferred": false, "unrendered_config": {"quote_columns": "{{ true if target.type == 'redshift' else false }}", "column_types": {"project_id": "{{ 'int64' if target.type == 'bigquery' else 'bigint' }}", "task_id": "{{ 'int64' if target.type == 'bigquery' else 'bigint' }}"}}, "created_at": 1663600953.4323509, "compiled_sql": "", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`asana_source_integration_source`.`project_task_data`"}, "seed.asana_integration_tests.story_data": {"raw_sql": "", "compiled": true, "resource_type": "seed", "depends_on": {"macros": [], "nodes": []}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "seed", "persist_docs": {}, "quoting": {}, "column_types": {"_fivetran_synced": "timestamp", "id": "int64", "created_by_id": "int64", "target_id": "int64"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "quote_columns": false, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "asana_source_integration_source", "fqn": ["asana_integration_tests", "story_data"], "unique_id": "seed.asana_integration_tests.story_data", "package_name": "asana_integration_tests", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests", "path": "story_data.csv", "original_file_path": "seeds/story_data.csv", "name": "story_data", "alias": "story_data", "checksum": {"name": "sha256", "checksum": "207847a91c60ba0de1269fd0aef2a0e1f9d2c3e2b0fbae231ce69fce909dd15a"}, "tags": [], "refs": [], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": null, "build_path": null, "deferred": false, "unrendered_config": {"quote_columns": "{{ true if target.type == 'redshift' else false }}", "column_types": {"id": "{{ 'int64' if target.type == 'bigquery' else 'bigint' }}", "created_by_id": "{{ 'int64' if target.type == 'bigquery' else 'bigint' }}", "target_id": "{{ 'int64' if target.type == 'bigquery' else 'bigint' }}"}}, "created_at": 1663600953.4375548, "compiled_sql": "", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`asana_source_integration_source`.`story_data`"}, "seed.asana_integration_tests.task_tag_data": {"raw_sql": "", "compiled": true, "resource_type": "seed", "depends_on": {"macros": [], "nodes": []}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "seed", "persist_docs": {}, "quoting": {}, "column_types": {"_fivetran_synced": "timestamp", "tag_id": "int64", "task_id": "int64"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "quote_columns": false, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "asana_source_integration_source", "fqn": ["asana_integration_tests", "task_tag_data"], "unique_id": "seed.asana_integration_tests.task_tag_data", "package_name": "asana_integration_tests", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests", "path": "task_tag_data.csv", "original_file_path": "seeds/task_tag_data.csv", "name": "task_tag_data", "alias": "task_tag_data", "checksum": {"name": "sha256", "checksum": "0209673eda201e499fc6c588fbc799e08b44a60168cabaa4dc3cee39bb250cbd"}, "tags": [], "refs": [], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": null, "build_path": null, "deferred": false, "unrendered_config": {"quote_columns": "{{ true if target.type == 'redshift' else false }}", "column_types": {"tag_id": "{{ 'int64' if target.type == 'bigquery' else 'bigint' }}", "task_id": "{{ 'int64' if target.type == 'bigquery' else 'bigint' }}"}}, "created_at": 1663600953.438594, "compiled_sql": "", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`asana_source_integration_source`.`task_tag_data`"}, "seed.asana_integration_tests.task_section_data": {"raw_sql": "", "compiled": true, "resource_type": "seed", "depends_on": {"macros": [], "nodes": []}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "seed", "persist_docs": {}, "quoting": {}, "column_types": {"_fivetran_synced": "timestamp", "section_id": "int64", "task_id": "int64"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "quote_columns": false, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "asana_source_integration_source", "fqn": ["asana_integration_tests", "task_section_data"], "unique_id": "seed.asana_integration_tests.task_section_data", "package_name": "asana_integration_tests", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests", "path": "task_section_data.csv", "original_file_path": "seeds/task_section_data.csv", "name": "task_section_data", "alias": "task_section_data", "checksum": {"name": "sha256", "checksum": "d0aab9b6565fdb541b9ed5122d66cc9fad61287d3374d8af41c25eaf9bcd5805"}, "tags": [], "refs": [], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": null, "build_path": null, "deferred": false, "unrendered_config": {"quote_columns": "{{ true if target.type == 'redshift' else false }}", "column_types": {"section_id": "{{ 'int64' if target.type == 'bigquery' else 'bigint' }}", "task_id": "{{ 'int64' if target.type == 'bigquery' else 'bigint' }}"}}, "created_at": 1663600953.439598, "compiled_sql": "", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`asana_source_integration_source`.`task_section_data`"}, "seed.asana_integration_tests.task_data": {"raw_sql": "", "compiled": true, "resource_type": "seed", "depends_on": {"macros": [], "nodes": []}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "seed", "persist_docs": {}, "quoting": {}, "column_types": {"_fivetran_synced": "timestamp", "id": "int64", "assignee_id": "int64", "completed_by_id": "int64", "parent_id": "int64", "workspace_id": "int64", "completed_at": "timestamp", "created_at": "timestamp", "due_on": "timestamp", "due_at": "timestamp", "modified_at": "timestamp", "start_on": "timestamp"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "quote_columns": false, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "asana_source_integration_source", "fqn": ["asana_integration_tests", "task_data"], "unique_id": "seed.asana_integration_tests.task_data", "package_name": "asana_integration_tests", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests", "path": "task_data.csv", "original_file_path": "seeds/task_data.csv", "name": "task_data", "alias": "task_data", "checksum": {"name": "sha256", "checksum": "dc304269ae0d5003e65aa0b8f5be6093ec114874b7bca0bf4784ffed187338cd"}, "tags": [], "refs": [], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": null, "build_path": null, "deferred": false, "unrendered_config": {"quote_columns": "{{ true if target.type == 'redshift' else false }}", "column_types": {"id": "{{ 'int64' if target.type == 'bigquery' else 'bigint' }}", "assignee_id": "{{ 'int64' if target.type == 'bigquery' else 'bigint' }}", "completed_by_id": "{{ 'int64' if target.type == 'bigquery' else 'bigint' }}", "parent_id": "{{ 'int64' if target.type == 'bigquery' else 'bigint' }}", "workspace_id": "{{ 'int64' if target.type == 'bigquery' else 'bigint' }}", "completed_at": "timestamp", "created_at": "timestamp", "due_on": "timestamp", "due_at": "timestamp", "modified_at": "timestamp", "start_on": "timestamp", "_fivetran_synced": "timestamp"}}, "created_at": 1663600953.4407182, "compiled_sql": "", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`asana_source_integration_source`.`task_data`"}, "seed.asana_integration_tests.task_follower_data": {"raw_sql": "", "compiled": true, "resource_type": "seed", "depends_on": {"macros": [], "nodes": []}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "seed", "persist_docs": {}, "quoting": {}, "column_types": {"_fivetran_synced": "timestamp", "user_id": "int64", "task_id": "int64"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "quote_columns": false, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "asana_source_integration_source", "fqn": ["asana_integration_tests", "task_follower_data"], "unique_id": "seed.asana_integration_tests.task_follower_data", "package_name": "asana_integration_tests", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests", "path": "task_follower_data.csv", "original_file_path": "seeds/task_follower_data.csv", "name": "task_follower_data", "alias": "task_follower_data", "checksum": {"name": "sha256", "checksum": "6171210df6abad2ffba8ff8d10c1feb73c13c41c8e86b32e59f5aa29a4571678"}, "tags": [], "refs": [], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": null, "build_path": null, "deferred": false, "unrendered_config": {"quote_columns": "{{ true if target.type == 'redshift' else false }}", "column_types": {"user_id": "{{ 'int64' if target.type == 'bigquery' else 'bigint' }}", "task_id": "{{ 'int64' if target.type == 'bigquery' else 'bigint' }}"}}, "created_at": 1663600953.44172, "compiled_sql": "", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`asana_source_integration_source`.`task_follower_data`"}, "seed.asana_integration_tests.tag_data": {"raw_sql": "", "compiled": true, "resource_type": "seed", "depends_on": {"macros": [], "nodes": []}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "seed", "persist_docs": {}, "quoting": {}, "column_types": {"_fivetran_synced": "timestamp", "id": "int64", "workspace_id": "int64"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "quote_columns": false, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "asana_source_integration_source", "fqn": ["asana_integration_tests", "tag_data"], "unique_id": "seed.asana_integration_tests.tag_data", "package_name": "asana_integration_tests", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests", "path": "tag_data.csv", "original_file_path": "seeds/tag_data.csv", "name": "tag_data", "alias": "tag_data", "checksum": {"name": "sha256", "checksum": "e74c86b7fda7a484687ac7e16fd759233a2066632e6dd27acb481b0afa852548"}, "tags": [], "refs": [], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": null, "build_path": null, "deferred": false, "unrendered_config": {"quote_columns": "{{ true if target.type == 'redshift' else false }}", "column_types": {"id": "{{ 'int64' if target.type == 'bigquery' else 'bigint' }}", "workspace_id": "{{ 'int64' if target.type == 'bigquery' else 'bigint' }}"}}, "created_at": 1663600953.442703, "compiled_sql": "", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`asana_source_integration_source`.`tag_data`"}, "seed.asana_integration_tests.project_data": {"raw_sql": "", "compiled": true, "resource_type": "seed", "depends_on": {"macros": [], "nodes": []}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "seed", "persist_docs": {}, "quoting": {}, "column_types": {"_fivetran_synced": "timestamp", "id": "int64", "owner_id": "int64", "team_id": "int64", "workspace_id": "int64"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "quote_columns": false, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "asana_source_integration_source", "fqn": ["asana_integration_tests", "project_data"], "unique_id": "seed.asana_integration_tests.project_data", "package_name": "asana_integration_tests", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests", "path": "project_data.csv", "original_file_path": "seeds/project_data.csv", "name": "project_data", "alias": "project_data", "checksum": {"name": "sha256", "checksum": "cf12cd38b9bdb3ec36cac1757ae4a17e7a8dc4182cb65995ec3fc9b7c2668378"}, "tags": [], "refs": [], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": null, "build_path": null, "deferred": false, "unrendered_config": {"quote_columns": "{{ true if target.type == 'redshift' else false }}", "column_types": {"id": "{{ 'int64' if target.type == 'bigquery' else 'bigint' }}", "owner_id": "{{ 'int64' if target.type == 'bigquery' else 'bigint' }}", "team_id": "{{ 'int64' if target.type == 'bigquery' else 'bigint' }}", "workspace_id": "{{ 'int64' if target.type == 'bigquery' else 'bigint' }}"}}, "created_at": 1663600953.4436831, "compiled_sql": "", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`asana_source_integration_source`.`project_data`"}, "seed.asana_integration_tests.user_data": {"raw_sql": "", "compiled": true, "resource_type": "seed", "depends_on": {"macros": [], "nodes": []}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "seed", "persist_docs": {}, "quoting": {}, "column_types": {"_fivetran_synced": "timestamp", "id": "int64"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "quote_columns": false, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "asana_source_integration_source", "fqn": ["asana_integration_tests", "user_data"], "unique_id": "seed.asana_integration_tests.user_data", "package_name": "asana_integration_tests", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests", "path": "user_data.csv", "original_file_path": "seeds/user_data.csv", "name": "user_data", "alias": "user_data", "checksum": {"name": "sha256", "checksum": "237db906018d65bbeeb08bd57c3cd23a91428412a882a0b59994658d564a9ad3"}, "tags": [], "refs": [], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": null, "build_path": null, "deferred": false, "unrendered_config": {"quote_columns": "{{ true if target.type == 'redshift' else false }}", "column_types": {"id": "{{ 'int64' if target.type == 'bigquery' else 'bigint' }}"}}, "created_at": 1663600953.4447832, "compiled_sql": "", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`asana_source_integration_source`.`user_data`"}, "seed.asana_integration_tests.team_data": {"raw_sql": "", "compiled": true, "resource_type": "seed", "depends_on": {"macros": [], "nodes": []}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "seed", "persist_docs": {}, "quoting": {}, "column_types": {"_fivetran_synced": "timestamp", "id": "int64", "organization_id": "int64"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "quote_columns": false, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "asana_source_integration_source", "fqn": ["asana_integration_tests", "team_data"], "unique_id": "seed.asana_integration_tests.team_data", "package_name": "asana_integration_tests", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests", "path": "team_data.csv", "original_file_path": "seeds/team_data.csv", "name": "team_data", "alias": "team_data", "checksum": {"name": "sha256", "checksum": "96c14731f1382783fd83b114321e23b5c2813b94f96a6e5422a5aca66157a1cd"}, "tags": [], "refs": [], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": null, "build_path": null, "deferred": false, "unrendered_config": {"quote_columns": "{{ true if target.type == 'redshift' else false }}", "column_types": {"id": "{{ 'int64' if target.type == 'bigquery' else 'bigint' }}", "organization_id": "{{ 'int64' if target.type == 'bigquery' else 'bigint' }}"}}, "created_at": 1663600953.44576, "compiled_sql": "", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`asana_source_integration_source`.`team_data`"}, "seed.asana_integration_tests.section_data": {"raw_sql": "", "compiled": true, "resource_type": "seed", "depends_on": {"macros": [], "nodes": []}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "seed", "persist_docs": {}, "quoting": {}, "column_types": {"_fivetran_synced": "timestamp", "id": "int64", "project_id": "int64"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "quote_columns": false, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "asana_source_integration_source", "fqn": ["asana_integration_tests", "section_data"], "unique_id": "seed.asana_integration_tests.section_data", "package_name": "asana_integration_tests", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests", "path": "section_data.csv", "original_file_path": "seeds/section_data.csv", "name": "section_data", "alias": "section_data", "checksum": {"name": "sha256", "checksum": "ca6f6bf502e9d65fcbe59590756a42979e31af8bf1db841a9292b56512252bde"}, "tags": [], "refs": [], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": null, "build_path": null, "deferred": false, "unrendered_config": {"quote_columns": "{{ true if target.type == 'redshift' else false }}", "column_types": {"id": "{{ 'int64' if target.type == 'bigquery' else 'bigint' }}", "project_id": "{{ 'int64' if target.type == 'bigquery' else 'bigint' }}"}}, "created_at": 1663600953.4467359, "compiled_sql": "", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`asana_source_integration_source`.`section_data`"}, "model.asana_source.stg_asana__user": {"raw_sql": "with base as (\n\n select * \n from {{ ref('stg_asana__user_tmp') }}\n\n),\n\nfields as (\n\n select\n {{\n fivetran_utils.fill_staging_columns(\n source_columns=adapter.get_columns_in_relation(ref('stg_asana__user_tmp')),\n staging_columns=get_user_columns()\n )\n }}\n \n from base\n),\n\nfinal as (\n \n select \n id as user_id,\n email,\n name as user_name\n from fields\n where not coalesce(_fivetran_deleted, false)\n)\n\nselect * \nfrom final", "compiled": true, "resource_type": "model", "depends_on": {"macros": ["macro.asana_source.get_user_columns", "macro.fivetran_utils.fill_staging_columns"], "nodes": ["model.asana_source.stg_asana__user_tmp", "model.asana_source.stg_asana__user_tmp"]}, "config": {"enabled": true, "alias": null, "schema": "stg_asana", "database": null, "tags": [], "meta": {}, "materialized": "table", "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "asana_source_integration_source_stg_asana", "fqn": ["asana_source", "stg_asana__user"], "unique_id": "model.asana_source.stg_asana__user", "package_name": "asana_source", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/asana_source", "path": "stg_asana__user.sql", "original_file_path": "models/stg_asana__user.sql", "name": "stg_asana__user", "alias": "stg_asana__user", "checksum": {"name": "sha256", "checksum": "4e7279a7f3d7b9754c574de24021781c98bbbc1c0a99e0c7b3495c57a6d33e18"}, "tags": [], "refs": [["stg_asana__user_tmp"], ["stg_asana__user_tmp"]], "sources": [], "metrics": [], "description": "Table of all accounts in the organization", "columns": {"user_id": {"name": "user_id", "description": "System generated unique ID for each user", "meta": {}, "data_type": null, "quote": null, "tags": []}, "email": {"name": "email", "description": "The user's email", "meta": {}, "data_type": null, "quote": null, "tags": []}, "user_name": {"name": "user_name", "description": "The name of the user as it appears in the UI", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true}, "patch_path": "asana_source://models/stg_asana.yml", "compiled_path": "target/compiled/asana_source/models/stg_asana__user.sql", "build_path": null, "deferred": false, "unrendered_config": {"schema": "stg_asana", "materialized": "table"}, "created_at": 1663600953.721539, "compiled_sql": "with base as (\n\n select * \n from `dbt-package-testing`.`asana_source_integration_source_stg_asana`.`stg_asana__user_tmp`\n\n),\n\nfields as (\n\n select\n \n \n \n _fivetran_deleted\n \n as \n \n _fivetran_deleted\n \n, \n \n \n _fivetran_synced\n \n as \n \n _fivetran_synced\n \n, \n \n \n email\n \n as \n \n email\n \n, \n \n \n id\n \n as \n \n id\n \n, \n \n \n name\n \n as \n \n name\n \n\n\n\n \n from base\n),\n\nfinal as (\n \n select \n id as user_id,\n email,\n name as user_name\n from fields\n where not coalesce(_fivetran_deleted, false)\n)\n\nselect * \nfrom final", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`asana_source_integration_source_stg_asana`.`stg_asana__user`"}, "model.asana_source.stg_asana__task": {"raw_sql": "with base as (\n\n select * \n from {{ ref('stg_asana__task_tmp') }}\n\n),\n\nfields as (\n\n select\n {{\n fivetran_utils.fill_staging_columns(\n source_columns=adapter.get_columns_in_relation(ref('stg_asana__task_tmp')),\n staging_columns=get_task_columns()\n )\n }}\n\n --The below script allows for pass through columns.\n {% if var('task_pass_through_columns') %}\n ,\n {{ var('task_pass_through_columns') | join (\", \") }}\n\n {% endif %}\n\n from base\n),\n\nfinal as (\n \n select \n id as task_id,\n assignee_id as assignee_user_id,\n completed as is_completed,\n cast(completed_at as {{ dbt_utils.type_timestamp() }}) as completed_at,\n completed_by_id as completed_by_user_id,\n cast(created_at as {{ dbt_utils.type_timestamp() }}) as created_at,\n cast(coalesce(due_on, due_at) as {{ dbt_utils.type_timestamp() }}) as due_date,\n cast(modified_at as {{ dbt_utils.type_timestamp() }}) as modified_at,\n name as task_name,\n parent_id as parent_task_id,\n cast(start_on as {{ dbt_utils.type_timestamp() }}) as start_date,\n notes as task_description,\n liked as is_liked,\n num_likes as number_of_likes,\n workspace_id\n\n --The below script allows for pass through columns.\n {% if var('task_pass_through_columns') %}\n ,\n {{ var('task_pass_through_columns') | join (\", \") }}\n\n {% endif %}\n\n from fields\n)\n\nselect * \nfrom final", "compiled": true, "resource_type": "model", "depends_on": {"macros": ["macro.asana_source.get_task_columns", "macro.fivetran_utils.fill_staging_columns", "macro.dbt_utils.type_timestamp"], "nodes": ["model.asana_source.stg_asana__task_tmp", "model.asana_source.stg_asana__task_tmp"]}, "config": {"enabled": true, "alias": null, "schema": "stg_asana", "database": null, "tags": [], "meta": {}, "materialized": "table", "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "asana_source_integration_source_stg_asana", "fqn": ["asana_source", "stg_asana__task"], "unique_id": "model.asana_source.stg_asana__task", "package_name": "asana_source", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/asana_source", "path": "stg_asana__task.sql", "original_file_path": "models/stg_asana__task.sql", "name": "stg_asana__task", "alias": "stg_asana__task", "checksum": {"name": "sha256", "checksum": "4bb92596903425dccc83f90e2e240e6f2c1b71d014a093a6bb7430d24141bc12"}, "tags": [], "refs": [["stg_asana__task_tmp"], ["stg_asana__task_tmp"]], "sources": [], "metrics": [], "description": "Table containing all created tasks", "columns": {"task_id": {"name": "task_id", "description": "System generated unique ID of the task", "meta": {}, "data_type": null, "quote": null, "tags": []}, "assignee_user_id": {"name": "assignee_user_id", "description": "Foreign key referencing the USER that is currently assigned the task.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "assignee_status": {"name": "assignee_status", "description": "Scheduling status for the assignee that the task is or will eventually be assigned to. This maps to the sections of \"My Tasks\"", "meta": {}, "data_type": null, "quote": null, "tags": []}, "is_completed": {"name": "is_completed", "description": "Boolean that is true if the task is currently marked complete.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "completed_at": {"name": "completed_at", "description": "Timestamp of when the task was marked complete.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "completed_by_user_id": {"name": "completed_by_user_id", "description": "Foreign key referencing the USER who completed the task.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "created_at": {"name": "created_at", "description": "Timestamp of when the task was created", "meta": {}, "data_type": null, "quote": null, "tags": []}, "due_date": {"name": "due_date", "description": "Date the task is due, if provided.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "modified_at": {"name": "modified_at", "description": "Timestamp of when the task was last modified", "meta": {}, "data_type": null, "quote": null, "tags": []}, "task_name": {"name": "task_name", "description": "User-facing name of the task.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "parent_task_id": {"name": "parent_task_id", "description": "Self-referential id of the parent TASK that this is a subtask of.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "start_date": {"name": "start_date", "description": "The start date of the task, if a date range is given.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "task_description": {"name": "task_description", "description": "Free-form text describing the task, as seen in the UI.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "is_liked": {"name": "is_liked", "description": "A boolean that's true if the task has been liked.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "number_of_likes": {"name": "number_of_likes", "description": "An integer indicating the number of likes on a task.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "workspace_id": {"name": "workspace_id", "description": "ID of the organization's Asana workspace. Irrelevant unless working with multiple companies.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true}, "patch_path": "asana_source://models/stg_asana.yml", "compiled_path": "target/compiled/asana_source/models/stg_asana__task.sql", "build_path": null, "deferred": false, "unrendered_config": {"schema": "stg_asana", "materialized": "table"}, "created_at": 1663600953.718966, "compiled_sql": "with base as (\n\n select * \n from `dbt-package-testing`.`asana_source_integration_source_stg_asana`.`stg_asana__task_tmp`\n\n),\n\nfields as (\n\n select\n \n cast(null as \n timestamp\n) as \n \n _fivetran_synced\n \n , \n \n \n assignee_id\n \n as \n \n assignee_id\n \n, \n \n \n completed\n \n as \n \n completed\n \n, \n \n \n completed_at\n \n as \n \n completed_at\n \n, \n \n \n completed_by_id\n \n as \n \n completed_by_id\n \n, \n \n \n created_at\n \n as \n \n created_at\n \n, \n \n \n due_at\n \n as \n \n due_at\n \n, \n \n \n due_on\n \n as \n \n due_on\n \n, \n \n \n id\n \n as \n \n id\n \n, \n \n \n modified_at\n \n as \n \n modified_at\n \n, \n \n \n name\n \n as \n \n name\n \n, \n \n \n notes\n \n as \n \n notes\n \n, \n cast(null as boolean) as \n \n liked\n \n , \n cast(null as \n int64\n) as \n \n num_likes\n \n , \n \n \n parent_id\n \n as \n \n parent_id\n \n, \n \n \n start_on\n \n as \n \n start_on\n \n, \n \n \n workspace_id\n \n as \n \n workspace_id\n \n\n\n\n\n --The below script allows for pass through columns.\n \n\n from base\n),\n\nfinal as (\n \n select \n id as task_id,\n assignee_id as assignee_user_id,\n completed as is_completed,\n cast(completed_at as \n timestamp\n) as completed_at,\n completed_by_id as completed_by_user_id,\n cast(created_at as \n timestamp\n) as created_at,\n cast(coalesce(due_on, due_at) as \n timestamp\n) as due_date,\n cast(modified_at as \n timestamp\n) as modified_at,\n name as task_name,\n parent_id as parent_task_id,\n cast(start_on as \n timestamp\n) as start_date,\n notes as task_description,\n liked as is_liked,\n num_likes as number_of_likes,\n workspace_id\n\n --The below script allows for pass through columns.\n \n\n from fields\n)\n\nselect * \nfrom final", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`asana_source_integration_source_stg_asana`.`stg_asana__task`"}, "model.asana_source.stg_asana__task_section": {"raw_sql": "with base as (\n\n select * \n from {{ ref('stg_asana__task_section_tmp') }}\n\n),\n\nfields as (\n\n select\n {{\n fivetran_utils.fill_staging_columns(\n source_columns=adapter.get_columns_in_relation(ref('stg_asana__task_section_tmp')),\n staging_columns=get_task_section_columns()\n )\n }}\n \n from base\n),\n\nfinal as (\n \n select \n section_id,\n task_id\n from fields\n)\n\nselect * \nfrom final", "compiled": true, "resource_type": "model", "depends_on": {"macros": ["macro.asana_source.get_task_section_columns", "macro.fivetran_utils.fill_staging_columns"], "nodes": ["model.asana_source.stg_asana__task_section_tmp", "model.asana_source.stg_asana__task_section_tmp"]}, "config": {"enabled": true, "alias": null, "schema": "stg_asana", "database": null, "tags": [], "meta": {}, "materialized": "table", "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "asana_source_integration_source_stg_asana", "fqn": ["asana_source", "stg_asana__task_section"], "unique_id": "model.asana_source.stg_asana__task_section", "package_name": "asana_source", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/asana_source", "path": "stg_asana__task_section.sql", "original_file_path": "models/stg_asana__task_section.sql", "name": "stg_asana__task_section", "alias": "stg_asana__task_section", "checksum": {"name": "sha256", "checksum": "4ead107e3627f57920f45d190c273a0fe706c9f911998f67769818fcd1bb4797"}, "tags": [], "refs": [["stg_asana__task_section_tmp"], ["stg_asana__task_section_tmp"]], "sources": [], "metrics": [], "description": "Table of tasks and the section that they live under. Section-less tasks within projects appear here, but project-less tasks do not", "columns": {"task_id": {"name": "task_id", "description": "Foreign key referencing the ID of the TASK", "meta": {}, "data_type": null, "quote": null, "tags": []}, "section_id": {"name": "section_id", "description": "Foreign key referencing the ID of the SECTION housing the task", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true}, "patch_path": "asana_source://models/stg_asana.yml", "compiled_path": "target/compiled/asana_source/models/stg_asana__task_section.sql", "build_path": null, "deferred": false, "unrendered_config": {"schema": "stg_asana", "materialized": "table"}, "created_at": 1663600953.720015, "compiled_sql": "with base as (\n\n select * \n from `dbt-package-testing`.`asana_source_integration_source_stg_asana`.`stg_asana__task_section_tmp`\n\n),\n\nfields as (\n\n select\n \n \n \n _fivetran_synced\n \n as \n \n _fivetran_synced\n \n, \n \n \n section_id\n \n as \n \n section_id\n \n, \n \n \n task_id\n \n as \n \n task_id\n \n\n\n\n \n from base\n),\n\nfinal as (\n \n select \n section_id,\n task_id\n from fields\n)\n\nselect * \nfrom final", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`asana_source_integration_source_stg_asana`.`stg_asana__task_section`"}, "model.asana_source.stg_asana__section": {"raw_sql": "with base as (\n\n select * \n from {{ ref('stg_asana__section_tmp') }}\n\n),\n\nfields as (\n\n select\n {{\n fivetran_utils.fill_staging_columns(\n source_columns=adapter.get_columns_in_relation(ref('stg_asana__section_tmp')),\n staging_columns=get_section_columns()\n )\n }}\n \n from base\n),\n\nfinal as (\n \n select \n id as section_id,\n cast(created_at as {{ dbt_utils.type_timestamp() }}) as created_at,\n name as section_name,\n project_id\n from fields\n)\n\nselect * \nfrom final", "compiled": true, "resource_type": "model", "depends_on": {"macros": ["macro.asana_source.get_section_columns", "macro.fivetran_utils.fill_staging_columns", "macro.dbt_utils.type_timestamp"], "nodes": ["model.asana_source.stg_asana__section_tmp", "model.asana_source.stg_asana__section_tmp"]}, "config": {"enabled": true, "alias": null, "schema": "stg_asana", "database": null, "tags": [], "meta": {}, "materialized": "table", "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "asana_source_integration_source_stg_asana", "fqn": ["asana_source", "stg_asana__section"], "unique_id": "model.asana_source.stg_asana__section", "package_name": "asana_source", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/asana_source", "path": "stg_asana__section.sql", "original_file_path": "models/stg_asana__section.sql", "name": "stg_asana__section", "alias": "stg_asana__section", "checksum": {"name": "sha256", "checksum": "d90fc22f0ad567e89c16207ef5da6678c7f35c117d3643476d5f6a8faf4430ed"}, "tags": [], "refs": [["stg_asana__section_tmp"], ["stg_asana__section_tmp"]], "sources": [], "metrics": [], "description": "Table of all sections within projects. If tasks in a project are not in an explicit user-made section, a default section called \"(no section)\" is created here", "columns": {"section_id": {"name": "section_id", "description": "System-generated unique ID of the section", "meta": {}, "data_type": null, "quote": null, "tags": []}, "created_at": {"name": "created_at", "description": "Timestamp of when the section was created", "meta": {}, "data_type": null, "quote": null, "tags": []}, "section_name": {"name": "section_name", "description": "User-facing name of the section.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "project_id": {"name": "project_id", "description": "Foreign key referencing the id of the PROJECT the section lives in.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true}, "patch_path": "asana_source://models/stg_asana.yml", "compiled_path": "target/compiled/asana_source/models/stg_asana__section.sql", "build_path": null, "deferred": false, "unrendered_config": {"schema": "stg_asana", "materialized": "table"}, "created_at": 1663600953.715113, "compiled_sql": "with base as (\n\n select * \n from `dbt-package-testing`.`asana_source_integration_source_stg_asana`.`stg_asana__section_tmp`\n\n),\n\nfields as (\n\n select\n \n \n \n _fivetran_synced\n \n as \n \n _fivetran_synced\n \n, \n \n \n created_at\n \n as \n \n created_at\n \n, \n \n \n id\n \n as \n \n id\n \n, \n \n \n name\n \n as \n \n name\n \n, \n \n \n project_id\n \n as \n \n project_id\n \n\n\n\n \n from base\n),\n\nfinal as (\n \n select \n id as section_id,\n cast(created_at as \n timestamp\n) as created_at,\n name as section_name,\n project_id\n from fields\n)\n\nselect * \nfrom final", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`asana_source_integration_source_stg_asana`.`stg_asana__section`"}, "model.asana_source.stg_asana__team": {"raw_sql": "with base as (\n\n select * \n from {{ ref('stg_asana__team_tmp') }}\n\n),\n\nfields as (\n\n select\n {{\n fivetran_utils.fill_staging_columns(\n source_columns=adapter.get_columns_in_relation(ref('stg_asana__team_tmp')),\n staging_columns=get_team_columns()\n )\n }}\n \n from base\n),\n\nfinal as (\n \n select \n id as team_id,\n name as team_name\n from fields\n where not coalesce(_fivetran_deleted, false)\n)\n\nselect * \nfrom final", "compiled": true, "resource_type": "model", "depends_on": {"macros": ["macro.asana_source.get_team_columns", "macro.fivetran_utils.fill_staging_columns"], "nodes": ["model.asana_source.stg_asana__team_tmp", "model.asana_source.stg_asana__team_tmp"]}, "config": {"enabled": true, "alias": null, "schema": "stg_asana", "database": null, "tags": [], "meta": {}, "materialized": "table", "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "asana_source_integration_source_stg_asana", "fqn": ["asana_source", "stg_asana__team"], "unique_id": "model.asana_source.stg_asana__team", "package_name": "asana_source", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/asana_source", "path": "stg_asana__team.sql", "original_file_path": "models/stg_asana__team.sql", "name": "stg_asana__team", "alias": "stg_asana__team", "checksum": {"name": "sha256", "checksum": "d2a65dca096a0320f59cc16346eb1854a1bc78135e11eb6b010fcc41fc49e4a0"}, "tags": [], "refs": [["stg_asana__team_tmp"], ["stg_asana__team_tmp"]], "sources": [], "metrics": [], "description": "Table of the teams within the organization", "columns": {"team_id": {"name": "team_id", "description": "System generated unique ID for each team", "meta": {}, "data_type": null, "quote": null, "tags": []}, "team_name": {"name": "team_name", "description": "User-facing name of the team", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true}, "patch_path": "asana_source://models/stg_asana.yml", "compiled_path": "target/compiled/asana_source/models/stg_asana__team.sql", "build_path": null, "deferred": false, "unrendered_config": {"schema": "stg_asana", "materialized": "table"}, "created_at": 1663600953.720953, "compiled_sql": "with base as (\n\n select * \n from `dbt-package-testing`.`asana_source_integration_source_stg_asana`.`stg_asana__team_tmp`\n\n),\n\nfields as (\n\n select\n \n \n \n _fivetran_deleted\n \n as \n \n _fivetran_deleted\n \n, \n \n \n _fivetran_synced\n \n as \n \n _fivetran_synced\n \n, \n \n \n id\n \n as \n \n id\n \n, \n \n \n name\n \n as \n \n name\n \n, \n \n \n organization_id\n \n as \n \n organization_id\n \n\n\n\n \n from base\n),\n\nfinal as (\n \n select \n id as team_id,\n name as team_name\n from fields\n where not coalesce(_fivetran_deleted, false)\n)\n\nselect * \nfrom final", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`asana_source_integration_source_stg_asana`.`stg_asana__team`"}, "model.asana_source.stg_asana__task_tag": {"raw_sql": "with base as (\n\n select * \n from {{ ref('stg_asana__task_tag_tmp') }}\n\n),\n\nfields as (\n\n select\n {{\n fivetran_utils.fill_staging_columns(\n source_columns=adapter.get_columns_in_relation(ref('stg_asana__task_tag_tmp')),\n staging_columns=get_task_tag_columns()\n )\n }}\n \n from base\n),\n\nfinal as (\n \n select \n tag_id,\n task_id\n from fields\n)\n\nselect * \nfrom final", "compiled": true, "resource_type": "model", "depends_on": {"macros": ["macro.asana_source.get_task_tag_columns", "macro.fivetran_utils.fill_staging_columns"], "nodes": ["model.asana_source.stg_asana__task_tag_tmp", "model.asana_source.stg_asana__task_tag_tmp"]}, "config": {"enabled": true, "alias": null, "schema": "stg_asana", "database": null, "tags": [], "meta": {}, "materialized": "table", "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "asana_source_integration_source_stg_asana", "fqn": ["asana_source", "stg_asana__task_tag"], "unique_id": "model.asana_source.stg_asana__task_tag", "package_name": "asana_source", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/asana_source", "path": "stg_asana__task_tag.sql", "original_file_path": "models/stg_asana__task_tag.sql", "name": "stg_asana__task_tag", "alias": "stg_asana__task_tag", "checksum": {"name": "sha256", "checksum": "7eba4b0f2dabd68e0a77d515c8406bb57bd6263b9ef551de3f06eded4c085de8"}, "tags": [], "refs": [["stg_asana__task_tag_tmp"], ["stg_asana__task_tag_tmp"]], "sources": [], "metrics": [], "description": "Table of tasks with the tags attached to them. Tasks without tags (and vice versa) do not appear here.", "columns": {"tag_id": {"name": "tag_id", "description": "Foreign key referencing the ID of the TAG attached to the task", "meta": {}, "data_type": null, "quote": null, "tags": []}, "task_id": {"name": "task_id", "description": "Foreign key referencing the ID of the TASK", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true}, "patch_path": "asana_source://models/stg_asana.yml", "compiled_path": "target/compiled/asana_source/models/stg_asana__task_tag.sql", "build_path": null, "deferred": false, "unrendered_config": {"schema": "stg_asana", "materialized": "table"}, "created_at": 1663600953.72049, "compiled_sql": "with base as (\n\n select * \n from `dbt-package-testing`.`asana_source_integration_source_stg_asana`.`stg_asana__task_tag_tmp`\n\n),\n\nfields as (\n\n select\n \n \n \n _fivetran_synced\n \n as \n \n _fivetran_synced\n \n, \n \n \n tag_id\n \n as \n \n tag_id\n \n, \n \n \n task_id\n \n as \n \n task_id\n \n\n\n\n \n from base\n),\n\nfinal as (\n \n select \n tag_id,\n task_id\n from fields\n)\n\nselect * \nfrom final", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`asana_source_integration_source_stg_asana`.`stg_asana__task_tag`"}, "model.asana_source.stg_asana__story": {"raw_sql": "with base as (\n\n select * \n from {{ ref('stg_asana__story_tmp') }}\n\n),\n\nfields as (\n\n select\n {{\n fivetran_utils.fill_staging_columns(\n source_columns=adapter.get_columns_in_relation(ref('stg_asana__story_tmp')),\n staging_columns=get_story_columns()\n )\n }}\n \n from base\n),\n\nfinal as (\n \n select \n id as story_id,\n cast(created_at as {{ dbt_utils.type_timestamp() }}) as created_at,\n created_by_id as created_by_user_id,\n target_id as target_task_id,\n text as story_content,\n type as event_type\n from fields\n)\n\nselect * \nfrom final", "compiled": true, "resource_type": "model", "depends_on": {"macros": ["macro.asana_source.get_story_columns", "macro.fivetran_utils.fill_staging_columns", "macro.dbt_utils.type_timestamp"], "nodes": ["model.asana_source.stg_asana__story_tmp", "model.asana_source.stg_asana__story_tmp"]}, "config": {"enabled": true, "alias": null, "schema": "stg_asana", "database": null, "tags": [], "meta": {}, "materialized": "table", "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "asana_source_integration_source_stg_asana", "fqn": ["asana_source", "stg_asana__story"], "unique_id": "model.asana_source.stg_asana__story", "package_name": "asana_source", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/asana_source", "path": "stg_asana__story.sql", "original_file_path": "models/stg_asana__story.sql", "name": "stg_asana__story", "alias": "stg_asana__story", "checksum": {"name": "sha256", "checksum": "1fa40f6bf001564761cfc1ba5373109afe18723902d8c52c36b185ac524aa7b4"}, "tags": [], "refs": [["stg_asana__story_tmp"], ["stg_asana__story_tmp"]], "sources": [], "metrics": [], "description": "Table containing all stories -- stories are actions taken on tasks", "columns": {"story_id": {"name": "story_id", "description": "System generated unique ID of the story/action taken on a task.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "created_at": {"name": "created_at", "description": "Timestamp of when the story occurred.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "created_by_user_id": {"name": "created_by_user_id", "description": "Foreign key referencing the USER who took the action (sometimes null)", "meta": {}, "data_type": null, "quote": null, "tags": []}, "target_task_id": {"name": "target_task_id", "description": "Foreign key referencing the TASK that the action was taken on.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "story_content": {"name": "story_content", "description": "Free-form text that is either the content of a comment (event_type=comment) or the description of an action (event_type=system)", "meta": {}, "data_type": null, "quote": null, "tags": []}, "event_type": {"name": "event_type", "description": "The origin type of the story - a comment or change to the backend (ie altering a task somehow)", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true}, "patch_path": "asana_source://models/stg_asana.yml", "compiled_path": "target/compiled/asana_source/models/stg_asana__story.sql", "build_path": null, "deferred": false, "unrendered_config": {"schema": "stg_asana", "materialized": "table"}, "created_at": 1663600953.716102, "compiled_sql": "with base as (\n\n select * \n from `dbt-package-testing`.`asana_source_integration_source_stg_asana`.`stg_asana__story_tmp`\n\n),\n\nfields as (\n\n select\n \n \n \n _fivetran_synced\n \n as \n \n _fivetran_synced\n \n, \n \n \n created_at\n \n as \n \n created_at\n \n, \n \n \n created_by_id\n \n as \n \n created_by_id\n \n, \n \n \n hearted\n \n as \n \n hearted\n \n, \n \n \n id\n \n as \n \n id\n \n, \n \n \n num_hearts\n \n as \n \n num_hearts\n \n, \n \n \n source\n \n as \n \n source\n \n, \n \n \n target_id\n \n as \n \n target_id\n \n, \n \n \n text\n \n as \n \n text\n \n, \n \n \n type\n \n as \n \n type\n \n\n\n\n \n from base\n),\n\nfinal as (\n \n select \n id as story_id,\n cast(created_at as \n timestamp\n) as created_at,\n created_by_id as created_by_user_id,\n target_id as target_task_id,\n text as story_content,\n type as event_type\n from fields\n)\n\nselect * \nfrom final", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`asana_source_integration_source_stg_asana`.`stg_asana__story`"}, "model.asana_source.stg_asana__tag": {"raw_sql": "with base as (\n\n select * \n from {{ ref('stg_asana__tag_tmp') }}\n\n),\n\nfields as (\n\n select\n {{\n fivetran_utils.fill_staging_columns(\n source_columns=adapter.get_columns_in_relation(ref('stg_asana__tag_tmp')),\n staging_columns=get_tag_columns()\n )\n }}\n \n from base\n),\n\nfinal as (\n \n select \n id as tag_id,\n name as tag_name,\n cast(created_at as {{ dbt_utils.type_timestamp() }}) as created_at\n from fields\n where not _fivetran_deleted\n)\n\nselect * \nfrom final", "compiled": true, "resource_type": "model", "depends_on": {"macros": ["macro.asana_source.get_tag_columns", "macro.fivetran_utils.fill_staging_columns", "macro.dbt_utils.type_timestamp"], "nodes": ["model.asana_source.stg_asana__tag_tmp", "model.asana_source.stg_asana__tag_tmp"]}, "config": {"enabled": true, "alias": null, "schema": "stg_asana", "database": null, "tags": [], "meta": {}, "materialized": "table", "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "asana_source_integration_source_stg_asana", "fqn": ["asana_source", "stg_asana__tag"], "unique_id": "model.asana_source.stg_asana__tag", "package_name": "asana_source", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/asana_source", "path": "stg_asana__tag.sql", "original_file_path": "models/stg_asana__tag.sql", "name": "stg_asana__tag", "alias": "stg_asana__tag", "checksum": {"name": "sha256", "checksum": "6199a35888ae80d4da05e4d46bc37ee0fe959b2a2bcc551f13d35f4b55626af7"}, "tags": [], "refs": [["stg_asana__tag_tmp"], ["stg_asana__tag_tmp"]], "sources": [], "metrics": [], "description": "Table of the custom tags made in the organization", "columns": {"tag_id": {"name": "tag_id", "description": "System generated unique ID of the tag", "meta": {}, "data_type": null, "quote": null, "tags": []}, "tag_name": {"name": "tag_name", "description": "User-facing name of the tag.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "created_at": {"name": "created_at", "description": "Timestamp of when the tag was created", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true}, "patch_path": "asana_source://models/stg_asana.yml", "compiled_path": "target/compiled/asana_source/models/stg_asana__tag.sql", "build_path": null, "deferred": false, "unrendered_config": {"schema": "stg_asana", "materialized": "table"}, "created_at": 1663600953.716696, "compiled_sql": "with base as (\n\n select * \n from `dbt-package-testing`.`asana_source_integration_source_stg_asana`.`stg_asana__tag_tmp`\n\n),\n\nfields as (\n\n select\n \n \n \n _fivetran_deleted\n \n as \n \n _fivetran_deleted\n \n, \n \n \n _fivetran_synced\n \n as \n \n _fivetran_synced\n \n, \n \n \n color\n \n as \n \n color\n \n, \n \n \n created_at\n \n as \n \n created_at\n \n, \n \n \n id\n \n as \n \n id\n \n, \n \n \n message\n \n as \n \n message\n \n, \n \n \n name\n \n as \n \n name\n \n, \n \n \n notes\n \n as \n \n notes\n \n, \n \n \n workspace_id\n \n as \n \n workspace_id\n \n\n\n\n \n from base\n),\n\nfinal as (\n \n select \n id as tag_id,\n name as tag_name,\n cast(created_at as \n timestamp\n) as created_at\n from fields\n where not _fivetran_deleted\n)\n\nselect * \nfrom final", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`asana_source_integration_source_stg_asana`.`stg_asana__tag`"}, "model.asana_source.stg_asana__project_task": {"raw_sql": "with base as (\n\n select * \n from {{ ref('stg_asana__project_task_tmp') }}\n\n),\n\nfields as (\n\n select\n {{\n fivetran_utils.fill_staging_columns(\n source_columns=adapter.get_columns_in_relation(ref('stg_asana__project_task_tmp')),\n staging_columns=get_project_task_columns()\n )\n }}\n \n from base\n),\n\nfinal as (\n \n select \n project_id,\n task_id\n from fields\n)\n\nselect * \nfrom final", "compiled": true, "resource_type": "model", "depends_on": {"macros": ["macro.asana_source.get_project_task_columns", "macro.fivetran_utils.fill_staging_columns"], "nodes": ["model.asana_source.stg_asana__project_task_tmp", "model.asana_source.stg_asana__project_task_tmp"]}, "config": {"enabled": true, "alias": null, "schema": "stg_asana", "database": null, "tags": [], "meta": {}, "materialized": "table", "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "asana_source_integration_source_stg_asana", "fqn": ["asana_source", "stg_asana__project_task"], "unique_id": "model.asana_source.stg_asana__project_task", "package_name": "asana_source", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/asana_source", "path": "stg_asana__project_task.sql", "original_file_path": "models/stg_asana__project_task.sql", "name": "stg_asana__project_task", "alias": "stg_asana__project_task", "checksum": {"name": "sha256", "checksum": "95153bcb4c7e9ccc7302710d14cf8d8120817eece7378f1f7c26f27b48129469"}, "tags": [], "refs": [["stg_asana__project_task_tmp"], ["stg_asana__project_task_tmp"]], "sources": [], "metrics": [], "description": "Table of tasks and the project(s) they each belong to. If a project doesn't have a task, it won't be in here (and vice versa)", "columns": {"project_id": {"name": "project_id", "description": "Foreign key referencing the ID of the PROJECT", "meta": {}, "data_type": null, "quote": null, "tags": []}, "task_id": {"name": "task_id", "description": "Foreign key referencing the ID of the TASK", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true}, "patch_path": "asana_source://models/stg_asana.yml", "compiled_path": "target/compiled/asana_source/models/stg_asana__project_task.sql", "build_path": null, "deferred": false, "unrendered_config": {"schema": "stg_asana", "materialized": "table"}, "created_at": 1663600953.714299, "compiled_sql": "with base as (\n\n select * \n from `dbt-package-testing`.`asana_source_integration_source_stg_asana`.`stg_asana__project_task_tmp`\n\n),\n\nfields as (\n\n select\n \n \n \n _fivetran_synced\n \n as \n \n _fivetran_synced\n \n, \n \n \n project_id\n \n as \n \n project_id\n \n, \n \n \n task_id\n \n as \n \n task_id\n \n\n\n\n \n from base\n),\n\nfinal as (\n \n select \n project_id,\n task_id\n from fields\n)\n\nselect * \nfrom final", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`asana_source_integration_source_stg_asana`.`stg_asana__project_task`"}, "model.asana_source.stg_asana__project": {"raw_sql": "with base as (\n\n select * \n from {{ ref('stg_asana__project_tmp') }}\n\n),\n\nfields as (\n\n select\n {{\n fivetran_utils.fill_staging_columns(\n source_columns=adapter.get_columns_in_relation(ref('stg_asana__project_tmp')),\n staging_columns=get_project_columns()\n )\n }}\n \n from base\n),\n\nfinal as (\n \n select \n id as project_id,\n archived as is_archived,\n cast(created_at as {{ dbt_utils.type_timestamp() }}) as created_at,\n current_status,\n cast(due_date as {{ dbt_utils.type_timestamp() }}) as due_date,\n cast(modified_at as {{ dbt_utils.type_timestamp() }}) as modified_at,\n name as project_name,\n owner_id as owner_user_id,\n public as is_public,\n team_id,\n workspace_id,\n notes\n from fields\n)\n\nselect * \nfrom final", "compiled": true, "resource_type": "model", "depends_on": {"macros": ["macro.asana_source.get_project_columns", "macro.fivetran_utils.fill_staging_columns", "macro.dbt_utils.type_timestamp"], "nodes": ["model.asana_source.stg_asana__project_tmp", "model.asana_source.stg_asana__project_tmp"]}, "config": {"enabled": true, "alias": null, "schema": "stg_asana", "database": null, "tags": [], "meta": {}, "materialized": "table", "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "asana_source_integration_source_stg_asana", "fqn": ["asana_source", "stg_asana__project"], "unique_id": "model.asana_source.stg_asana__project", "package_name": "asana_source", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/asana_source", "path": "stg_asana__project.sql", "original_file_path": "models/stg_asana__project.sql", "name": "stg_asana__project", "alias": "stg_asana__project", "checksum": {"name": "sha256", "checksum": "c202c4b1e9ebbe9d78f68770559d8e03deb4a46d53fb311f098205c5e45720de"}, "tags": [], "refs": [["stg_asana__project_tmp"], ["stg_asana__project_tmp"]], "sources": [], "metrics": [], "description": "Table containing all projects", "columns": {"project_id": {"name": "project_id", "description": "System-generated unique ID of the project", "meta": {}, "data_type": null, "quote": null, "tags": []}, "is_archived": {"name": "is_archived", "description": "Boolean representing if the project has been archived in the UI", "meta": {}, "data_type": null, "quote": null, "tags": []}, "created_at": {"name": "created_at", "description": "Timestamp of when the project was created", "meta": {}, "data_type": null, "quote": null, "tags": []}, "current_status": {"name": "current_status", "description": "The most recent progress status update for the project (free-form string)", "meta": {}, "data_type": null, "quote": null, "tags": []}, "due_date": {"name": "due_date", "description": "The date the project is due on, if given", "meta": {}, "data_type": null, "quote": null, "tags": []}, "modified_at": {"name": "modified_at", "description": "Timestamp of when the project was last modified (doesn't include comments or tasks)", "meta": {}, "data_type": null, "quote": null, "tags": []}, "project_name": {"name": "project_name", "description": "The user-facing name of the project", "meta": {}, "data_type": null, "quote": null, "tags": []}, "owner_user_id": {"name": "owner_user_id", "description": "Foreign key referencing the USER who owns the project.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "is_public": {"name": "is_public", "description": "Boolean that is true if the project is public to all users in the organization", "meta": {}, "data_type": null, "quote": null, "tags": []}, "team_id": {"name": "team_id", "description": "Foreign key referencing the TEAM that the project is shared with.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "workspace_id": {"name": "workspace_id", "description": "The ID of the organization's entire Asana workspace. Not relevant unless you're looking at multiple orgs", "meta": {}, "data_type": null, "quote": null, "tags": []}, "notes": {"name": "notes", "description": "Free-form textual notes associated with the project.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true}, "patch_path": "asana_source://models/stg_asana.yml", "compiled_path": "target/compiled/asana_source/models/stg_asana__project.sql", "build_path": null, "deferred": false, "unrendered_config": {"schema": "stg_asana", "materialized": "table"}, "created_at": 1663600953.71374, "compiled_sql": "with base as (\n\n select * \n from `dbt-package-testing`.`asana_source_integration_source_stg_asana`.`stg_asana__project_tmp`\n\n),\n\nfields as (\n\n select\n \n \n \n _fivetran_deleted\n \n as \n \n _fivetran_deleted\n \n, \n \n \n _fivetran_synced\n \n as \n \n _fivetran_synced\n \n, \n \n \n archived\n \n as \n \n archived\n \n, \n \n \n color\n \n as \n \n color\n \n, \n \n \n created_at\n \n as \n \n created_at\n \n, \n \n \n current_status\n \n as \n \n current_status\n \n, \n \n \n due_date\n \n as \n \n due_date\n \n, \n \n \n id\n \n as \n \n id\n \n, \n \n \n modified_at\n \n as \n \n modified_at\n \n, \n \n \n name\n \n as \n \n name\n \n, \n \n \n notes\n \n as \n \n notes\n \n, \n \n \n owner_id\n \n as \n \n owner_id\n \n, \n \n \n public\n \n as \n \n public\n \n, \n \n \n team_id\n \n as \n \n team_id\n \n, \n \n \n workspace_id\n \n as \n \n workspace_id\n \n\n\n\n \n from base\n),\n\nfinal as (\n \n select \n id as project_id,\n archived as is_archived,\n cast(created_at as \n timestamp\n) as created_at,\n current_status,\n cast(due_date as \n timestamp\n) as due_date,\n cast(modified_at as \n timestamp\n) as modified_at,\n name as project_name,\n owner_id as owner_user_id,\n public as is_public,\n team_id,\n workspace_id,\n notes\n from fields\n)\n\nselect * \nfrom final", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`asana_source_integration_source_stg_asana`.`stg_asana__project`"}, "model.asana_source.stg_asana__task_follower": {"raw_sql": "with base as (\n\n select * \n from {{ ref('stg_asana__task_follower_tmp') }}\n\n),\n\nfields as (\n\n select\n {{\n fivetran_utils.fill_staging_columns(\n source_columns=adapter.get_columns_in_relation(ref('stg_asana__task_follower_tmp')),\n staging_columns=get_task_follower_columns()\n )\n }}\n \n from base\n),\n\nfinal as (\n \n select \n task_id,\n user_id\n from fields\n)\n\nselect * \nfrom final", "compiled": true, "resource_type": "model", "depends_on": {"macros": ["macro.asana_source.get_task_follower_columns", "macro.fivetran_utils.fill_staging_columns"], "nodes": ["model.asana_source.stg_asana__task_follower_tmp", "model.asana_source.stg_asana__task_follower_tmp"]}, "config": {"enabled": true, "alias": null, "schema": "stg_asana", "database": null, "tags": [], "meta": {}, "materialized": "table", "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "asana_source_integration_source_stg_asana", "fqn": ["asana_source", "stg_asana__task_follower"], "unique_id": "model.asana_source.stg_asana__task_follower", "package_name": "asana_source", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/asana_source", "path": "stg_asana__task_follower.sql", "original_file_path": "models/stg_asana__task_follower.sql", "name": "stg_asana__task_follower", "alias": "stg_asana__task_follower", "checksum": {"name": "sha256", "checksum": "8eb6b3969960cac92d44612ecb9f7486545bb7e92bcf1c96064a4f384ffed3e4"}, "tags": [], "refs": [["stg_asana__task_follower_tmp"], ["stg_asana__task_follower_tmp"]], "sources": [], "metrics": [], "description": "Table of tasks with the users that are following them. Tasks without users do not appear here.", "columns": {"task_id": {"name": "task_id", "description": "Foreign key referencing the ID of the TASK being followed.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "user_id": {"name": "user_id", "description": "Foreign key referencing the ID of the USER following the task.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true}, "patch_path": "asana_source://models/stg_asana.yml", "compiled_path": "target/compiled/asana_source/models/stg_asana__task_follower.sql", "build_path": null, "deferred": false, "unrendered_config": {"schema": "stg_asana", "materialized": "table"}, "created_at": 1663600953.719528, "compiled_sql": "with base as (\n\n select * \n from `dbt-package-testing`.`asana_source_integration_source_stg_asana`.`stg_asana__task_follower_tmp`\n\n),\n\nfields as (\n\n select\n \n \n \n _fivetran_synced\n \n as \n \n _fivetran_synced\n \n, \n \n \n task_id\n \n as \n \n task_id\n \n, \n \n \n user_id\n \n as \n \n user_id\n \n\n\n\n \n from base\n),\n\nfinal as (\n \n select \n task_id,\n user_id\n from fields\n)\n\nselect * \nfrom final", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`asana_source_integration_source_stg_asana`.`stg_asana__task_follower`"}, "model.asana_source.stg_asana__story_tmp": {"raw_sql": "select * \nfrom {{ var('story') }}", "compiled": true, "resource_type": "model", "depends_on": {"macros": [], "nodes": ["source.asana_source.asana.story"]}, "config": {"enabled": true, "alias": null, "schema": "stg_asana", "database": null, "tags": [], "meta": {}, "materialized": "table", "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "asana_source_integration_source_stg_asana", "fqn": ["asana_source", "tmp", "stg_asana__story_tmp"], "unique_id": "model.asana_source.stg_asana__story_tmp", "package_name": "asana_source", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/asana_source", "path": "tmp/stg_asana__story_tmp.sql", "original_file_path": "models/tmp/stg_asana__story_tmp.sql", "name": "stg_asana__story_tmp", "alias": "stg_asana__story_tmp", "checksum": {"name": "sha256", "checksum": "699a08f0282626b405f0b4e5216cdbaa879e399314594a61b63ff4a7b042f677"}, "tags": [], "refs": [], "sources": [["asana", "story"]], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/asana_source/models/tmp/stg_asana__story_tmp.sql", "build_path": null, "deferred": false, "unrendered_config": {"schema": "stg_asana", "materialized": "table"}, "created_at": 1663600953.54546, "compiled_sql": "select * \nfrom `dbt-package-testing`.`asana_integrations_tests`.`story_data`", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`asana_source_integration_source_stg_asana`.`stg_asana__story_tmp`"}, "model.asana_source.stg_asana__team_tmp": {"raw_sql": "select * \nfrom {{ var('team') }}", "compiled": true, "resource_type": "model", "depends_on": {"macros": [], "nodes": ["source.asana_source.asana.team"]}, "config": {"enabled": true, "alias": null, "schema": "stg_asana", "database": null, "tags": [], "meta": {}, "materialized": "table", "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "asana_source_integration_source_stg_asana", "fqn": ["asana_source", "tmp", "stg_asana__team_tmp"], "unique_id": "model.asana_source.stg_asana__team_tmp", "package_name": "asana_source", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/asana_source", "path": "tmp/stg_asana__team_tmp.sql", "original_file_path": "models/tmp/stg_asana__team_tmp.sql", "name": "stg_asana__team_tmp", "alias": "stg_asana__team_tmp", "checksum": {"name": "sha256", "checksum": "8c107692c9394962da82e0c2460045e6686d962c1eefe0cff564c618aed7a17d"}, "tags": [], "refs": [], "sources": [["asana", "team"]], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/asana_source/models/tmp/stg_asana__team_tmp.sql", "build_path": null, "deferred": false, "unrendered_config": {"schema": "stg_asana", "materialized": "table"}, "created_at": 1663600953.550893, "compiled_sql": "select * \nfrom `dbt-package-testing`.`asana_integrations_tests`.`team_data`", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`asana_source_integration_source_stg_asana`.`stg_asana__team_tmp`"}, "model.asana_source.stg_asana__task_tmp": {"raw_sql": "select * \nfrom {{ var('task') }}", "compiled": true, "resource_type": "model", "depends_on": {"macros": [], "nodes": ["source.asana_source.asana.task"]}, "config": {"enabled": true, "alias": null, "schema": "stg_asana", "database": null, "tags": [], "meta": {}, "materialized": "table", "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "asana_source_integration_source_stg_asana", "fqn": ["asana_source", "tmp", "stg_asana__task_tmp"], "unique_id": "model.asana_source.stg_asana__task_tmp", "package_name": "asana_source", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/asana_source", "path": "tmp/stg_asana__task_tmp.sql", "original_file_path": "models/tmp/stg_asana__task_tmp.sql", "name": "stg_asana__task_tmp", "alias": "stg_asana__task_tmp", "checksum": {"name": "sha256", "checksum": "ffb26301a2c952951441cf068b916101fb5cbb9841242e3511499262ffabd879"}, "tags": [], "refs": [], "sources": [["asana", "task"]], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/asana_source/models/tmp/stg_asana__task_tmp.sql", "build_path": null, "deferred": false, "unrendered_config": {"schema": "stg_asana", "materialized": "table"}, "created_at": 1663600953.553768, "compiled_sql": "select * \nfrom `dbt-package-testing`.`asana_integrations_tests`.`task_data`", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`asana_source_integration_source_stg_asana`.`stg_asana__task_tmp`"}, "model.asana_source.stg_asana__task_follower_tmp": {"raw_sql": "select * \nfrom {{ var('task_follower') }}", "compiled": true, "resource_type": "model", "depends_on": {"macros": [], "nodes": ["source.asana_source.asana.task_follower"]}, "config": {"enabled": true, "alias": null, "schema": "stg_asana", "database": null, "tags": [], "meta": {}, "materialized": "table", "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "asana_source_integration_source_stg_asana", "fqn": ["asana_source", "tmp", "stg_asana__task_follower_tmp"], "unique_id": "model.asana_source.stg_asana__task_follower_tmp", "package_name": "asana_source", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/asana_source", "path": "tmp/stg_asana__task_follower_tmp.sql", "original_file_path": "models/tmp/stg_asana__task_follower_tmp.sql", "name": "stg_asana__task_follower_tmp", "alias": "stg_asana__task_follower_tmp", "checksum": {"name": "sha256", "checksum": "d03af085dd9a99b6a0d491b3729504de132fe2a3c8b930f72cb6d6774f714896"}, "tags": [], "refs": [], "sources": [["asana", "task_follower"]], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/asana_source/models/tmp/stg_asana__task_follower_tmp.sql", "build_path": null, "deferred": false, "unrendered_config": {"schema": "stg_asana", "materialized": "table"}, "created_at": 1663600953.55668, "compiled_sql": "select * \nfrom `dbt-package-testing`.`asana_integrations_tests`.`task_follower_data`", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`asana_source_integration_source_stg_asana`.`stg_asana__task_follower_tmp`"}, "model.asana_source.stg_asana__tag_tmp": {"raw_sql": "select * \nfrom {{ var('tag') }}", "compiled": true, "resource_type": "model", "depends_on": {"macros": [], "nodes": ["source.asana_source.asana.tag"]}, "config": {"enabled": true, "alias": null, "schema": "stg_asana", "database": null, "tags": [], "meta": {}, "materialized": "table", "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "asana_source_integration_source_stg_asana", "fqn": ["asana_source", "tmp", "stg_asana__tag_tmp"], "unique_id": "model.asana_source.stg_asana__tag_tmp", "package_name": "asana_source", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/asana_source", "path": "tmp/stg_asana__tag_tmp.sql", "original_file_path": "models/tmp/stg_asana__tag_tmp.sql", "name": "stg_asana__tag_tmp", "alias": "stg_asana__tag_tmp", "checksum": {"name": "sha256", "checksum": "c394a64eb436d4592c23e4c1876d4e001907bdf6de6fa1267f9bd47c83678711"}, "tags": [], "refs": [], "sources": [["asana", "tag"]], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/asana_source/models/tmp/stg_asana__tag_tmp.sql", "build_path": null, "deferred": false, "unrendered_config": {"schema": "stg_asana", "materialized": "table"}, "created_at": 1663600953.559883, "compiled_sql": "select * \nfrom `dbt-package-testing`.`asana_integrations_tests`.`tag_data`", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`asana_source_integration_source_stg_asana`.`stg_asana__tag_tmp`"}, "model.asana_source.stg_asana__task_section_tmp": {"raw_sql": "select * \nfrom {{ var('task_section') }}", "compiled": true, "resource_type": "model", "depends_on": {"macros": [], "nodes": ["source.asana_source.asana.task_section"]}, "config": {"enabled": true, "alias": null, "schema": "stg_asana", "database": null, "tags": [], "meta": {}, "materialized": "table", "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "asana_source_integration_source_stg_asana", "fqn": ["asana_source", "tmp", "stg_asana__task_section_tmp"], "unique_id": "model.asana_source.stg_asana__task_section_tmp", "package_name": "asana_source", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/asana_source", "path": "tmp/stg_asana__task_section_tmp.sql", "original_file_path": "models/tmp/stg_asana__task_section_tmp.sql", "name": "stg_asana__task_section_tmp", "alias": "stg_asana__task_section_tmp", "checksum": {"name": "sha256", "checksum": "453db03084996d17e88a0f1ffda90ee349df4f262db7a3523578f5d4c6a4e5e6"}, "tags": [], "refs": [], "sources": [["asana", "task_section"]], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/asana_source/models/tmp/stg_asana__task_section_tmp.sql", "build_path": null, "deferred": false, "unrendered_config": {"schema": "stg_asana", "materialized": "table"}, "created_at": 1663600953.563637, "compiled_sql": "select * \nfrom `dbt-package-testing`.`asana_integrations_tests`.`task_section_data`", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`asana_source_integration_source_stg_asana`.`stg_asana__task_section_tmp`"}, "model.asana_source.stg_asana__task_tag_tmp": {"raw_sql": "select * \nfrom {{ var('task_tag') }}", "compiled": true, "resource_type": "model", "depends_on": {"macros": [], "nodes": ["source.asana_source.asana.task_tag"]}, "config": {"enabled": true, "alias": null, "schema": "stg_asana", "database": null, "tags": [], "meta": {}, "materialized": "table", "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "asana_source_integration_source_stg_asana", "fqn": ["asana_source", "tmp", "stg_asana__task_tag_tmp"], "unique_id": "model.asana_source.stg_asana__task_tag_tmp", "package_name": "asana_source", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/asana_source", "path": "tmp/stg_asana__task_tag_tmp.sql", "original_file_path": "models/tmp/stg_asana__task_tag_tmp.sql", "name": "stg_asana__task_tag_tmp", "alias": "stg_asana__task_tag_tmp", "checksum": {"name": "sha256", "checksum": "00c6fa0be01310e2a827ce46dbadeb2cf3cc24dda4dc22142ed81b7bb0f85a4d"}, "tags": [], "refs": [], "sources": [["asana", "task_tag"]], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/asana_source/models/tmp/stg_asana__task_tag_tmp.sql", "build_path": null, "deferred": false, "unrendered_config": {"schema": "stg_asana", "materialized": "table"}, "created_at": 1663600953.566429, "compiled_sql": "select * \nfrom `dbt-package-testing`.`asana_integrations_tests`.`task_tag_data`", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`asana_source_integration_source_stg_asana`.`stg_asana__task_tag_tmp`"}, "model.asana_source.stg_asana__user_tmp": {"raw_sql": "select * \nfrom {{ var('user') }}", "compiled": true, "resource_type": "model", "depends_on": {"macros": [], "nodes": ["source.asana_source.asana.user"]}, "config": {"enabled": true, "alias": null, "schema": "stg_asana", "database": null, "tags": [], "meta": {}, "materialized": "table", "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "asana_source_integration_source_stg_asana", "fqn": ["asana_source", "tmp", "stg_asana__user_tmp"], "unique_id": "model.asana_source.stg_asana__user_tmp", "package_name": "asana_source", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/asana_source", "path": "tmp/stg_asana__user_tmp.sql", "original_file_path": "models/tmp/stg_asana__user_tmp.sql", "name": "stg_asana__user_tmp", "alias": "stg_asana__user_tmp", "checksum": {"name": "sha256", "checksum": "6a45d1112d3ae79f22784f5fd5723a27b7894d57aea5795a37921842affc0085"}, "tags": [], "refs": [], "sources": [["asana", "user"]], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/asana_source/models/tmp/stg_asana__user_tmp.sql", "build_path": null, "deferred": false, "unrendered_config": {"schema": "stg_asana", "materialized": "table"}, "created_at": 1663600953.569279, "compiled_sql": "select * \nfrom `dbt-package-testing`.`asana_integrations_tests`.`user_data`", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`asana_source_integration_source_stg_asana`.`stg_asana__user_tmp`"}, "model.asana_source.stg_asana__section_tmp": {"raw_sql": "select * \nfrom {{ var('section') }}", "compiled": true, "resource_type": "model", "depends_on": {"macros": [], "nodes": ["source.asana_source.asana.section"]}, "config": {"enabled": true, "alias": null, "schema": "stg_asana", "database": null, "tags": [], "meta": {}, "materialized": "table", "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "asana_source_integration_source_stg_asana", "fqn": ["asana_source", "tmp", "stg_asana__section_tmp"], "unique_id": "model.asana_source.stg_asana__section_tmp", "package_name": "asana_source", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/asana_source", "path": "tmp/stg_asana__section_tmp.sql", "original_file_path": "models/tmp/stg_asana__section_tmp.sql", "name": "stg_asana__section_tmp", "alias": "stg_asana__section_tmp", "checksum": {"name": "sha256", "checksum": "83155348ae27cce121000df7d3d07cd4f734098dca2747df7dd5affde1c84188"}, "tags": [], "refs": [], "sources": [["asana", "section"]], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/asana_source/models/tmp/stg_asana__section_tmp.sql", "build_path": null, "deferred": false, "unrendered_config": {"schema": "stg_asana", "materialized": "table"}, "created_at": 1663600953.572021, "compiled_sql": "select * \nfrom `dbt-package-testing`.`asana_integrations_tests`.`section_data`", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`asana_source_integration_source_stg_asana`.`stg_asana__section_tmp`"}, "model.asana_source.stg_asana__project_tmp": {"raw_sql": "select * \nfrom {{ var('project') }}", "compiled": true, "resource_type": "model", "depends_on": {"macros": [], "nodes": ["source.asana_source.asana.project"]}, "config": {"enabled": true, "alias": null, "schema": "stg_asana", "database": null, "tags": [], "meta": {}, "materialized": "table", "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "asana_source_integration_source_stg_asana", "fqn": ["asana_source", "tmp", "stg_asana__project_tmp"], "unique_id": "model.asana_source.stg_asana__project_tmp", "package_name": "asana_source", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/asana_source", "path": "tmp/stg_asana__project_tmp.sql", "original_file_path": "models/tmp/stg_asana__project_tmp.sql", "name": "stg_asana__project_tmp", "alias": "stg_asana__project_tmp", "checksum": {"name": "sha256", "checksum": "2c1320ac7d1c876b9aa540a4aa0a07bcacfa92e35d74a60cb09a5948ac6869ad"}, "tags": [], "refs": [], "sources": [["asana", "project"]], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/asana_source/models/tmp/stg_asana__project_tmp.sql", "build_path": null, "deferred": false, "unrendered_config": {"schema": "stg_asana", "materialized": "table"}, "created_at": 1663600953.575365, "compiled_sql": "select * \nfrom `dbt-package-testing`.`asana_integrations_tests`.`project_data`", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`asana_source_integration_source_stg_asana`.`stg_asana__project_tmp`"}, "model.asana_source.stg_asana__project_task_tmp": {"raw_sql": "select * \nfrom {{ var('project_task') }}", "compiled": true, "resource_type": "model", "depends_on": {"macros": [], "nodes": ["source.asana_source.asana.project_task"]}, "config": {"enabled": true, "alias": null, "schema": "stg_asana", "database": null, "tags": [], "meta": {}, "materialized": "table", "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "asana_source_integration_source_stg_asana", "fqn": ["asana_source", "tmp", "stg_asana__project_task_tmp"], "unique_id": "model.asana_source.stg_asana__project_task_tmp", "package_name": "asana_source", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/asana_source", "path": "tmp/stg_asana__project_task_tmp.sql", "original_file_path": "models/tmp/stg_asana__project_task_tmp.sql", "name": "stg_asana__project_task_tmp", "alias": "stg_asana__project_task_tmp", "checksum": {"name": "sha256", "checksum": "2ad5271ec001d7cb80698feb2fcc08b189f360d756f86feb074bbd904002b10e"}, "tags": [], "refs": [], "sources": [["asana", "project_task"]], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/asana_source/models/tmp/stg_asana__project_task_tmp.sql", "build_path": null, "deferred": false, "unrendered_config": {"schema": "stg_asana", "materialized": "table"}, "created_at": 1663600953.578114, "compiled_sql": "select * \nfrom `dbt-package-testing`.`asana_integrations_tests`.`project_task_data`", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`asana_source_integration_source_stg_asana`.`stg_asana__project_task_tmp`"}, "model.asana.asana__daily_metrics": {"raw_sql": "with task as (\n\n select *\n from {{ ref('asana__task') }}\n),\n\n\nspine as (\n\n {% if execute %}\n {% set first_date_query %}\n select \n cast(min(created_at) as {{ dbt_utils.type_timestamp() }}) as min_date \n from {{ ref('asana__task') }}\n {% endset %}\n {% set first_date = run_query(first_date_query).columns[0][0]|string %}\n \n {% else %} {% set first_date = \"2016-01-01\" %}\n {% endif %}\n\n\n {{ dbt_utils.date_spine(\n datepart = \"day\", \n start_date = \"cast('\" ~ first_date[0:10] ~ \"'as date)\", \n end_date = dbt_utils.dateadd(\"week\", 1, \"current_date\") ) \n }} \n\n),\n\nspine_tasks as (\n \n select\n spine.date_day,\n sum( {{ dbt_utils.datediff('task.created_at', 'spine.date_day', 'day') }} ) as total_days_open,\n count( task.task_id) as number_of_tasks_open,\n sum( case when cast(spine.date_day as timestamp) >= {{ dbt_utils.date_trunc('day', 'task.first_assigned_at') }} then 1 else 0 end) as number_of_tasks_open_assigned,\n sum( {{ dbt_utils.datediff('task.first_assigned_at', 'spine.date_day', 'day') }} ) as total_days_open_assigned,\n sum( case when cast(spine.date_day as timestamp) = {{ dbt_utils.date_trunc('day', 'task.created_at') }} then 1 else 0 end) as number_of_tasks_created,\n sum( case when cast(spine.date_day as timestamp) = {{ dbt_utils.date_trunc('day', 'task.completed_at') }} then 1 else 0 end) as number_of_tasks_completed\n\n from spine\n join task -- can't do left join with no = \n on cast(spine.date_day as timestamp) >= {{ dbt_utils.date_trunc('day', 'task.created_at') }}\n and case when task.is_completed then \n cast(spine.date_day as timestamp) < {{ dbt_utils.date_trunc('day', 'task.completed_at') }}\n else true end\n\n group by 1\n),\n\njoin_metrics as (\n\n select\n spine.date_day,\n coalesce(spine_tasks.number_of_tasks_open, 0) as number_of_tasks_open,\n coalesce(spine_tasks.number_of_tasks_open_assigned, 0) as number_of_tasks_open_assigned,\n coalesce(spine_tasks.number_of_tasks_created, 0) as number_of_tasks_created,\n coalesce(spine_tasks.number_of_tasks_completed, 0) as number_of_tasks_completed,\n\n round(nullif(spine_tasks.total_days_open,0) * 1.0 / nullif(spine_tasks.number_of_tasks_open,0), 0) as avg_days_open,\n round(nullif(spine_tasks.total_days_open_assigned,0) * 1.0 / nullif(spine_tasks.number_of_tasks_open_assigned,0), 0) as avg_days_open_assigned\n\n from \n spine\n left join spine_tasks on spine_tasks.date_day = spine.date_day \n\n)\n\nselect * from join_metrics\norder by date_day desc", "compiled": true, "resource_type": "model", "depends_on": {"macros": ["macro.dbt_utils.dateadd", "macro.dbt_utils.date_spine", "macro.dbt_utils.datediff", "macro.dbt_utils.date_trunc", "macro.dbt_utils.type_timestamp", "macro.dbt.run_query"], "nodes": ["model.asana.asana__task"]}, "config": {"enabled": true, "alias": null, "schema": "asana", "database": null, "tags": [], "meta": {}, "materialized": "table", "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "asana_source_integration_source_asana", "fqn": ["asana", "asana__daily_metrics"], "unique_id": "model.asana.asana__daily_metrics", "package_name": "asana", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/asana", "path": "asana__daily_metrics.sql", "original_file_path": "models/asana__daily_metrics.sql", "name": "asana__daily_metrics", "alias": "asana__daily_metrics", "checksum": {"name": "sha256", "checksum": "02676e84685419c369877ad8f47f025d86d24e1301fff424265e0fac487b0f76"}, "tags": [], "refs": [["asana__task"]], "sources": [], "metrics": [], "description": "Table of task metrics per each day", "columns": {"date_day": {"name": "date_day", "description": "Unique day for which metrics are calculated.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "number_of_tasks_open": {"name": "number_of_tasks_open", "description": "The number of tasks open at that point in time", "meta": {}, "data_type": null, "quote": null, "tags": []}, "number_of_tasks_open_assigned": {"name": "number_of_tasks_open_assigned", "description": "The number of tasks that are open on that day and have been assigned", "meta": {}, "data_type": null, "quote": null, "tags": []}, "number_of_tasks_created": {"name": "number_of_tasks_created", "description": "The number of tasks created on that day", "meta": {}, "data_type": null, "quote": null, "tags": []}, "number_of_tasks_completed": {"name": "number_of_tasks_completed", "description": "The number of tasks completed on that day", "meta": {}, "data_type": null, "quote": null, "tags": []}, "avg_days_open": {"name": "avg_days_open", "description": "The average time that all tasks open on this day have spent open.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "avg_days_open_assigned": {"name": "avg_days_open_assigned", "description": "The average time that all tasks open on this day have spent open and assigned.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true}, "patch_path": "asana://models/asana.yml", "compiled_path": "target/compiled/asana/models/asana__daily_metrics.sql", "build_path": null, "deferred": false, "unrendered_config": {"schema": "asana", "materialized": "table"}, "created_at": 1663600953.7815711, "compiled_sql": "with task as (\n\n select *\n from `dbt-package-testing`.`asana_source_integration_source_asana`.`asana__task`\n),\n\n\nspine as (\n\n \n \n \n \n \n\n\n \n\n\n\n\n\nwith rawdata as (\n\n \n\n \n\n with p as (\n select 0 as generated_number union all select 1\n ), unioned as (\n\n select\n\n \n p0.generated_number * power(2, 0)\n + \n \n p1.generated_number * power(2, 1)\n + \n \n p2.generated_number * power(2, 2)\n + \n \n p3.generated_number * power(2, 3)\n + \n \n p4.generated_number * power(2, 4)\n + \n \n p5.generated_number * power(2, 5)\n + \n \n p6.generated_number * power(2, 6)\n + \n \n p7.generated_number * power(2, 7)\n + \n \n p8.generated_number * power(2, 8)\n + \n \n p9.generated_number * power(2, 9)\n + \n \n p10.generated_number * power(2, 10)\n \n \n + 1\n as generated_number\n\n from\n\n \n p as p0\n cross join \n \n p as p1\n cross join \n \n p as p2\n cross join \n \n p as p3\n cross join \n \n p as p4\n cross join \n \n p as p5\n cross join \n \n p as p6\n cross join \n \n p as p7\n cross join \n \n p as p8\n cross join \n \n p as p9\n cross join \n \n p as p10\n \n \n\n )\n\n select *\n from unioned\n where generated_number <= 1120\n order by generated_number\n\n\n\n),\n\nall_periods as (\n\n select (\n \n\n datetime_add(\n cast( cast('2019-09-02'as date) as datetime),\n interval row_number() over (order by 1) - 1 day\n )\n\n\n ) as date_day\n from rawdata\n\n),\n\nfiltered as (\n\n select *\n from all_periods\n where date_day <= \n\n datetime_add(\n cast( current_date as datetime),\n interval 1 week\n )\n\n\n\n)\n\nselect * from filtered\n\n \n\n),\n\nspine_tasks as (\n \n select\n spine.date_day,\n sum( datetime_diff(\n cast(spine.date_day as datetime),\n cast(task.created_at as datetime),\n day\n ) ) as total_days_open,\n count( task.task_id) as number_of_tasks_open,\n sum( case when cast(spine.date_day as timestamp) >= timestamp_trunc(\n cast(task.first_assigned_at as timestamp),\n day\n ) then 1 else 0 end) as number_of_tasks_open_assigned,\n sum( datetime_diff(\n cast(spine.date_day as datetime),\n cast(task.first_assigned_at as datetime),\n day\n ) ) as total_days_open_assigned,\n sum( case when cast(spine.date_day as timestamp) = timestamp_trunc(\n cast(task.created_at as timestamp),\n day\n ) then 1 else 0 end) as number_of_tasks_created,\n sum( case when cast(spine.date_day as timestamp) = timestamp_trunc(\n cast(task.completed_at as timestamp),\n day\n ) then 1 else 0 end) as number_of_tasks_completed\n\n from spine\n join task -- can't do left join with no = \n on cast(spine.date_day as timestamp) >= timestamp_trunc(\n cast(task.created_at as timestamp),\n day\n )\n and case when task.is_completed then \n cast(spine.date_day as timestamp) < timestamp_trunc(\n cast(task.completed_at as timestamp),\n day\n )\n else true end\n\n group by 1\n),\n\njoin_metrics as (\n\n select\n spine.date_day,\n coalesce(spine_tasks.number_of_tasks_open, 0) as number_of_tasks_open,\n coalesce(spine_tasks.number_of_tasks_open_assigned, 0) as number_of_tasks_open_assigned,\n coalesce(spine_tasks.number_of_tasks_created, 0) as number_of_tasks_created,\n coalesce(spine_tasks.number_of_tasks_completed, 0) as number_of_tasks_completed,\n\n round(nullif(spine_tasks.total_days_open,0) * 1.0 / nullif(spine_tasks.number_of_tasks_open,0), 0) as avg_days_open,\n round(nullif(spine_tasks.total_days_open_assigned,0) * 1.0 / nullif(spine_tasks.number_of_tasks_open_assigned,0), 0) as avg_days_open_assigned\n\n from \n spine\n left join spine_tasks on spine_tasks.date_day = spine.date_day \n\n)\n\nselect * from join_metrics\norder by date_day desc", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`asana_source_integration_source_asana`.`asana__daily_metrics`"}, "model.asana.asana__user": {"raw_sql": "with user_task_metrics as (\n\n select * \n from {{ ref('int_asana__user_task_metrics') }}\n),\n\nasana_user as (\n select * \n from {{ var('user') }}\n),\n\nproject_user as (\n \n select * \n from {{ ref('int_asana__project_user') }}\n\n where currently_working_on or role = 'owner'\n),\n\ncount_user_projects as (\n\n select \n user_id,\n sum(case when role = 'owner' then 1\n else 0 end) as number_of_projects_owned,\n sum(case when currently_working_on = true then 1\n else 0 end) as number_of_projects_currently_assigned_to\n\n from project_user\n\n group by 1\n\n),\n\nunique_user_projects as (\n select\n user_id,\n project_id,\n project_name\n\n from project_user\n group by 1,2,3\n),\n\n\nagg_user_projects as (\n\n select \n user_id,\n {{ fivetran_utils.string_agg( 'project_name', \"', '\" )}} as projects_working_on\n\n from unique_user_projects\n group by 1\n\n),\n\nuser_join as (\n\n select \n asana_user.*,\n coalesce(user_task_metrics.number_of_open_tasks, 0) as number_of_open_tasks,\n coalesce(user_task_metrics.number_of_tasks_completed, 0) as number_of_tasks_completed,\n round(user_task_metrics.avg_close_time_days, 0) as avg_close_time_days,\n\n coalesce(count_user_projects.number_of_projects_owned, 0) as number_of_projects_owned,\n coalesce(count_user_projects.number_of_projects_currently_assigned_to, 0) as number_of_projects_currently_assigned_to,\n agg_user_projects.projects_working_on\n \n from asana_user \n\n left join user_task_metrics on asana_user.user_id = user_task_metrics.user_id\n left join count_user_projects on asana_user.user_id = count_user_projects.user_id\n left join agg_user_projects on asana_user.user_id = agg_user_projects.user_id\n)\n\nselect * from user_join", "compiled": true, "resource_type": "model", "depends_on": {"macros": ["macro.fivetran_utils.string_agg"], "nodes": ["model.asana.int_asana__user_task_metrics", "model.asana_source.stg_asana__user", "model.asana.int_asana__project_user"]}, "config": {"enabled": true, "alias": null, "schema": "asana", "database": null, "tags": [], "meta": {}, "materialized": "table", "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "asana_source_integration_source_asana", "fqn": ["asana", "asana__user"], "unique_id": "model.asana.asana__user", "package_name": "asana", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/asana", "path": "asana__user.sql", "original_file_path": "models/asana__user.sql", "name": "asana__user", "alias": "asana__user", "checksum": {"name": "sha256", "checksum": "88ccd963cf4ee613643a10749d93ce8c912a38c2672f70c54bd88397607c7a47"}, "tags": [], "refs": [["int_asana__user_task_metrics"], ["stg_asana__user"], ["int_asana__project_user"]], "sources": [], "metrics": [], "description": "Enriched user table consisting of base user info + metrics around tasks and completions", "columns": {"user_id": {"name": "user_id", "description": "System generated unique ID of the user", "meta": {}, "data_type": null, "quote": null, "tags": []}, "user_name": {"name": "user_name", "description": "Name of the user as it appears in the UI", "meta": {}, "data_type": null, "quote": null, "tags": []}, "email": {"name": "email", "description": "The user's email", "meta": {}, "data_type": null, "quote": null, "tags": []}, "number_of_open_tasks": {"name": "number_of_open_tasks", "description": "Count of the currently open tasks assigned to this user", "meta": {}, "data_type": null, "quote": null, "tags": []}, "number_of_tasks_completed": {"name": "number_of_tasks_completed", "description": "Count of the tasks that this user has completed", "meta": {}, "data_type": null, "quote": null, "tags": []}, "avg_close_time_days": {"name": "avg_close_time_days", "description": "The avg number of days it has taken the user to complete tasks once assigned to them.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "number_of_projects_owned": {"name": "number_of_projects_owned", "description": "Count of the projects that this user is the owner of (excludes archived projects)", "meta": {}, "data_type": null, "quote": null, "tags": []}, "number_of_projects_currently_assigned_to": {"name": "number_of_projects_currently_assigned_to", "description": "Count of the projects that the user is currently assigned open tasks to.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "projects_working_on": {"name": "projects_working_on", "description": "Aggregated list of the projects that the user is currently assigned to or owns", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true}, "patch_path": "asana://models/asana.yml", "compiled_path": "target/compiled/asana/models/asana__user.sql", "build_path": null, "deferred": false, "unrendered_config": {"schema": "asana", "materialized": "table"}, "created_at": 1663600953.77482, "compiled_sql": "with __dbt__cte__int_asana__user_task_metrics as (\nwith tasks as (\n\n select * \n from `dbt-package-testing`.`asana_source_integration_source_asana`.`asana__task`\n where assignee_user_id is not null\n\n), \n\nagg_user_tasks as (\n\n select \n assignee_user_id as user_id,\n sum(case when not is_completed then 1 else 0 end) as number_of_open_tasks,\n sum(case when is_completed then 1 else 0 end) as number_of_tasks_completed,\n sum(case when is_completed then days_since_last_assignment else 0 end) as days_assigned_this_user -- will divde later for avg\n\n from tasks\n\n group by 1\n\n),\n\nfinal as (\n select\n agg_user_tasks.user_id,\n agg_user_tasks.number_of_open_tasks,\n agg_user_tasks.number_of_tasks_completed,\n nullif(agg_user_tasks.days_assigned_this_user, 0) * 1.0 / nullif(agg_user_tasks.number_of_tasks_completed, 0) as avg_close_time_days\n\n from \n agg_user_tasks \n)\n\nselect * from final\n), __dbt__cte__int_asana__task_assignee as (\nwith task as (\n\n select * \n from `dbt-package-testing`.`asana_source_integration_source_stg_asana`.`stg_asana__task`\n\n),\n\nasana_user as (\n\n select *\n from `dbt-package-testing`.`asana_source_integration_source_stg_asana`.`stg_asana__user`\n),\n\ntask_assignee as (\n\n select\n task.*,\n assignee_user_id is not null as has_assignee,\n asana_user.user_name as assignee_name,\n asana_user.email as assignee_email\n\n from task \n left join asana_user \n on task.assignee_user_id = asana_user.user_id\n)\n\nselect * from task_assignee\n), __dbt__cte__int_asana__project_user as (\nwith project_tasks as (\n \n select *\n from `dbt-package-testing`.`asana_source_integration_source_stg_asana`.`stg_asana__project_task`\n),\n\nassigned_tasks as (\n \n select * \n from __dbt__cte__int_asana__task_assignee\n where has_assignee\n \n),\n\nproject as (\n \n select *\n from `dbt-package-testing`.`asana_source_integration_source_stg_asana`.`stg_asana__project`\n\n where not is_archived\n\n),\n\nproject_assignee as (\n\n select\n project_tasks.project_id,\n project_tasks.task_id,\n assigned_tasks.assignee_user_id,\n assigned_tasks.assignee_name,\n not assigned_tasks.is_completed as currently_working_on\n\n from project_tasks \n join assigned_tasks \n on assigned_tasks.task_id = project_tasks.task_id\n\n),\n\nproject_owner as (\n\n select \n project_id,\n project_name,\n owner_user_id\n\n from project\n \n where owner_user_id is not null\n),\n\nproject_user as (\n \n select\n project_id,\n project_name,\n owner_user_id as user_id,\n 'owner' as role,\n null as currently_working_on\n \n from project_owner\n\n union all\n\n select\n project.project_id,\n project.project_name,\n project_assignee.assignee_user_id as user_id,\n 'task assignee' as role,\n project_assignee.currently_working_on\n \n from project \n \n join project_assignee \n on project.project_id = project_assignee.project_id\n group by 1,2,3,4,5\n\n)\n\n\nselect * from project_user\n),user_task_metrics as (\n\n select * \n from __dbt__cte__int_asana__user_task_metrics\n),\n\nasana_user as (\n select * \n from `dbt-package-testing`.`asana_source_integration_source_stg_asana`.`stg_asana__user`\n),\n\nproject_user as (\n \n select * \n from __dbt__cte__int_asana__project_user\n\n where currently_working_on or role = 'owner'\n),\n\ncount_user_projects as (\n\n select \n user_id,\n sum(case when role = 'owner' then 1\n else 0 end) as number_of_projects_owned,\n sum(case when currently_working_on = true then 1\n else 0 end) as number_of_projects_currently_assigned_to\n\n from project_user\n\n group by 1\n\n),\n\nunique_user_projects as (\n select\n user_id,\n project_id,\n project_name\n\n from project_user\n group by 1,2,3\n),\n\n\nagg_user_projects as (\n\n select \n user_id,\n \n string_agg(project_name, ', ')\n\n as projects_working_on\n\n from unique_user_projects\n group by 1\n\n),\n\nuser_join as (\n\n select \n asana_user.*,\n coalesce(user_task_metrics.number_of_open_tasks, 0) as number_of_open_tasks,\n coalesce(user_task_metrics.number_of_tasks_completed, 0) as number_of_tasks_completed,\n round(user_task_metrics.avg_close_time_days, 0) as avg_close_time_days,\n\n coalesce(count_user_projects.number_of_projects_owned, 0) as number_of_projects_owned,\n coalesce(count_user_projects.number_of_projects_currently_assigned_to, 0) as number_of_projects_currently_assigned_to,\n agg_user_projects.projects_working_on\n \n from asana_user \n\n left join user_task_metrics on asana_user.user_id = user_task_metrics.user_id\n left join count_user_projects on asana_user.user_id = count_user_projects.user_id\n left join agg_user_projects on asana_user.user_id = agg_user_projects.user_id\n)\n\nselect * from user_join", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.asana.int_asana__user_task_metrics", "sql": " __dbt__cte__int_asana__user_task_metrics as (\nwith tasks as (\n\n select * \n from `dbt-package-testing`.`asana_source_integration_source_asana`.`asana__task`\n where assignee_user_id is not null\n\n), \n\nagg_user_tasks as (\n\n select \n assignee_user_id as user_id,\n sum(case when not is_completed then 1 else 0 end) as number_of_open_tasks,\n sum(case when is_completed then 1 else 0 end) as number_of_tasks_completed,\n sum(case when is_completed then days_since_last_assignment else 0 end) as days_assigned_this_user -- will divde later for avg\n\n from tasks\n\n group by 1\n\n),\n\nfinal as (\n select\n agg_user_tasks.user_id,\n agg_user_tasks.number_of_open_tasks,\n agg_user_tasks.number_of_tasks_completed,\n nullif(agg_user_tasks.days_assigned_this_user, 0) * 1.0 / nullif(agg_user_tasks.number_of_tasks_completed, 0) as avg_close_time_days\n\n from \n agg_user_tasks \n)\n\nselect * from final\n)"}, {"id": "model.asana.int_asana__task_assignee", "sql": " __dbt__cte__int_asana__task_assignee as (\nwith task as (\n\n select * \n from `dbt-package-testing`.`asana_source_integration_source_stg_asana`.`stg_asana__task`\n\n),\n\nasana_user as (\n\n select *\n from `dbt-package-testing`.`asana_source_integration_source_stg_asana`.`stg_asana__user`\n),\n\ntask_assignee as (\n\n select\n task.*,\n assignee_user_id is not null as has_assignee,\n asana_user.user_name as assignee_name,\n asana_user.email as assignee_email\n\n from task \n left join asana_user \n on task.assignee_user_id = asana_user.user_id\n)\n\nselect * from task_assignee\n)"}, {"id": "model.asana.int_asana__project_user", "sql": " __dbt__cte__int_asana__project_user as (\nwith project_tasks as (\n \n select *\n from `dbt-package-testing`.`asana_source_integration_source_stg_asana`.`stg_asana__project_task`\n),\n\nassigned_tasks as (\n \n select * \n from __dbt__cte__int_asana__task_assignee\n where has_assignee\n \n),\n\nproject as (\n \n select *\n from `dbt-package-testing`.`asana_source_integration_source_stg_asana`.`stg_asana__project`\n\n where not is_archived\n\n),\n\nproject_assignee as (\n\n select\n project_tasks.project_id,\n project_tasks.task_id,\n assigned_tasks.assignee_user_id,\n assigned_tasks.assignee_name,\n not assigned_tasks.is_completed as currently_working_on\n\n from project_tasks \n join assigned_tasks \n on assigned_tasks.task_id = project_tasks.task_id\n\n),\n\nproject_owner as (\n\n select \n project_id,\n project_name,\n owner_user_id\n\n from project\n \n where owner_user_id is not null\n),\n\nproject_user as (\n \n select\n project_id,\n project_name,\n owner_user_id as user_id,\n 'owner' as role,\n null as currently_working_on\n \n from project_owner\n\n union all\n\n select\n project.project_id,\n project.project_name,\n project_assignee.assignee_user_id as user_id,\n 'task assignee' as role,\n project_assignee.currently_working_on\n \n from project \n \n join project_assignee \n on project.project_id = project_assignee.project_id\n group by 1,2,3,4,5\n\n)\n\n\nselect * from project_user\n)"}], "relation_name": "`dbt-package-testing`.`asana_source_integration_source_asana`.`asana__user`"}, "model.asana.asana__task": {"raw_sql": "with task as (\n select *\n from {{ var('task') }}\n),\n\ntask_comments as (\n\n select * \n from {{ ref('int_asana__task_comments') }}\n),\n\ntask_followers as (\n\n select *\n from {{ ref('int_asana__task_followers') }}\n),\n\ntask_open_length as (\n\n select *\n from {{ ref('int_asana__task_open_length') }}\n),\n\ntask_tags as (\n\n select *\n from {{ ref('int_asana__task_tags') }}\n),\n\ntask_assignee as (\n\n select * \n from {{ ref('int_asana__task_assignee') }}\n where has_assignee\n),\n\ntask_projects as (\n\n select *\n from {{ ref('int_asana__task_projects') }}\n),\n\nsubtask_parent as (\n\n select * \n from {{ ref('int_asana__subtask_parent') }}\n\n),\n\ntask_first_modifier as (\n \n select *\n from {{ ref('int_asana__task_first_modifier') }}\n),\n\ntask_join as (\n\n select\n task.*,\n concat('https://app.asana.com/0/0/', task.task_id) as task_link,\n task_assignee.assignee_name,\n task_assignee.assignee_email,\n \n task_open_length.days_open, \n task_open_length.is_currently_assigned,\n task_open_length.has_been_assigned,\n task_open_length.days_since_last_assignment, -- is null for never-assigned tasks\n task_open_length.days_since_first_assignment, -- is null for never-assigned tasks\n task_open_length.last_assigned_at,\n task_open_length.first_assigned_at, \n\n task_first_modifier.first_modifier_user_id,\n task_first_modifier.first_modifier_name,\n\n task_comments.conversation, \n coalesce(task_comments.number_of_comments, 0) as number_of_comments, \n task_followers.followers,\n coalesce(task_followers.number_of_followers, 0) as number_of_followers,\n task_tags.tags, \n coalesce(task_tags.number_of_tags, 0) as number_of_tags, \n \n task_projects.projects_sections,\n\n subtask_parent.subtask_id is not null as is_subtask, -- parent id is in task.*\n subtask_parent.parent_task_name,\n subtask_parent.parent_assignee_user_id,\n subtask_parent.parent_assignee_name,\n subtask_parent.parent_due_date,\n subtask_parent.parent_created_at\n\n from\n task\n join task_open_length on task.task_id = task_open_length.task_id\n left join task_first_modifier on task.task_id = task_first_modifier.task_id\n\n left join task_comments on task.task_id = task_comments.task_id\n left join task_followers on task.task_id = task_followers.task_id\n left join task_tags on task.task_id = task_tags.task_id\n \n left join task_assignee on task.task_id = task_assignee.task_id\n\n left join subtask_parent on task.task_id = subtask_parent.subtask_id\n\n left join task_projects on task.task_id = task_projects.task_id\n\n)\n\nselect * from task_join", "compiled": true, "resource_type": "model", "depends_on": {"macros": [], "nodes": ["model.asana_source.stg_asana__task", "model.asana.int_asana__task_comments", "model.asana.int_asana__task_followers", "model.asana.int_asana__task_open_length", "model.asana.int_asana__task_tags", "model.asana.int_asana__task_assignee", "model.asana.int_asana__task_projects", "model.asana.int_asana__subtask_parent", "model.asana.int_asana__task_first_modifier"]}, "config": {"enabled": true, "alias": null, "schema": "asana", "database": null, "tags": [], "meta": {}, "materialized": "table", "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "asana_source_integration_source_asana", "fqn": ["asana", "asana__task"], "unique_id": "model.asana.asana__task", "package_name": "asana", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/asana", "path": "asana__task.sql", "original_file_path": "models/asana__task.sql", "name": "asana__task", "alias": "asana__task", "checksum": {"name": "sha256", "checksum": "9595b73e29bce0539fc8b3c27eeffdb1ffcba0a3f4f1946b9d36d2a495f59e79"}, "tags": [], "refs": [["stg_asana__task"], ["int_asana__task_comments"], ["int_asana__task_followers"], ["int_asana__task_open_length"], ["int_asana__task_tags"], ["int_asana__task_assignee"], ["int_asana__task_projects"], ["int_asana__subtask_parent"], ["int_asana__task_first_modifier"]], "sources": [], "metrics": [], "description": "An enriched task table consisting of base task info + aggregated metrics and lists", "columns": {"task_id": {"name": "task_id", "description": "System generated unique ID of the task.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "task_name": {"name": "task_name", "description": "User-facing name of the task", "meta": {}, "data_type": null, "quote": null, "tags": []}, "assignee_user_id": {"name": "assignee_user_id", "description": "Foreign key referencing the ASANA_USER that is currently assigned the task.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "assignee_name": {"name": "assignee_name", "description": "Name of the user that the task is currently assigned to.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "assignee_email": {"name": "assignee_email", "description": "Email of the user that the task is currently assigned to.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "is_completed": {"name": "is_completed", "description": "Boolean that is true if the task is currently marked complete.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "completed_at": {"name": "completed_at", "description": "Timestamp of when the task was marked complete.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "completed_by_user_id": {"name": "completed_by_user_id", "description": "Foreign key referencing the USER who completed the task. Note that this may be different than the assignee", "meta": {}, "data_type": null, "quote": null, "tags": []}, "created_at": {"name": "created_at", "description": "Timestamp of when the task was created", "meta": {}, "data_type": null, "quote": null, "tags": []}, "due_date": {"name": "due_date", "description": "Date the task is due, if provided.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "modified_at": {"name": "modified_at", "description": "Timestamp of when the task was last modified", "meta": {}, "data_type": null, "quote": null, "tags": []}, "start_date": {"name": "start_date", "description": "The start date of the task, if a date range is given.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "task_description": {"name": "task_description", "description": "Free-form text describing the task, as seen in the UI.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "task_link": {"name": "task_link", "description": "URL formatted to bring you directly to the task in asana.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "days_open": {"name": "days_open", "description": "The number of days the task has been/was open (creation -> completion)", "meta": {}, "data_type": null, "quote": null, "tags": []}, "is_currently_assigned": {"name": "is_currently_assigned", "description": "Boolean, true if the task is *currently* assigned", "meta": {}, "data_type": null, "quote": null, "tags": []}, "has_been_assigned": {"name": "has_been_assigned", "description": "Boolean, true if the task has at one point been assigned, even if currently not.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "days_since_last_assignment": {"name": "days_since_last_assignment", "description": "The number of days the task has been/was open and assigned to to the most recent user (last assignment -> completion)", "meta": {}, "data_type": null, "quote": null, "tags": []}, "days_since_first_assignment": {"name": "days_since_first_assignment", "description": "The number of days the task has been/was open and assigned at all (first time assigned -> completion)", "meta": {}, "data_type": null, "quote": null, "tags": []}, "last_assigned_at": {"name": "last_assigned_at", "description": "Timestamp of when the task was last assigned (to the current user if still assigned)", "meta": {}, "data_type": null, "quote": null, "tags": []}, "first_assigned_At": {"name": "first_assigned_At", "description": "Timestamp of when the task was first assigned to someone", "meta": {}, "data_type": null, "quote": null, "tags": []}, "first_modifier_user_id": {"name": "first_modifier_user_id", "description": "Foreign key referencing the ASANA_USER who made the first modification to the task (ie added a description). A proxy for task creator.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "first_modifier_name": {"name": "first_modifier_name", "description": "Name of the user who made the first modification to the task", "meta": {}, "data_type": null, "quote": null, "tags": []}, "number_of_comments": {"name": "number_of_comments", "description": "Count of comments made on the task", "meta": {}, "data_type": null, "quote": null, "tags": []}, "conversation": {"name": "conversation", "description": "The task's comments and authors aggregated into an ordered conversation, with authors + time sent", "meta": {}, "data_type": null, "quote": null, "tags": []}, "followers": {"name": "followers", "description": "A list of the names of the users who follow the task.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "number_of_followers": {"name": "number_of_followers", "description": "Count of the users following the task", "meta": {}, "data_type": null, "quote": null, "tags": []}, "tags": {"name": "tags", "description": "A list of the tags associated with the task.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "number_of_tags": {"name": "number_of_tags", "description": "Count of the tags associated with the task.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "projects_sections": {"name": "projects_sections", "description": "A list of the projects + sections that this task is listed under.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "is_subtask": {"name": "is_subtask", "description": "Boolean that's true if the task is a subtask of another.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "parent_task_id": {"name": "parent_task_id", "description": "Self-referential id of the parent TASK that this is a subtask of.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "parent_task_name": {"name": "parent_task_name", "description": "User-facing name of the task's parent task.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "parent_assignee_user_id": {"name": "parent_assignee_user_id", "description": "Foreign key referencing the ASANA_USER who is assigned the parent task", "meta": {}, "data_type": null, "quote": null, "tags": []}, "parent_assignee_name": {"name": "parent_assignee_name", "description": "Name of the user assigned this task's parent task", "meta": {}, "data_type": null, "quote": null, "tags": []}, "parent_due_date": {"name": "parent_due_date", "description": "Date on which the parent task is due, if given", "meta": {}, "data_type": null, "quote": null, "tags": []}, "parent_created_at": {"name": "parent_created_at", "description": "Timestamp of when the parent task was created", "meta": {}, "data_type": null, "quote": null, "tags": []}, "workspace_id": {"name": "workspace_id", "description": "Foreign key reference to the workspace", "meta": {}, "data_type": null, "quote": null, "tags": []}, "is_liked": {"name": "is_liked", "description": "Boolean that is true if the task is liked by the authorized user.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "number_of_likes": {"name": "number_of_likes", "description": "Number of users who have liked this task.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true}, "patch_path": "asana://models/asana.yml", "compiled_path": "target/compiled/asana/models/asana__task.sql", "build_path": null, "deferred": false, "unrendered_config": {"schema": "asana", "materialized": "table"}, "created_at": 1663600953.77342, "compiled_sql": "with __dbt__cte__int_asana__task_story as (\nwith story as (\n \n select * \n from `dbt-package-testing`.`asana_source_integration_source_stg_asana`.`stg_asana__story`\n\n),\n\nasana_user as (\n\n select * \n from `dbt-package-testing`.`asana_source_integration_source_stg_asana`.`stg_asana__user`\n),\n\nstory_user as (\n select \n story.*,\n asana_user.user_name as created_by_name\n from story\n join asana_user \n on story.created_by_user_id = asana_user.user_id\n),\n\nsplit_comments as (\n\n select\n story_id,\n created_at,\n created_by_user_id,\n created_by_name,\n target_task_id,\n \n case when event_type = 'comment' then story_content \n else null end as comment_content,\n\n case when event_type = 'system' then story_content \n else 'comment' end as action_description\n \n from story_user\n\n),\n\n\n-- the next CTE uses this dictionary to parse the type of action out of the event descfription\n\n\nparse_actions as (\n select\n story_id,\n target_task_id,\n created_at,\n created_by_user_id,\n created_by_name,\n comment_content,\n case \n when action_description like 'added the name%' then 'added name' \n when action_description like 'changed the name%' then 'changed name' \n when action_description like 'removed the name' then 'removed name' \n when action_description like 'added the description%' then 'added description' \n when action_description like 'changed the description%' then 'changed description' \n when action_description like 'removed the description' then 'removed description' \n when action_description like 'added to%' then 'added to project' \n when action_description like 'removed from%' then 'removed from project' \n when action_description like 'assigned%' then 'assigned' \n when action_description like 'unassigned%' then 'unassigned' \n when action_description like 'changed the due date%' then 'changed due date' \n when action_description like 'changed the start date%due date%' then 'changed due date' \n when action_description like 'changed the start date%' then 'changed start date' \n when action_description like 'removed the due date%' then 'removed due date' \n when action_description like 'removed the date range%' then 'removed due date' \n when action_description like 'removed the start date' then 'removed start date' \n when action_description like 'added subtask%' then 'added subtask' \n when action_description like 'added%collaborator%' then 'added collaborator' \n when action_description like 'moved%' then 'moved to section' \n when action_description like 'duplicated task from%' then 'duplicated this from other task' \n when action_description like 'marked%as a duplicate of this' then 'marked other task as duplicate of this' \n when action_description like 'marked this a duplicate of%' then 'marked as duplicate' \n when action_description like 'marked this task complete' then 'completed' \n when action_description like 'completed this task' then 'completed' \n when action_description like 'marked incomplete' then 'marked incomplete' \n when action_description like 'marked this task as a milestone' then 'marked as milestone' \n when action_description like 'unmarked this task as a milestone' then 'unmarked as milestone' \n when action_description like 'marked this milestone complete' then 'completed milestone' \n when action_description like 'completed this milestone' then 'completed milestone' \n when action_description like 'attached%' then 'attachment' \n when action_description like 'liked your comment' then 'liked comment' \n when action_description like 'liked this task' then 'liked task' \n when action_description like 'liked your attachment' then 'liked attachment' \n when action_description like 'liked that you completed this task' then 'liked completion' \n when action_description like 'completed the last task you were waiting on%' then 'completed dependency' \n when action_description like 'added feedback to%' then 'added feedback' \n when action_description like 'changed%to%' then 'changed tag' \n when action_description like 'cleared%' then 'cleared tag' \n when action_description like 'comment' then 'comment' \n when action_description like 'have a task due on%' then ''\n else action_description end as action_taken,\n action_description\n \n from split_comments\n\n),\n\n\nfinal as (\n \n select * \n from parse_actions\n\n -- remove actions you don't care about (set to null in the actions dictionary above)\n where action_taken is not null \n\n)\n\n\nselect * from final\n), __dbt__cte__int_asana__task_comments as (\nwith comments as (\n \n select *\n from __dbt__cte__int_asana__task_story\n where comment_content is not null\n order by target_task_id, created_at asc\n\n),\n\ntask_conversation as (\n\n select\n target_task_id as task_id,\n -- creates a chronologically ordered conversation about the task\n \n string_agg(created_at || ' - ' || created_by_name || ': ' || comment_content, '\\n')\n\n as conversation,\n count(*) as number_of_comments\n\n from comments \n group by 1\n)\n\nselect * from task_conversation\n), __dbt__cte__int_asana__task_followers as (\nwith task_follower as (\n \n select *\n from `dbt-package-testing`.`asana_source_integration_source_stg_asana`.`stg_asana__task_follower`\n\n),\n\nasana_user as (\n\n select * \n from `dbt-package-testing`.`asana_source_integration_source_stg_asana`.`stg_asana__user`\n\n),\n\nagg_followers as (\n\n select\n task_follower.task_id,\n \n string_agg(asana_user.user_name, ', ')\n\n as followers,\n count(*) as number_of_followers\n from task_follower \n join asana_user \n on asana_user.user_id = task_follower.user_id\n group by 1\n \n)\n\nselect * from agg_followers\n), __dbt__cte__int_asana__task_open_length as (\nwith task as (\n \n select *\n from `dbt-package-testing`.`asana_source_integration_source_stg_asana`.`stg_asana__task`\n\n),\n\nstory as (\n\n select * \n from __dbt__cte__int_asana__task_story\n\n),\n\nassignments as (\n \n select \n target_task_id as task_id,\n min(created_at) as first_assigned_at,\n max(created_at) as last_assigned_at -- current assignment\n\n from story\n where action_taken = 'assigned'\n\n group by 1\n\n),\n\n\nopen_assigned_length as (\n\n \n\n select\n task.task_id,\n task.is_completed,\n task.completed_at,\n task.assignee_user_id is not null as is_currently_assigned,\n assignments.task_id is not null as has_been_assigned,\n assignments.last_assigned_at as last_assigned_at,\n assignments.first_assigned_at as first_assigned_at,\n datetime_diff(\n cast(\n current_timestamp\n as datetime),\n cast(task.created_at as datetime),\n day\n ) as days_open,\n\n -- if the task is currently assigned, this is the time it has been assigned to this current user.\n datetime_diff(\n cast(\n current_timestamp\n as datetime),\n cast(assignments.last_assigned_at as datetime),\n day\n ) as days_since_last_assignment,\n\n datetime_diff(\n cast(\n current_timestamp\n as datetime),\n cast(assignments.first_assigned_at as datetime),\n day\n ) as days_since_first_assignment\n \n\n from task\n left join assignments \n on task.task_id = assignments.task_id\n\n)\n\n\nselect * from open_assigned_length\n), __dbt__cte__int_asana__task_tags as (\nwith task_tag as (\n \n select *\n from `dbt-package-testing`.`asana_source_integration_source_stg_asana`.`stg_asana__task_tag`\n\n),\n\nasana_tag as (\n\n select * \n from `dbt-package-testing`.`asana_source_integration_source_stg_asana`.`stg_asana__tag`\n\n),\n\nagg_tags as (\n\n select\n task_tag.task_id,\n \n string_agg(asana_tag.tag_name, ', ')\n\n as tags,\n count(*) as number_of_tags\n from task_tag \n join asana_tag \n on asana_tag.tag_id = task_tag.tag_id\n group by 1\n \n)\n\nselect * from agg_tags\n), __dbt__cte__int_asana__task_assignee as (\nwith task as (\n\n select * \n from `dbt-package-testing`.`asana_source_integration_source_stg_asana`.`stg_asana__task`\n\n),\n\nasana_user as (\n\n select *\n from `dbt-package-testing`.`asana_source_integration_source_stg_asana`.`stg_asana__user`\n),\n\ntask_assignee as (\n\n select\n task.*,\n assignee_user_id is not null as has_assignee,\n asana_user.user_name as assignee_name,\n asana_user.email as assignee_email\n\n from task \n left join asana_user \n on task.assignee_user_id = asana_user.user_id\n)\n\nselect * from task_assignee\n), __dbt__cte__int_asana__task_projects as (\nwith task_project as (\n\n select * \n from `dbt-package-testing`.`asana_source_integration_source_stg_asana`.`stg_asana__project_task`\n\n),\n\nproject as (\n \n select * \n from `dbt-package-testing`.`asana_source_integration_source_stg_asana`.`stg_asana__project`\n),\n\ntask_section as (\n\n select * \n from `dbt-package-testing`.`asana_source_integration_source_stg_asana`.`stg_asana__task_section`\n\n),\n\nsection as (\n \n select * \n from `dbt-package-testing`.`asana_source_integration_source_stg_asana`.`stg_asana__section`\n\n),\n\ntask_project_section as (\n\n select \n task_project.task_id,\n project.project_name || (case when section.section_name = '(no section)' then ''\n else ': ' || section.section_name end) as project_section, \n project.project_id\n from\n task_project \n join project \n on project.project_id = task_project.project_id\n join task_section\n on task_section.task_id = task_project.task_id\n join section \n on section.section_id = task_section.section_id \n and section.project_id = project.project_id\n),\n\nagg_project_sections as (\n select \n task_id,\n \n string_agg(task_project_section.project_section, ', ')\n\n as projects_sections,\n count(project_id) as number_of_projects\n\n from task_project_section \n\n group by 1\n)\n\nselect * from agg_project_sections\n), __dbt__cte__int_asana__subtask_parent as (\nwith task_assignee as (\n\n select * \n from __dbt__cte__int_asana__task_assignee\n\n),\n\n\nsubtask_parent as (\n\n select\n subtask.task_id as subtask_id,\n parent.task_id as parent_task_id,\n parent.task_name as parent_task_name,\n parent.due_date as parent_due_date,\n parent.created_at as parent_created_at,\n parent.assignee_user_id as parent_assignee_user_id,\n parent.assignee_name as parent_assignee_name\n\n from task_assignee as parent \n join task_assignee as subtask\n on parent.task_id = subtask.parent_task_id\n\n)\n\nselect * from subtask_parent\n), __dbt__cte__int_asana__task_first_modifier as (\nwith story as (\n\n select *\n from __dbt__cte__int_asana__task_story\n where created_by_user_id is not null -- sometimes user id can be null in story. limit to ones with associated users\n),\n\nordered_stories as (\n\n select \n target_task_id,\n created_by_user_id,\n created_by_name,\n created_at,\n row_number() over ( partition by target_task_id order by created_at asc ) as nth_story\n \n from story\n\n),\n\nfirst_modifier as (\n\n select \n target_task_id as task_id,\n created_by_user_id as first_modifier_user_id,\n created_by_name as first_modifier_name\n\n from ordered_stories \n where nth_story = 1\n)\n\nselect *\nfrom first_modifier\n),task as (\n select *\n from `dbt-package-testing`.`asana_source_integration_source_stg_asana`.`stg_asana__task`\n),\n\ntask_comments as (\n\n select * \n from __dbt__cte__int_asana__task_comments\n),\n\ntask_followers as (\n\n select *\n from __dbt__cte__int_asana__task_followers\n),\n\ntask_open_length as (\n\n select *\n from __dbt__cte__int_asana__task_open_length\n),\n\ntask_tags as (\n\n select *\n from __dbt__cte__int_asana__task_tags\n),\n\ntask_assignee as (\n\n select * \n from __dbt__cte__int_asana__task_assignee\n where has_assignee\n),\n\ntask_projects as (\n\n select *\n from __dbt__cte__int_asana__task_projects\n),\n\nsubtask_parent as (\n\n select * \n from __dbt__cte__int_asana__subtask_parent\n\n),\n\ntask_first_modifier as (\n \n select *\n from __dbt__cte__int_asana__task_first_modifier\n),\n\ntask_join as (\n\n select\n task.*,\n concat('https://app.asana.com/0/0/', task.task_id) as task_link,\n task_assignee.assignee_name,\n task_assignee.assignee_email,\n \n task_open_length.days_open, \n task_open_length.is_currently_assigned,\n task_open_length.has_been_assigned,\n task_open_length.days_since_last_assignment, -- is null for never-assigned tasks\n task_open_length.days_since_first_assignment, -- is null for never-assigned tasks\n task_open_length.last_assigned_at,\n task_open_length.first_assigned_at, \n\n task_first_modifier.first_modifier_user_id,\n task_first_modifier.first_modifier_name,\n\n task_comments.conversation, \n coalesce(task_comments.number_of_comments, 0) as number_of_comments, \n task_followers.followers,\n coalesce(task_followers.number_of_followers, 0) as number_of_followers,\n task_tags.tags, \n coalesce(task_tags.number_of_tags, 0) as number_of_tags, \n \n task_projects.projects_sections,\n\n subtask_parent.subtask_id is not null as is_subtask, -- parent id is in task.*\n subtask_parent.parent_task_name,\n subtask_parent.parent_assignee_user_id,\n subtask_parent.parent_assignee_name,\n subtask_parent.parent_due_date,\n subtask_parent.parent_created_at\n\n from\n task\n join task_open_length on task.task_id = task_open_length.task_id\n left join task_first_modifier on task.task_id = task_first_modifier.task_id\n\n left join task_comments on task.task_id = task_comments.task_id\n left join task_followers on task.task_id = task_followers.task_id\n left join task_tags on task.task_id = task_tags.task_id\n \n left join task_assignee on task.task_id = task_assignee.task_id\n\n left join subtask_parent on task.task_id = subtask_parent.subtask_id\n\n left join task_projects on task.task_id = task_projects.task_id\n\n)\n\nselect * from task_join", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.asana.int_asana__task_story", "sql": " __dbt__cte__int_asana__task_story as (\nwith story as (\n \n select * \n from `dbt-package-testing`.`asana_source_integration_source_stg_asana`.`stg_asana__story`\n\n),\n\nasana_user as (\n\n select * \n from `dbt-package-testing`.`asana_source_integration_source_stg_asana`.`stg_asana__user`\n),\n\nstory_user as (\n select \n story.*,\n asana_user.user_name as created_by_name\n from story\n join asana_user \n on story.created_by_user_id = asana_user.user_id\n),\n\nsplit_comments as (\n\n select\n story_id,\n created_at,\n created_by_user_id,\n created_by_name,\n target_task_id,\n \n case when event_type = 'comment' then story_content \n else null end as comment_content,\n\n case when event_type = 'system' then story_content \n else 'comment' end as action_description\n \n from story_user\n\n),\n\n\n-- the next CTE uses this dictionary to parse the type of action out of the event descfription\n\n\nparse_actions as (\n select\n story_id,\n target_task_id,\n created_at,\n created_by_user_id,\n created_by_name,\n comment_content,\n case \n when action_description like 'added the name%' then 'added name' \n when action_description like 'changed the name%' then 'changed name' \n when action_description like 'removed the name' then 'removed name' \n when action_description like 'added the description%' then 'added description' \n when action_description like 'changed the description%' then 'changed description' \n when action_description like 'removed the description' then 'removed description' \n when action_description like 'added to%' then 'added to project' \n when action_description like 'removed from%' then 'removed from project' \n when action_description like 'assigned%' then 'assigned' \n when action_description like 'unassigned%' then 'unassigned' \n when action_description like 'changed the due date%' then 'changed due date' \n when action_description like 'changed the start date%due date%' then 'changed due date' \n when action_description like 'changed the start date%' then 'changed start date' \n when action_description like 'removed the due date%' then 'removed due date' \n when action_description like 'removed the date range%' then 'removed due date' \n when action_description like 'removed the start date' then 'removed start date' \n when action_description like 'added subtask%' then 'added subtask' \n when action_description like 'added%collaborator%' then 'added collaborator' \n when action_description like 'moved%' then 'moved to section' \n when action_description like 'duplicated task from%' then 'duplicated this from other task' \n when action_description like 'marked%as a duplicate of this' then 'marked other task as duplicate of this' \n when action_description like 'marked this a duplicate of%' then 'marked as duplicate' \n when action_description like 'marked this task complete' then 'completed' \n when action_description like 'completed this task' then 'completed' \n when action_description like 'marked incomplete' then 'marked incomplete' \n when action_description like 'marked this task as a milestone' then 'marked as milestone' \n when action_description like 'unmarked this task as a milestone' then 'unmarked as milestone' \n when action_description like 'marked this milestone complete' then 'completed milestone' \n when action_description like 'completed this milestone' then 'completed milestone' \n when action_description like 'attached%' then 'attachment' \n when action_description like 'liked your comment' then 'liked comment' \n when action_description like 'liked this task' then 'liked task' \n when action_description like 'liked your attachment' then 'liked attachment' \n when action_description like 'liked that you completed this task' then 'liked completion' \n when action_description like 'completed the last task you were waiting on%' then 'completed dependency' \n when action_description like 'added feedback to%' then 'added feedback' \n when action_description like 'changed%to%' then 'changed tag' \n when action_description like 'cleared%' then 'cleared tag' \n when action_description like 'comment' then 'comment' \n when action_description like 'have a task due on%' then ''\n else action_description end as action_taken,\n action_description\n \n from split_comments\n\n),\n\n\nfinal as (\n \n select * \n from parse_actions\n\n -- remove actions you don't care about (set to null in the actions dictionary above)\n where action_taken is not null \n\n)\n\n\nselect * from final\n)"}, {"id": "model.asana.int_asana__task_comments", "sql": " __dbt__cte__int_asana__task_comments as (\nwith comments as (\n \n select *\n from __dbt__cte__int_asana__task_story\n where comment_content is not null\n order by target_task_id, created_at asc\n\n),\n\ntask_conversation as (\n\n select\n target_task_id as task_id,\n -- creates a chronologically ordered conversation about the task\n \n string_agg(created_at || ' - ' || created_by_name || ': ' || comment_content, '\\n')\n\n as conversation,\n count(*) as number_of_comments\n\n from comments \n group by 1\n)\n\nselect * from task_conversation\n)"}, {"id": "model.asana.int_asana__task_followers", "sql": " __dbt__cte__int_asana__task_followers as (\nwith task_follower as (\n \n select *\n from `dbt-package-testing`.`asana_source_integration_source_stg_asana`.`stg_asana__task_follower`\n\n),\n\nasana_user as (\n\n select * \n from `dbt-package-testing`.`asana_source_integration_source_stg_asana`.`stg_asana__user`\n\n),\n\nagg_followers as (\n\n select\n task_follower.task_id,\n \n string_agg(asana_user.user_name, ', ')\n\n as followers,\n count(*) as number_of_followers\n from task_follower \n join asana_user \n on asana_user.user_id = task_follower.user_id\n group by 1\n \n)\n\nselect * from agg_followers\n)"}, {"id": "model.asana.int_asana__task_open_length", "sql": " __dbt__cte__int_asana__task_open_length as (\nwith task as (\n \n select *\n from `dbt-package-testing`.`asana_source_integration_source_stg_asana`.`stg_asana__task`\n\n),\n\nstory as (\n\n select * \n from __dbt__cte__int_asana__task_story\n\n),\n\nassignments as (\n \n select \n target_task_id as task_id,\n min(created_at) as first_assigned_at,\n max(created_at) as last_assigned_at -- current assignment\n\n from story\n where action_taken = 'assigned'\n\n group by 1\n\n),\n\n\nopen_assigned_length as (\n\n \n\n select\n task.task_id,\n task.is_completed,\n task.completed_at,\n task.assignee_user_id is not null as is_currently_assigned,\n assignments.task_id is not null as has_been_assigned,\n assignments.last_assigned_at as last_assigned_at,\n assignments.first_assigned_at as first_assigned_at,\n datetime_diff(\n cast(\n current_timestamp\n as datetime),\n cast(task.created_at as datetime),\n day\n ) as days_open,\n\n -- if the task is currently assigned, this is the time it has been assigned to this current user.\n datetime_diff(\n cast(\n current_timestamp\n as datetime),\n cast(assignments.last_assigned_at as datetime),\n day\n ) as days_since_last_assignment,\n\n datetime_diff(\n cast(\n current_timestamp\n as datetime),\n cast(assignments.first_assigned_at as datetime),\n day\n ) as days_since_first_assignment\n \n\n from task\n left join assignments \n on task.task_id = assignments.task_id\n\n)\n\n\nselect * from open_assigned_length\n)"}, {"id": "model.asana.int_asana__task_tags", "sql": " __dbt__cte__int_asana__task_tags as (\nwith task_tag as (\n \n select *\n from `dbt-package-testing`.`asana_source_integration_source_stg_asana`.`stg_asana__task_tag`\n\n),\n\nasana_tag as (\n\n select * \n from `dbt-package-testing`.`asana_source_integration_source_stg_asana`.`stg_asana__tag`\n\n),\n\nagg_tags as (\n\n select\n task_tag.task_id,\n \n string_agg(asana_tag.tag_name, ', ')\n\n as tags,\n count(*) as number_of_tags\n from task_tag \n join asana_tag \n on asana_tag.tag_id = task_tag.tag_id\n group by 1\n \n)\n\nselect * from agg_tags\n)"}, {"id": "model.asana.int_asana__task_assignee", "sql": " __dbt__cte__int_asana__task_assignee as (\nwith task as (\n\n select * \n from `dbt-package-testing`.`asana_source_integration_source_stg_asana`.`stg_asana__task`\n\n),\n\nasana_user as (\n\n select *\n from `dbt-package-testing`.`asana_source_integration_source_stg_asana`.`stg_asana__user`\n),\n\ntask_assignee as (\n\n select\n task.*,\n assignee_user_id is not null as has_assignee,\n asana_user.user_name as assignee_name,\n asana_user.email as assignee_email\n\n from task \n left join asana_user \n on task.assignee_user_id = asana_user.user_id\n)\n\nselect * from task_assignee\n)"}, {"id": "model.asana.int_asana__task_projects", "sql": " __dbt__cte__int_asana__task_projects as (\nwith task_project as (\n\n select * \n from `dbt-package-testing`.`asana_source_integration_source_stg_asana`.`stg_asana__project_task`\n\n),\n\nproject as (\n \n select * \n from `dbt-package-testing`.`asana_source_integration_source_stg_asana`.`stg_asana__project`\n),\n\ntask_section as (\n\n select * \n from `dbt-package-testing`.`asana_source_integration_source_stg_asana`.`stg_asana__task_section`\n\n),\n\nsection as (\n \n select * \n from `dbt-package-testing`.`asana_source_integration_source_stg_asana`.`stg_asana__section`\n\n),\n\ntask_project_section as (\n\n select \n task_project.task_id,\n project.project_name || (case when section.section_name = '(no section)' then ''\n else ': ' || section.section_name end) as project_section, \n project.project_id\n from\n task_project \n join project \n on project.project_id = task_project.project_id\n join task_section\n on task_section.task_id = task_project.task_id\n join section \n on section.section_id = task_section.section_id \n and section.project_id = project.project_id\n),\n\nagg_project_sections as (\n select \n task_id,\n \n string_agg(task_project_section.project_section, ', ')\n\n as projects_sections,\n count(project_id) as number_of_projects\n\n from task_project_section \n\n group by 1\n)\n\nselect * from agg_project_sections\n)"}, {"id": "model.asana.int_asana__subtask_parent", "sql": " __dbt__cte__int_asana__subtask_parent as (\nwith task_assignee as (\n\n select * \n from __dbt__cte__int_asana__task_assignee\n\n),\n\n\nsubtask_parent as (\n\n select\n subtask.task_id as subtask_id,\n parent.task_id as parent_task_id,\n parent.task_name as parent_task_name,\n parent.due_date as parent_due_date,\n parent.created_at as parent_created_at,\n parent.assignee_user_id as parent_assignee_user_id,\n parent.assignee_name as parent_assignee_name\n\n from task_assignee as parent \n join task_assignee as subtask\n on parent.task_id = subtask.parent_task_id\n\n)\n\nselect * from subtask_parent\n)"}, {"id": "model.asana.int_asana__task_first_modifier", "sql": " __dbt__cte__int_asana__task_first_modifier as (\nwith story as (\n\n select *\n from __dbt__cte__int_asana__task_story\n where created_by_user_id is not null -- sometimes user id can be null in story. limit to ones with associated users\n),\n\nordered_stories as (\n\n select \n target_task_id,\n created_by_user_id,\n created_by_name,\n created_at,\n row_number() over ( partition by target_task_id order by created_at asc ) as nth_story\n \n from story\n\n),\n\nfirst_modifier as (\n\n select \n target_task_id as task_id,\n created_by_user_id as first_modifier_user_id,\n created_by_name as first_modifier_name\n\n from ordered_stories \n where nth_story = 1\n)\n\nselect *\nfrom first_modifier\n)"}], "relation_name": "`dbt-package-testing`.`asana_source_integration_source_asana`.`asana__task`"}, "model.asana.asana__team": {"raw_sql": "with team as (\n\n select * from {{ var('team') }}\n),\n\nproject as (\n\n select * \n from {{ ref('asana__project') }}\n),\n\nteam_join as (\n\n select\n team.team_id,\n team.team_name,\n\n coalesce( sum(project.number_of_open_tasks), 0) as number_of_open_tasks, -- will double-count tasks in multiple projects\n coalesce( sum( project.number_of_assigned_open_tasks), 0) as number_of_assigned_open_tasks,\n coalesce( sum(project.number_of_tasks_completed), 0) as number_of_tasks_completed,\n round(avg(project.avg_close_time_days), 0) as avg_close_time_days, -- avg of project's avg\n round(avg(project.avg_close_time_assigned_days), 0) as avg_close_time_assigned_days,\n\n coalesce( sum(case when not project.is_archived then 1 else 0 end), 0) as number_of_active_projects,\n {{ fivetran_utils.string_agg('case when not project.is_archived then project.project_name else null end', \"', '\") }} as active_projects,\n coalesce( sum(case when project.is_archived then 1 else 0 end), 0) as number_of_archived_projects\n\n \n\n from team \n left join project on project.team_id = team.team_id\n\n group by 1,2\n\n)\n\nselect * from team_join", "compiled": true, "resource_type": "model", "depends_on": {"macros": ["macro.fivetran_utils.string_agg"], "nodes": ["model.asana_source.stg_asana__team", "model.asana.asana__project"]}, "config": {"enabled": true, "alias": null, "schema": "asana", "database": null, "tags": [], "meta": {}, "materialized": "table", "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "asana_source_integration_source_asana", "fqn": ["asana", "asana__team"], "unique_id": "model.asana.asana__team", "package_name": "asana", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/asana", "path": "asana__team.sql", "original_file_path": "models/asana__team.sql", "name": "asana__team", "alias": "asana__team", "checksum": {"name": "sha256", "checksum": "848787a32e0c75060c960f1d73bd6c6652da47bfeafb7e6e74949ec183a5da63"}, "tags": [], "refs": [["stg_asana__team"], ["asana__project"]], "sources": [], "metrics": [], "description": "Enriched team table consisting of basic team info + task/completion metrics (note that teams can only act on tasks in projects)", "columns": {"team_id": {"name": "team_id", "description": "System generate unique ID for the team", "meta": {}, "data_type": null, "quote": null, "tags": []}, "team_name": {"name": "team_name", "description": "UI-facing name of the team.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "number_of_open_tasks": {"name": "number_of_open_tasks", "description": "Count of the currently open tasks for this team.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "number_of_assigned_open_tasks": {"name": "number_of_assigned_open_tasks", "description": "Count of the open and assigned tasks for the team.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "number_of_tasks_completed": {"name": "number_of_tasks_completed", "description": "Count of tasks that this team has completed.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "avg_close_time_days": {"name": "avg_close_time_days", "description": "The avg number of days it has taken projects of this team to close tasks.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "avg_close_time_assigned_days": {"name": "avg_close_time_assigned_days", "description": "The avg number of days it has taken projects of this team to close tasks, once assigned", "meta": {}, "data_type": null, "quote": null, "tags": []}, "active_projects": {"name": "active_projects", "description": "Aggregated list of non archived projects associated with the team", "meta": {}, "data_type": null, "quote": null, "tags": []}, "number_of_active_projects": {"name": "number_of_active_projects", "description": "Count of non-archived projects", "meta": {}, "data_type": null, "quote": null, "tags": []}, "number_of_archived_projects": {"name": "number_of_archived_projects", "description": "Count of archived projects", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true}, "patch_path": "asana://models/asana.yml", "compiled_path": "target/compiled/asana/models/asana__team.sql", "build_path": null, "deferred": false, "unrendered_config": {"schema": "asana", "materialized": "table"}, "created_at": 1663600953.779208, "compiled_sql": "with team as (\n\n select * from `dbt-package-testing`.`asana_source_integration_source_stg_asana`.`stg_asana__team`\n),\n\nproject as (\n\n select * \n from `dbt-package-testing`.`asana_source_integration_source_asana`.`asana__project`\n),\n\nteam_join as (\n\n select\n team.team_id,\n team.team_name,\n\n coalesce( sum(project.number_of_open_tasks), 0) as number_of_open_tasks, -- will double-count tasks in multiple projects\n coalesce( sum( project.number_of_assigned_open_tasks), 0) as number_of_assigned_open_tasks,\n coalesce( sum(project.number_of_tasks_completed), 0) as number_of_tasks_completed,\n round(avg(project.avg_close_time_days), 0) as avg_close_time_days, -- avg of project's avg\n round(avg(project.avg_close_time_assigned_days), 0) as avg_close_time_assigned_days,\n\n coalesce( sum(case when not project.is_archived then 1 else 0 end), 0) as number_of_active_projects,\n \n string_agg(case when not project.is_archived then project.project_name else null end, ', ')\n\n as active_projects,\n coalesce( sum(case when project.is_archived then 1 else 0 end), 0) as number_of_archived_projects\n\n \n\n from team \n left join project on project.team_id = team.team_id\n\n group by 1,2\n\n)\n\nselect * from team_join", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`asana_source_integration_source_asana`.`asana__team`"}, "model.asana.asana__project": {"raw_sql": "with project_task_metrics as (\n\n select *\n from {{ ref('int_asana__project_task_metrics') }}\n),\n\nproject as (\n \n select *\n from {{ var('project') }}\n),\n\nproject_user as (\n \n select *\n from {{ ref('int_asana__project_user') }}\n),\n\nasana_user as (\n select *\n from {{ var('user') }}\n),\n\nteam as (\n select *\n from {{ var('team') }}\n),\n\nagg_sections as (\n\n select\n project_id,\n {{ fivetran_utils.string_agg( 'section_name', \"', '\") }} as sections\n\n from {{ var('section') }}\n where section_name != '(no section)'\n group by 1\n),\n\nagg_project_users as (\n\n select \n project_user.project_id,\n {{ fivetran_utils.string_agg( \"asana_user.user_name || ' as ' || project_user.role\" , \"', '\" ) }} as users\n\n from project_user join asana_user using(user_id)\n\n group by 1\n\n),\n\n-- need to split from above due to redshift's inability to string/list_agg and use distinct aggregates\ncount_project_users as (\n \n select \n project_id, \n count(distinct user_id) as number_of_users_involved\n\n from project_user\n group by 1\n\n),\n\nproject_join as (\n\n select\n project.project_id,\n project_name,\n\n coalesce(project_task_metrics.number_of_open_tasks, 0) as number_of_open_tasks,\n coalesce(project_task_metrics.number_of_assigned_open_tasks, 0) as number_of_assigned_open_tasks,\n coalesce(project_task_metrics.number_of_tasks_completed, 0) as number_of_tasks_completed,\n round(project_task_metrics.avg_close_time_days, 0) as avg_close_time_days,\n round(project_task_metrics.avg_close_time_assigned_days, 0) as avg_close_time_assigned_days,\n\n 'https://app.asana.com/0/' || project.project_id ||'/' || project.project_id as project_link,\n\n project.team_id,\n team.team_name,\n project.is_archived,\n created_at,\n current_status,\n due_date,\n modified_at as last_modified_at,\n owner_user_id,\n agg_project_users.users as users_involved,\n coalesce(count_project_users.number_of_users_involved, 0) as number_of_users_involved,\n agg_sections.sections,\n project.notes,\n project.is_public\n\n from\n project \n left join project_task_metrics on project.project_id = project_task_metrics.project_id \n left join agg_project_users on project.project_id = agg_project_users.project_id \n left join count_project_users on project.project_id = count_project_users.project_id\n join team on team.team_id = project.team_id -- every project needs a team\n left join agg_sections on project.project_id = agg_sections.project_id\n\n)\n\nselect * from project_join", "compiled": true, "resource_type": "model", "depends_on": {"macros": ["macro.fivetran_utils.string_agg"], "nodes": ["model.asana.int_asana__project_task_metrics", "model.asana_source.stg_asana__project", "model.asana.int_asana__project_user", "model.asana_source.stg_asana__user", "model.asana_source.stg_asana__team", "model.asana_source.stg_asana__section"]}, "config": {"enabled": true, "alias": null, "schema": "asana", "database": null, "tags": [], "meta": {}, "materialized": "table", "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "asana_source_integration_source_asana", "fqn": ["asana", "asana__project"], "unique_id": "model.asana.asana__project", "package_name": "asana", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/asana", "path": "asana__project.sql", "original_file_path": "models/asana__project.sql", "name": "asana__project", "alias": "asana__project", "checksum": {"name": "sha256", "checksum": "91f218d2cb1e3f59adce898263d14060794892986bce92fda2825d39ed99e170"}, "tags": [], "refs": [["int_asana__project_task_metrics"], ["stg_asana__project"], ["int_asana__project_user"], ["stg_asana__user"], ["stg_asana__team"], ["stg_asana__section"]], "sources": [], "metrics": [], "description": "Table of projects' basic info enriched with metrics regarding tasks and completions", "columns": {"project_id": {"name": "project_id", "description": "System-generated unique ID of the project.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "project_name": {"name": "project_name", "description": "UI-facing name of the project", "meta": {}, "data_type": null, "quote": null, "tags": []}, "number_of_open_tasks": {"name": "number_of_open_tasks", "description": "Count of the currently open tasks in this project", "meta": {}, "data_type": null, "quote": null, "tags": []}, "number_of_assigned_open_tasks": {"name": "number_of_assigned_open_tasks", "description": "Count of the open and assigned tasks in this project.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "number_of_tasks_completed": {"name": "number_of_tasks_completed", "description": "Count of tasks that have been completed in this project", "meta": {}, "data_type": null, "quote": null, "tags": []}, "avg_close_time_days": {"name": "avg_close_time_days", "description": "The avg number of days it has taken to close tasks in this project", "meta": {}, "data_type": null, "quote": null, "tags": []}, "avg_close_time_assigned_days": {"name": "avg_close_time_assigned_days", "description": "The avg number of days it has taken to close tasks, since their *last* assignment, in this project", "meta": {}, "data_type": null, "quote": null, "tags": []}, "team_id": {"name": "team_id", "description": "Foreign key referencing the ASANA_TEAM that the project is associated with", "meta": {}, "data_type": null, "quote": null, "tags": []}, "team_name": {"name": "team_name", "description": "User-facing name of the project's team", "meta": {}, "data_type": null, "quote": null, "tags": []}, "is_archived": {"name": "is_archived", "description": "Boolean representing if the project has been archived in the UI", "meta": {}, "data_type": null, "quote": null, "tags": []}, "project_link": {"name": "project_link", "description": "URL formatted to bring you directly to the project in asana.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "created_at": {"name": "created_at", "description": "Timestamp of when the project was created", "meta": {}, "data_type": null, "quote": null, "tags": []}, "current_status": {"name": "current_status", "description": "The most recent progress status update for the project (free-form string)", "meta": {}, "data_type": null, "quote": null, "tags": []}, "due_date": {"name": "due_date", "description": "The date the project is due on, if given", "meta": {}, "data_type": null, "quote": null, "tags": []}, "last_modified_at": {"name": "last_modified_at", "description": "Timestamp of when the project was last modified (doesn't include comments or tasks)", "meta": {}, "data_type": null, "quote": null, "tags": []}, "owner_user_id": {"name": "owner_user_id", "description": "Foreign key referencing the USER who owns the project.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "users_involved": {"name": "users_involved", "description": "Aggregated list of the names + roles of the users involved (working on or owning) a project", "meta": {}, "data_type": null, "quote": null, "tags": []}, "number_of_users_involved": {"name": "number_of_users_involved", "description": "Count of the unique users associated with the project", "meta": {}, "data_type": null, "quote": null, "tags": []}, "is_public": {"name": "is_public", "description": "Boolean that's true if public to the whole workspace, false if private.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "sections": {"name": "sections", "description": "Aggregated list of the sections that exist in the project.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "notes": {"name": "notes", "description": "Free-form textual description associated with project", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true}, "patch_path": "asana://models/asana.yml", "compiled_path": "target/compiled/asana/models/asana__project.sql", "build_path": null, "deferred": false, "unrendered_config": {"schema": "asana", "materialized": "table"}, "created_at": 1663600953.7776792, "compiled_sql": "with __dbt__cte__int_asana__project_task_metrics as (\nwith task as (\n\n select *\n from `dbt-package-testing`.`asana_source_integration_source_asana`.`asana__task`\n\n),\n\nproject as (\n\n select * \n from `dbt-package-testing`.`asana_source_integration_source_stg_asana`.`stg_asana__project`\n\n),\n\nproject_task as (\n\n select * \n from `dbt-package-testing`.`asana_source_integration_source_stg_asana`.`stg_asana__project_task`\n),\n\nproject_task_history as (\n\n select\n project.project_id,\n task.task_id,\n task.is_completed as task_is_completed,\n task.assignee_user_id as task_assignee_user_id,\n task.days_open as task_days_open,\n task.days_since_last_assignment as task_days_assigned_current_user\n\n from project\n left join project_task \n on project.project_id = project_task.project_id\n left join task \n on project_task.task_id = task.task_id\n\n),\n\nagg_proj_tasks as (\n\n select \n project_id,\n sum(case when not task_is_completed then 1 else 0 end) as number_of_open_tasks,\n sum(case when not task_is_completed and task_assignee_user_id is not null then 1 else 0 end) as number_of_assigned_open_tasks,\n sum(case when task_is_completed then 1 else 0 end) as number_of_tasks_completed,\n sum(case when task_is_completed and task_assignee_user_id is not null then 1 else 0 end) as number_of_assigned_tasks_completed,\n sum(case when task_is_completed then task_days_open else 0 end) as total_days_open,\n sum(case when task_is_completed then task_days_assigned_current_user else 0 end) as total_days_assigned_last_user -- will divde later for avg\n\n from project_task_history\n\n group by 1\n\n),\n\nfinal as (\n\n select\n agg_proj_tasks.*,\n round(nullif(total_days_open, 0) * 1.0 / nullif(number_of_tasks_completed, 0), 0) as avg_close_time_days,\n round(nullif(total_days_assigned_last_user, 0) * 1.0 / nullif(number_of_assigned_tasks_completed, 0), 0) as avg_close_time_assigned_days\n\n from agg_proj_tasks\n \n)\n\nselect * from final\n), __dbt__cte__int_asana__task_assignee as (\nwith task as (\n\n select * \n from `dbt-package-testing`.`asana_source_integration_source_stg_asana`.`stg_asana__task`\n\n),\n\nasana_user as (\n\n select *\n from `dbt-package-testing`.`asana_source_integration_source_stg_asana`.`stg_asana__user`\n),\n\ntask_assignee as (\n\n select\n task.*,\n assignee_user_id is not null as has_assignee,\n asana_user.user_name as assignee_name,\n asana_user.email as assignee_email\n\n from task \n left join asana_user \n on task.assignee_user_id = asana_user.user_id\n)\n\nselect * from task_assignee\n), __dbt__cte__int_asana__project_user as (\nwith project_tasks as (\n \n select *\n from `dbt-package-testing`.`asana_source_integration_source_stg_asana`.`stg_asana__project_task`\n),\n\nassigned_tasks as (\n \n select * \n from __dbt__cte__int_asana__task_assignee\n where has_assignee\n \n),\n\nproject as (\n \n select *\n from `dbt-package-testing`.`asana_source_integration_source_stg_asana`.`stg_asana__project`\n\n where not is_archived\n\n),\n\nproject_assignee as (\n\n select\n project_tasks.project_id,\n project_tasks.task_id,\n assigned_tasks.assignee_user_id,\n assigned_tasks.assignee_name,\n not assigned_tasks.is_completed as currently_working_on\n\n from project_tasks \n join assigned_tasks \n on assigned_tasks.task_id = project_tasks.task_id\n\n),\n\nproject_owner as (\n\n select \n project_id,\n project_name,\n owner_user_id\n\n from project\n \n where owner_user_id is not null\n),\n\nproject_user as (\n \n select\n project_id,\n project_name,\n owner_user_id as user_id,\n 'owner' as role,\n null as currently_working_on\n \n from project_owner\n\n union all\n\n select\n project.project_id,\n project.project_name,\n project_assignee.assignee_user_id as user_id,\n 'task assignee' as role,\n project_assignee.currently_working_on\n \n from project \n \n join project_assignee \n on project.project_id = project_assignee.project_id\n group by 1,2,3,4,5\n\n)\n\n\nselect * from project_user\n),project_task_metrics as (\n\n select *\n from __dbt__cte__int_asana__project_task_metrics\n),\n\nproject as (\n \n select *\n from `dbt-package-testing`.`asana_source_integration_source_stg_asana`.`stg_asana__project`\n),\n\nproject_user as (\n \n select *\n from __dbt__cte__int_asana__project_user\n),\n\nasana_user as (\n select *\n from `dbt-package-testing`.`asana_source_integration_source_stg_asana`.`stg_asana__user`\n),\n\nteam as (\n select *\n from `dbt-package-testing`.`asana_source_integration_source_stg_asana`.`stg_asana__team`\n),\n\nagg_sections as (\n\n select\n project_id,\n \n string_agg(section_name, ', ')\n\n as sections\n\n from `dbt-package-testing`.`asana_source_integration_source_stg_asana`.`stg_asana__section`\n where section_name != '(no section)'\n group by 1\n),\n\nagg_project_users as (\n\n select \n project_user.project_id,\n \n string_agg(asana_user.user_name || ' as ' || project_user.role, ', ')\n\n as users\n\n from project_user join asana_user using(user_id)\n\n group by 1\n\n),\n\n-- need to split from above due to redshift's inability to string/list_agg and use distinct aggregates\ncount_project_users as (\n \n select \n project_id, \n count(distinct user_id) as number_of_users_involved\n\n from project_user\n group by 1\n\n),\n\nproject_join as (\n\n select\n project.project_id,\n project_name,\n\n coalesce(project_task_metrics.number_of_open_tasks, 0) as number_of_open_tasks,\n coalesce(project_task_metrics.number_of_assigned_open_tasks, 0) as number_of_assigned_open_tasks,\n coalesce(project_task_metrics.number_of_tasks_completed, 0) as number_of_tasks_completed,\n round(project_task_metrics.avg_close_time_days, 0) as avg_close_time_days,\n round(project_task_metrics.avg_close_time_assigned_days, 0) as avg_close_time_assigned_days,\n\n 'https://app.asana.com/0/' || project.project_id ||'/' || project.project_id as project_link,\n\n project.team_id,\n team.team_name,\n project.is_archived,\n created_at,\n current_status,\n due_date,\n modified_at as last_modified_at,\n owner_user_id,\n agg_project_users.users as users_involved,\n coalesce(count_project_users.number_of_users_involved, 0) as number_of_users_involved,\n agg_sections.sections,\n project.notes,\n project.is_public\n\n from\n project \n left join project_task_metrics on project.project_id = project_task_metrics.project_id \n left join agg_project_users on project.project_id = agg_project_users.project_id \n left join count_project_users on project.project_id = count_project_users.project_id\n join team on team.team_id = project.team_id -- every project needs a team\n left join agg_sections on project.project_id = agg_sections.project_id\n\n)\n\nselect * from project_join", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.asana.int_asana__project_task_metrics", "sql": " __dbt__cte__int_asana__project_task_metrics as (\nwith task as (\n\n select *\n from `dbt-package-testing`.`asana_source_integration_source_asana`.`asana__task`\n\n),\n\nproject as (\n\n select * \n from `dbt-package-testing`.`asana_source_integration_source_stg_asana`.`stg_asana__project`\n\n),\n\nproject_task as (\n\n select * \n from `dbt-package-testing`.`asana_source_integration_source_stg_asana`.`stg_asana__project_task`\n),\n\nproject_task_history as (\n\n select\n project.project_id,\n task.task_id,\n task.is_completed as task_is_completed,\n task.assignee_user_id as task_assignee_user_id,\n task.days_open as task_days_open,\n task.days_since_last_assignment as task_days_assigned_current_user\n\n from project\n left join project_task \n on project.project_id = project_task.project_id\n left join task \n on project_task.task_id = task.task_id\n\n),\n\nagg_proj_tasks as (\n\n select \n project_id,\n sum(case when not task_is_completed then 1 else 0 end) as number_of_open_tasks,\n sum(case when not task_is_completed and task_assignee_user_id is not null then 1 else 0 end) as number_of_assigned_open_tasks,\n sum(case when task_is_completed then 1 else 0 end) as number_of_tasks_completed,\n sum(case when task_is_completed and task_assignee_user_id is not null then 1 else 0 end) as number_of_assigned_tasks_completed,\n sum(case when task_is_completed then task_days_open else 0 end) as total_days_open,\n sum(case when task_is_completed then task_days_assigned_current_user else 0 end) as total_days_assigned_last_user -- will divde later for avg\n\n from project_task_history\n\n group by 1\n\n),\n\nfinal as (\n\n select\n agg_proj_tasks.*,\n round(nullif(total_days_open, 0) * 1.0 / nullif(number_of_tasks_completed, 0), 0) as avg_close_time_days,\n round(nullif(total_days_assigned_last_user, 0) * 1.0 / nullif(number_of_assigned_tasks_completed, 0), 0) as avg_close_time_assigned_days\n\n from agg_proj_tasks\n \n)\n\nselect * from final\n)"}, {"id": "model.asana.int_asana__task_assignee", "sql": " __dbt__cte__int_asana__task_assignee as (\nwith task as (\n\n select * \n from `dbt-package-testing`.`asana_source_integration_source_stg_asana`.`stg_asana__task`\n\n),\n\nasana_user as (\n\n select *\n from `dbt-package-testing`.`asana_source_integration_source_stg_asana`.`stg_asana__user`\n),\n\ntask_assignee as (\n\n select\n task.*,\n assignee_user_id is not null as has_assignee,\n asana_user.user_name as assignee_name,\n asana_user.email as assignee_email\n\n from task \n left join asana_user \n on task.assignee_user_id = asana_user.user_id\n)\n\nselect * from task_assignee\n)"}, {"id": "model.asana.int_asana__project_user", "sql": " __dbt__cte__int_asana__project_user as (\nwith project_tasks as (\n \n select *\n from `dbt-package-testing`.`asana_source_integration_source_stg_asana`.`stg_asana__project_task`\n),\n\nassigned_tasks as (\n \n select * \n from __dbt__cte__int_asana__task_assignee\n where has_assignee\n \n),\n\nproject as (\n \n select *\n from `dbt-package-testing`.`asana_source_integration_source_stg_asana`.`stg_asana__project`\n\n where not is_archived\n\n),\n\nproject_assignee as (\n\n select\n project_tasks.project_id,\n project_tasks.task_id,\n assigned_tasks.assignee_user_id,\n assigned_tasks.assignee_name,\n not assigned_tasks.is_completed as currently_working_on\n\n from project_tasks \n join assigned_tasks \n on assigned_tasks.task_id = project_tasks.task_id\n\n),\n\nproject_owner as (\n\n select \n project_id,\n project_name,\n owner_user_id\n\n from project\n \n where owner_user_id is not null\n),\n\nproject_user as (\n \n select\n project_id,\n project_name,\n owner_user_id as user_id,\n 'owner' as role,\n null as currently_working_on\n \n from project_owner\n\n union all\n\n select\n project.project_id,\n project.project_name,\n project_assignee.assignee_user_id as user_id,\n 'task assignee' as role,\n project_assignee.currently_working_on\n \n from project \n \n join project_assignee \n on project.project_id = project_assignee.project_id\n group by 1,2,3,4,5\n\n)\n\n\nselect * from project_user\n)"}], "relation_name": "`dbt-package-testing`.`asana_source_integration_source_asana`.`asana__project`"}, "model.asana.asana__tag": {"raw_sql": "with asana_tag as (\n\n select * \n from {{ var('tag') }}\n),\n\ntask_tag as (\n\n select * \n from {{ var('task_tag') }}\n),\n\ntask as (\n\n select *\n from {{ ref('asana__task') }}\n\n where is_completed and tags is not null\n\n),\n\nagg_tag as (\n\n select\n asana_tag.tag_id,\n asana_tag.tag_name,\n asana_tag.created_at,\n sum(case when not task.is_completed then 1 else 0 end) as number_of_open_tasks,\n sum(case when not task.is_completed and task.assignee_user_id is not null then 1 else 0 end) as number_of_assigned_open_tasks,\n sum(case when task.is_completed then 1 else 0 end) as number_of_tasks_completed,\n round(avg(case when task.is_completed then task.days_open else null end), 0) as avg_days_open,\n round(avg(case when task.is_completed then task.days_since_last_assignment else null end), 0) as avg_days_assigned\n\n\n from asana_tag \n left join task_tag on asana_tag.tag_id = task_tag.tag_id\n left join task on task.task_id = task_tag.task_id\n\n group by 1,2,3\n)\n\nselect * from agg_tag", "compiled": true, "resource_type": "model", "depends_on": {"macros": [], "nodes": ["model.asana_source.stg_asana__tag", "model.asana_source.stg_asana__task_tag", "model.asana.asana__task"]}, "config": {"enabled": true, "alias": null, "schema": "asana", "database": null, "tags": [], "meta": {}, "materialized": "table", "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "asana_source_integration_source_asana", "fqn": ["asana", "asana__tag"], "unique_id": "model.asana.asana__tag", "package_name": "asana", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/asana", "path": "asana__tag.sql", "original_file_path": "models/asana__tag.sql", "name": "asana__tag", "alias": "asana__tag", "checksum": {"name": "sha256", "checksum": "e8783d268c5d3f46a7e11e597a0090254f15aa92b89122dcf6ee2481e77eb433"}, "tags": [], "refs": [["stg_asana__tag"], ["stg_asana__task_tag"], ["asana__task"]], "sources": [], "metrics": [], "description": "Table of tag basic info enriched with some task metrics.", "columns": {"tag_id": {"name": "tag_id", "description": "System-generated unique ID for the tag", "meta": {}, "data_type": null, "quote": null, "tags": []}, "tag_name": {"name": "tag_name", "description": "UI-facing name of the tag", "meta": {}, "data_type": null, "quote": null, "tags": []}, "created_at": {"name": "created_at", "description": "Timestamp of when the tag was created", "meta": {}, "data_type": null, "quote": null, "tags": []}, "number_of_open_tasks": {"name": "number_of_open_tasks", "description": "Count of the currently open tasks with this tag.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "number_of_assigned_open_tasks": {"name": "number_of_assigned_open_tasks", "description": "Count of the open and assigned tasks with this tag.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "number_of_tasks_completed": {"name": "number_of_tasks_completed", "description": "Count of tasks with this tag that have been completed.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "avg_days_open": {"name": "avg_days_open", "description": "The avg number of days that completed tasks with this tag were open.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "avg_days_assigned": {"name": "avg_days_assigned", "description": "The avg number of days that completed tasks with this tag were open and assigned.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true}, "patch_path": "asana://models/asana.yml", "compiled_path": "target/compiled/asana/models/asana__tag.sql", "build_path": null, "deferred": false, "unrendered_config": {"schema": "asana", "materialized": "table"}, "created_at": 1663600953.780413, "compiled_sql": "with asana_tag as (\n\n select * \n from `dbt-package-testing`.`asana_source_integration_source_stg_asana`.`stg_asana__tag`\n),\n\ntask_tag as (\n\n select * \n from `dbt-package-testing`.`asana_source_integration_source_stg_asana`.`stg_asana__task_tag`\n),\n\ntask as (\n\n select *\n from `dbt-package-testing`.`asana_source_integration_source_asana`.`asana__task`\n\n where is_completed and tags is not null\n\n),\n\nagg_tag as (\n\n select\n asana_tag.tag_id,\n asana_tag.tag_name,\n asana_tag.created_at,\n sum(case when not task.is_completed then 1 else 0 end) as number_of_open_tasks,\n sum(case when not task.is_completed and task.assignee_user_id is not null then 1 else 0 end) as number_of_assigned_open_tasks,\n sum(case when task.is_completed then 1 else 0 end) as number_of_tasks_completed,\n round(avg(case when task.is_completed then task.days_open else null end), 0) as avg_days_open,\n round(avg(case when task.is_completed then task.days_since_last_assignment else null end), 0) as avg_days_assigned\n\n\n from asana_tag \n left join task_tag on asana_tag.tag_id = task_tag.tag_id\n left join task on task.task_id = task_tag.task_id\n\n group by 1,2,3\n)\n\nselect * from agg_tag", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`asana_source_integration_source_asana`.`asana__tag`"}, "model.asana.int_asana__task_comments": {"raw_sql": "with comments as (\n \n select *\n from {{ ref('int_asana__task_story') }}\n where comment_content is not null\n order by target_task_id, created_at asc\n\n),\n\ntask_conversation as (\n\n select\n target_task_id as task_id,\n -- creates a chronologically ordered conversation about the task\n {{ fivetran_utils.string_agg( \"created_at || ' - ' || created_by_name || ': ' || comment_content\", \"'\\\\n'\" ) }} as conversation,\n count(*) as number_of_comments\n\n from comments \n group by 1\n)\n\nselect * from task_conversation", "compiled": true, "resource_type": "model", "depends_on": {"macros": ["macro.fivetran_utils.string_agg"], "nodes": ["model.asana.int_asana__task_story"]}, "config": {"enabled": true, "alias": null, "schema": "asana", "database": null, "tags": [], "meta": {}, "materialized": "ephemeral", "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "asana_source_integration_source_asana", "fqn": ["asana", "intermediate", "int_asana__task_comments"], "unique_id": "model.asana.int_asana__task_comments", "package_name": "asana", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/asana", "path": "intermediate/int_asana__task_comments.sql", "original_file_path": "models/intermediate/int_asana__task_comments.sql", "name": "int_asana__task_comments", "alias": "int_asana__task_comments", "checksum": {"name": "sha256", "checksum": "b50c377464e548b3cd44e3535fd4fa56541851bfa7029f6081f1b3f6b62b380d"}, "tags": [], "refs": [["int_asana__task_story"]], "sources": [], "metrics": [], "description": "Aggregates all comments on a task into a conversation + the number of comments", "columns": {"task_id": {"name": "task_id", "description": "", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true}, "patch_path": "asana://models/intermediate/intermediate_asana.yml", "compiled_path": "target/compiled/asana/models/intermediate/int_asana__task_comments.sql", "build_path": null, "deferred": false, "unrendered_config": {"schema": "asana", "materialized": "ephemeral"}, "created_at": 1663600953.79528, "compiled_sql": "with __dbt__cte__int_asana__task_story as (\nwith story as (\n \n select * \n from `dbt-package-testing`.`asana_source_integration_source_stg_asana`.`stg_asana__story`\n\n),\n\nasana_user as (\n\n select * \n from `dbt-package-testing`.`asana_source_integration_source_stg_asana`.`stg_asana__user`\n),\n\nstory_user as (\n select \n story.*,\n asana_user.user_name as created_by_name\n from story\n join asana_user \n on story.created_by_user_id = asana_user.user_id\n),\n\nsplit_comments as (\n\n select\n story_id,\n created_at,\n created_by_user_id,\n created_by_name,\n target_task_id,\n \n case when event_type = 'comment' then story_content \n else null end as comment_content,\n\n case when event_type = 'system' then story_content \n else 'comment' end as action_description\n \n from story_user\n\n),\n\n\n-- the next CTE uses this dictionary to parse the type of action out of the event descfription\n\n\nparse_actions as (\n select\n story_id,\n target_task_id,\n created_at,\n created_by_user_id,\n created_by_name,\n comment_content,\n case \n when action_description like 'added the name%' then 'added name' \n when action_description like 'changed the name%' then 'changed name' \n when action_description like 'removed the name' then 'removed name' \n when action_description like 'added the description%' then 'added description' \n when action_description like 'changed the description%' then 'changed description' \n when action_description like 'removed the description' then 'removed description' \n when action_description like 'added to%' then 'added to project' \n when action_description like 'removed from%' then 'removed from project' \n when action_description like 'assigned%' then 'assigned' \n when action_description like 'unassigned%' then 'unassigned' \n when action_description like 'changed the due date%' then 'changed due date' \n when action_description like 'changed the start date%due date%' then 'changed due date' \n when action_description like 'changed the start date%' then 'changed start date' \n when action_description like 'removed the due date%' then 'removed due date' \n when action_description like 'removed the date range%' then 'removed due date' \n when action_description like 'removed the start date' then 'removed start date' \n when action_description like 'added subtask%' then 'added subtask' \n when action_description like 'added%collaborator%' then 'added collaborator' \n when action_description like 'moved%' then 'moved to section' \n when action_description like 'duplicated task from%' then 'duplicated this from other task' \n when action_description like 'marked%as a duplicate of this' then 'marked other task as duplicate of this' \n when action_description like 'marked this a duplicate of%' then 'marked as duplicate' \n when action_description like 'marked this task complete' then 'completed' \n when action_description like 'completed this task' then 'completed' \n when action_description like 'marked incomplete' then 'marked incomplete' \n when action_description like 'marked this task as a milestone' then 'marked as milestone' \n when action_description like 'unmarked this task as a milestone' then 'unmarked as milestone' \n when action_description like 'marked this milestone complete' then 'completed milestone' \n when action_description like 'completed this milestone' then 'completed milestone' \n when action_description like 'attached%' then 'attachment' \n when action_description like 'liked your comment' then 'liked comment' \n when action_description like 'liked this task' then 'liked task' \n when action_description like 'liked your attachment' then 'liked attachment' \n when action_description like 'liked that you completed this task' then 'liked completion' \n when action_description like 'completed the last task you were waiting on%' then 'completed dependency' \n when action_description like 'added feedback to%' then 'added feedback' \n when action_description like 'changed%to%' then 'changed tag' \n when action_description like 'cleared%' then 'cleared tag' \n when action_description like 'comment' then 'comment' \n when action_description like 'have a task due on%' then ''\n else action_description end as action_taken,\n action_description\n \n from split_comments\n\n),\n\n\nfinal as (\n \n select * \n from parse_actions\n\n -- remove actions you don't care about (set to null in the actions dictionary above)\n where action_taken is not null \n\n)\n\n\nselect * from final\n),comments as (\n \n select *\n from __dbt__cte__int_asana__task_story\n where comment_content is not null\n order by target_task_id, created_at asc\n\n),\n\ntask_conversation as (\n\n select\n target_task_id as task_id,\n -- creates a chronologically ordered conversation about the task\n \n string_agg(created_at || ' - ' || created_by_name || ': ' || comment_content, '\\n')\n\n as conversation,\n count(*) as number_of_comments\n\n from comments \n group by 1\n)\n\nselect * from task_conversation", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.asana.int_asana__task_story", "sql": " __dbt__cte__int_asana__task_story as (\nwith story as (\n \n select * \n from `dbt-package-testing`.`asana_source_integration_source_stg_asana`.`stg_asana__story`\n\n),\n\nasana_user as (\n\n select * \n from `dbt-package-testing`.`asana_source_integration_source_stg_asana`.`stg_asana__user`\n),\n\nstory_user as (\n select \n story.*,\n asana_user.user_name as created_by_name\n from story\n join asana_user \n on story.created_by_user_id = asana_user.user_id\n),\n\nsplit_comments as (\n\n select\n story_id,\n created_at,\n created_by_user_id,\n created_by_name,\n target_task_id,\n \n case when event_type = 'comment' then story_content \n else null end as comment_content,\n\n case when event_type = 'system' then story_content \n else 'comment' end as action_description\n \n from story_user\n\n),\n\n\n-- the next CTE uses this dictionary to parse the type of action out of the event descfription\n\n\nparse_actions as (\n select\n story_id,\n target_task_id,\n created_at,\n created_by_user_id,\n created_by_name,\n comment_content,\n case \n when action_description like 'added the name%' then 'added name' \n when action_description like 'changed the name%' then 'changed name' \n when action_description like 'removed the name' then 'removed name' \n when action_description like 'added the description%' then 'added description' \n when action_description like 'changed the description%' then 'changed description' \n when action_description like 'removed the description' then 'removed description' \n when action_description like 'added to%' then 'added to project' \n when action_description like 'removed from%' then 'removed from project' \n when action_description like 'assigned%' then 'assigned' \n when action_description like 'unassigned%' then 'unassigned' \n when action_description like 'changed the due date%' then 'changed due date' \n when action_description like 'changed the start date%due date%' then 'changed due date' \n when action_description like 'changed the start date%' then 'changed start date' \n when action_description like 'removed the due date%' then 'removed due date' \n when action_description like 'removed the date range%' then 'removed due date' \n when action_description like 'removed the start date' then 'removed start date' \n when action_description like 'added subtask%' then 'added subtask' \n when action_description like 'added%collaborator%' then 'added collaborator' \n when action_description like 'moved%' then 'moved to section' \n when action_description like 'duplicated task from%' then 'duplicated this from other task' \n when action_description like 'marked%as a duplicate of this' then 'marked other task as duplicate of this' \n when action_description like 'marked this a duplicate of%' then 'marked as duplicate' \n when action_description like 'marked this task complete' then 'completed' \n when action_description like 'completed this task' then 'completed' \n when action_description like 'marked incomplete' then 'marked incomplete' \n when action_description like 'marked this task as a milestone' then 'marked as milestone' \n when action_description like 'unmarked this task as a milestone' then 'unmarked as milestone' \n when action_description like 'marked this milestone complete' then 'completed milestone' \n when action_description like 'completed this milestone' then 'completed milestone' \n when action_description like 'attached%' then 'attachment' \n when action_description like 'liked your comment' then 'liked comment' \n when action_description like 'liked this task' then 'liked task' \n when action_description like 'liked your attachment' then 'liked attachment' \n when action_description like 'liked that you completed this task' then 'liked completion' \n when action_description like 'completed the last task you were waiting on%' then 'completed dependency' \n when action_description like 'added feedback to%' then 'added feedback' \n when action_description like 'changed%to%' then 'changed tag' \n when action_description like 'cleared%' then 'cleared tag' \n when action_description like 'comment' then 'comment' \n when action_description like 'have a task due on%' then ''\n else action_description end as action_taken,\n action_description\n \n from split_comments\n\n),\n\n\nfinal as (\n \n select * \n from parse_actions\n\n -- remove actions you don't care about (set to null in the actions dictionary above)\n where action_taken is not null \n\n)\n\n\nselect * from final\n)"}], "relation_name": null}, "model.asana.int_asana__project_task_metrics": {"raw_sql": "with task as (\n\n select *\n from {{ ref('asana__task') }}\n\n),\n\nproject as (\n\n select * \n from {{ var('project') }}\n\n),\n\nproject_task as (\n\n select * \n from {{ var('project_task') }}\n),\n\nproject_task_history as (\n\n select\n project.project_id,\n task.task_id,\n task.is_completed as task_is_completed,\n task.assignee_user_id as task_assignee_user_id,\n task.days_open as task_days_open,\n task.days_since_last_assignment as task_days_assigned_current_user\n\n from project\n left join project_task \n on project.project_id = project_task.project_id\n left join task \n on project_task.task_id = task.task_id\n\n),\n\nagg_proj_tasks as (\n\n select \n project_id,\n sum(case when not task_is_completed then 1 else 0 end) as number_of_open_tasks,\n sum(case when not task_is_completed and task_assignee_user_id is not null then 1 else 0 end) as number_of_assigned_open_tasks,\n sum(case when task_is_completed then 1 else 0 end) as number_of_tasks_completed,\n sum(case when task_is_completed and task_assignee_user_id is not null then 1 else 0 end) as number_of_assigned_tasks_completed,\n sum(case when task_is_completed then task_days_open else 0 end) as total_days_open,\n sum(case when task_is_completed then task_days_assigned_current_user else 0 end) as total_days_assigned_last_user -- will divde later for avg\n\n from project_task_history\n\n group by 1\n\n),\n\nfinal as (\n\n select\n agg_proj_tasks.*,\n round(nullif(total_days_open, 0) * 1.0 / nullif(number_of_tasks_completed, 0), 0) as avg_close_time_days,\n round(nullif(total_days_assigned_last_user, 0) * 1.0 / nullif(number_of_assigned_tasks_completed, 0), 0) as avg_close_time_assigned_days\n\n from agg_proj_tasks\n \n)\n\nselect * from final", "compiled": true, "resource_type": "model", "depends_on": {"macros": [], "nodes": ["model.asana.asana__task", "model.asana_source.stg_asana__project", "model.asana_source.stg_asana__project_task"]}, "config": {"enabled": true, "alias": null, "schema": "asana", "database": null, "tags": [], "meta": {}, "materialized": "ephemeral", "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "asana_source_integration_source_asana", "fqn": ["asana", "intermediate", "int_asana__project_task_metrics"], "unique_id": "model.asana.int_asana__project_task_metrics", "package_name": "asana", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/asana", "path": "intermediate/int_asana__project_task_metrics.sql", "original_file_path": "models/intermediate/int_asana__project_task_metrics.sql", "name": "int_asana__project_task_metrics", "alias": "int_asana__project_task_metrics", "checksum": {"name": "sha256", "checksum": "59d3c639d66f84f786b75ff772ccc57cff3037a5d43fd3699a05da0459b2da7a"}, "tags": [], "refs": [["asana__task"], ["stg_asana__project"], ["stg_asana__project_task"]], "sources": [], "metrics": [], "description": "Draws from (non-intermediate) ASANA_TASK to compute metrics about tasks in each project.", "columns": {"project_id": {"name": "project_id", "description": "", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true}, "patch_path": "asana://models/intermediate/intermediate_asana.yml", "compiled_path": "target/compiled/asana/models/intermediate/int_asana__project_task_metrics.sql", "build_path": null, "deferred": false, "unrendered_config": {"schema": "asana", "materialized": "ephemeral"}, "created_at": 1663600953.793971, "compiled_sql": "with task as (\n\n select *\n from `dbt-package-testing`.`asana_source_integration_source_asana`.`asana__task`\n\n),\n\nproject as (\n\n select * \n from `dbt-package-testing`.`asana_source_integration_source_stg_asana`.`stg_asana__project`\n\n),\n\nproject_task as (\n\n select * \n from `dbt-package-testing`.`asana_source_integration_source_stg_asana`.`stg_asana__project_task`\n),\n\nproject_task_history as (\n\n select\n project.project_id,\n task.task_id,\n task.is_completed as task_is_completed,\n task.assignee_user_id as task_assignee_user_id,\n task.days_open as task_days_open,\n task.days_since_last_assignment as task_days_assigned_current_user\n\n from project\n left join project_task \n on project.project_id = project_task.project_id\n left join task \n on project_task.task_id = task.task_id\n\n),\n\nagg_proj_tasks as (\n\n select \n project_id,\n sum(case when not task_is_completed then 1 else 0 end) as number_of_open_tasks,\n sum(case when not task_is_completed and task_assignee_user_id is not null then 1 else 0 end) as number_of_assigned_open_tasks,\n sum(case when task_is_completed then 1 else 0 end) as number_of_tasks_completed,\n sum(case when task_is_completed and task_assignee_user_id is not null then 1 else 0 end) as number_of_assigned_tasks_completed,\n sum(case when task_is_completed then task_days_open else 0 end) as total_days_open,\n sum(case when task_is_completed then task_days_assigned_current_user else 0 end) as total_days_assigned_last_user -- will divde later for avg\n\n from project_task_history\n\n group by 1\n\n),\n\nfinal as (\n\n select\n agg_proj_tasks.*,\n round(nullif(total_days_open, 0) * 1.0 / nullif(number_of_tasks_completed, 0), 0) as avg_close_time_days,\n round(nullif(total_days_assigned_last_user, 0) * 1.0 / nullif(number_of_assigned_tasks_completed, 0), 0) as avg_close_time_assigned_days\n\n from agg_proj_tasks\n \n)\n\nselect * from final", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null}, "model.asana.int_asana__user_task_metrics": {"raw_sql": "with tasks as (\n\n select * \n from {{ ref('asana__task') }}\n where assignee_user_id is not null\n\n), \n\nagg_user_tasks as (\n\n select \n assignee_user_id as user_id,\n sum(case when not is_completed then 1 else 0 end) as number_of_open_tasks,\n sum(case when is_completed then 1 else 0 end) as number_of_tasks_completed,\n sum(case when is_completed then days_since_last_assignment else 0 end) as days_assigned_this_user -- will divde later for avg\n\n from tasks\n\n group by 1\n\n),\n\nfinal as (\n select\n agg_user_tasks.user_id,\n agg_user_tasks.number_of_open_tasks,\n agg_user_tasks.number_of_tasks_completed,\n nullif(agg_user_tasks.days_assigned_this_user, 0) * 1.0 / nullif(agg_user_tasks.number_of_tasks_completed, 0) as avg_close_time_days\n\n from \n agg_user_tasks \n)\n\nselect * from final", "compiled": true, "resource_type": "model", "depends_on": {"macros": [], "nodes": ["model.asana.asana__task"]}, "config": {"enabled": true, "alias": null, "schema": "asana", "database": null, "tags": [], "meta": {}, "materialized": "ephemeral", "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "asana_source_integration_source_asana", "fqn": ["asana", "intermediate", "int_asana__user_task_metrics"], "unique_id": "model.asana.int_asana__user_task_metrics", "package_name": "asana", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/asana", "path": "intermediate/int_asana__user_task_metrics.sql", "original_file_path": "models/intermediate/int_asana__user_task_metrics.sql", "name": "int_asana__user_task_metrics", "alias": "int_asana__user_task_metrics", "checksum": {"name": "sha256", "checksum": "22283e2744be59600dfcd8f89912736207b817d43c8ed00b1a49a7e4926237bd"}, "tags": [], "refs": [["asana__task"]], "sources": [], "metrics": [], "description": "Draws from (non-intermediate) ASANA_TASK to compute metrics about tasks for each user.", "columns": {"user_id": {"name": "user_id", "description": "", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true}, "patch_path": "asana://models/intermediate/intermediate_asana.yml", "compiled_path": "target/compiled/asana/models/intermediate/int_asana__user_task_metrics.sql", "build_path": null, "deferred": false, "unrendered_config": {"schema": "asana", "materialized": "ephemeral"}, "created_at": 1663600953.798153, "compiled_sql": "with tasks as (\n\n select * \n from `dbt-package-testing`.`asana_source_integration_source_asana`.`asana__task`\n where assignee_user_id is not null\n\n), \n\nagg_user_tasks as (\n\n select \n assignee_user_id as user_id,\n sum(case when not is_completed then 1 else 0 end) as number_of_open_tasks,\n sum(case when is_completed then 1 else 0 end) as number_of_tasks_completed,\n sum(case when is_completed then days_since_last_assignment else 0 end) as days_assigned_this_user -- will divde later for avg\n\n from tasks\n\n group by 1\n\n),\n\nfinal as (\n select\n agg_user_tasks.user_id,\n agg_user_tasks.number_of_open_tasks,\n agg_user_tasks.number_of_tasks_completed,\n nullif(agg_user_tasks.days_assigned_this_user, 0) * 1.0 / nullif(agg_user_tasks.number_of_tasks_completed, 0) as avg_close_time_days\n\n from \n agg_user_tasks \n)\n\nselect * from final", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null}, "model.asana.int_asana__task_tags": {"raw_sql": "with task_tag as (\n \n select *\n from {{ var('task_tag') }}\n\n),\n\nasana_tag as (\n\n select * \n from {{ var('tag') }}\n\n),\n\nagg_tags as (\n\n select\n task_tag.task_id,\n {{ fivetran_utils.string_agg( 'asana_tag.tag_name', \"', '\" )}} as tags,\n count(*) as number_of_tags\n from task_tag \n join asana_tag \n on asana_tag.tag_id = task_tag.tag_id\n group by 1\n \n)\n\nselect * from agg_tags", "compiled": true, "resource_type": "model", "depends_on": {"macros": ["macro.fivetran_utils.string_agg"], "nodes": ["model.asana_source.stg_asana__task_tag", "model.asana_source.stg_asana__tag"]}, "config": {"enabled": true, "alias": null, "schema": "asana", "database": null, "tags": [], "meta": {}, "materialized": "ephemeral", "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "asana_source_integration_source_asana", "fqn": ["asana", "intermediate", "int_asana__task_tags"], "unique_id": "model.asana.int_asana__task_tags", "package_name": "asana", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/asana", "path": "intermediate/int_asana__task_tags.sql", "original_file_path": "models/intermediate/int_asana__task_tags.sql", "name": "int_asana__task_tags", "alias": "int_asana__task_tags", "checksum": {"name": "sha256", "checksum": "8016dbd490f23f719d4a3dd688ab6c5c2897b86746e3ea63c0b739cfbdda6848"}, "tags": [], "refs": [["stg_asana__task_tag"], ["stg_asana__tag"]], "sources": [], "metrics": [], "description": "Aggregates a count of and a list of the names of the tags attached to each task.", "columns": {"task_id": {"name": "task_id", "description": "", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true}, "patch_path": "asana://models/intermediate/intermediate_asana.yml", "compiled_path": "target/compiled/asana/models/intermediate/int_asana__task_tags.sql", "build_path": null, "deferred": false, "unrendered_config": {"schema": "asana", "materialized": "ephemeral"}, "created_at": 1663600953.797813, "compiled_sql": "with task_tag as (\n \n select *\n from `dbt-package-testing`.`asana_source_integration_source_stg_asana`.`stg_asana__task_tag`\n\n),\n\nasana_tag as (\n\n select * \n from `dbt-package-testing`.`asana_source_integration_source_stg_asana`.`stg_asana__tag`\n\n),\n\nagg_tags as (\n\n select\n task_tag.task_id,\n \n string_agg(asana_tag.tag_name, ', ')\n\n as tags,\n count(*) as number_of_tags\n from task_tag \n join asana_tag \n on asana_tag.tag_id = task_tag.tag_id\n group by 1\n \n)\n\nselect * from agg_tags", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null}, "model.asana.int_asana__task_open_length": {"raw_sql": "with task as (\n \n select *\n from {{ var('task') }}\n\n),\n\nstory as (\n\n select * \n from {{ ref('int_asana__task_story') }}\n\n),\n\nassignments as (\n \n select \n target_task_id as task_id,\n min(created_at) as first_assigned_at,\n max(created_at) as last_assigned_at -- current assignment\n\n from story\n where action_taken = 'assigned'\n\n group by 1\n\n),\n\n\nopen_assigned_length as (\n\n {% set open_until = 'task.completed_at' if 'task.is_completed' is true else dbt_utils.current_timestamp() %}\n\n select\n task.task_id,\n task.is_completed,\n task.completed_at,\n task.assignee_user_id is not null as is_currently_assigned,\n assignments.task_id is not null as has_been_assigned,\n assignments.last_assigned_at as last_assigned_at,\n assignments.first_assigned_at as first_assigned_at,\n {{ dbt_utils.datediff('task.created_at', open_until, 'day') }} as days_open,\n\n -- if the task is currently assigned, this is the time it has been assigned to this current user.\n {{ dbt_utils.datediff('assignments.last_assigned_at', open_until, 'day') }} as days_since_last_assignment,\n\n {{ dbt_utils.datediff('assignments.first_assigned_at', open_until, 'day') }} as days_since_first_assignment\n \n\n from task\n left join assignments \n on task.task_id = assignments.task_id\n\n)\n\n\nselect * from open_assigned_length", "compiled": true, "resource_type": "model", "depends_on": {"macros": ["macro.dbt_utils.current_timestamp", "macro.dbt_utils.datediff"], "nodes": ["model.asana_source.stg_asana__task", "model.asana.int_asana__task_story"]}, "config": {"enabled": true, "alias": null, "schema": "asana", "database": null, "tags": [], "meta": {}, "materialized": "ephemeral", "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "asana_source_integration_source_asana", "fqn": ["asana", "intermediate", "int_asana__task_open_length"], "unique_id": "model.asana.int_asana__task_open_length", "package_name": "asana", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/asana", "path": "intermediate/int_asana__task_open_length.sql", "original_file_path": "models/intermediate/int_asana__task_open_length.sql", "name": "int_asana__task_open_length", "alias": "int_asana__task_open_length", "checksum": {"name": "sha256", "checksum": "c4b9e95d02887eb78b1e57f611e87a7c1b9a5e30ff6f9018647a2b0ebc592f0e"}, "tags": [], "refs": [["stg_asana__task"], ["int_asana__task_story"]], "sources": [], "metrics": [], "description": "Computes the days that each task has spent open and assigned.", "columns": {"task_id": {"name": "task_id", "description": "", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true}, "patch_path": "asana://models/intermediate/intermediate_asana.yml", "compiled_path": "target/compiled/asana/models/intermediate/int_asana__task_open_length.sql", "build_path": null, "deferred": false, "unrendered_config": {"schema": "asana", "materialized": "ephemeral"}, "created_at": 1663600953.79641, "compiled_sql": "with __dbt__cte__int_asana__task_story as (\nwith story as (\n \n select * \n from `dbt-package-testing`.`asana_source_integration_source_stg_asana`.`stg_asana__story`\n\n),\n\nasana_user as (\n\n select * \n from `dbt-package-testing`.`asana_source_integration_source_stg_asana`.`stg_asana__user`\n),\n\nstory_user as (\n select \n story.*,\n asana_user.user_name as created_by_name\n from story\n join asana_user \n on story.created_by_user_id = asana_user.user_id\n),\n\nsplit_comments as (\n\n select\n story_id,\n created_at,\n created_by_user_id,\n created_by_name,\n target_task_id,\n \n case when event_type = 'comment' then story_content \n else null end as comment_content,\n\n case when event_type = 'system' then story_content \n else 'comment' end as action_description\n \n from story_user\n\n),\n\n\n-- the next CTE uses this dictionary to parse the type of action out of the event descfription\n\n\nparse_actions as (\n select\n story_id,\n target_task_id,\n created_at,\n created_by_user_id,\n created_by_name,\n comment_content,\n case \n when action_description like 'added the name%' then 'added name' \n when action_description like 'changed the name%' then 'changed name' \n when action_description like 'removed the name' then 'removed name' \n when action_description like 'added the description%' then 'added description' \n when action_description like 'changed the description%' then 'changed description' \n when action_description like 'removed the description' then 'removed description' \n when action_description like 'added to%' then 'added to project' \n when action_description like 'removed from%' then 'removed from project' \n when action_description like 'assigned%' then 'assigned' \n when action_description like 'unassigned%' then 'unassigned' \n when action_description like 'changed the due date%' then 'changed due date' \n when action_description like 'changed the start date%due date%' then 'changed due date' \n when action_description like 'changed the start date%' then 'changed start date' \n when action_description like 'removed the due date%' then 'removed due date' \n when action_description like 'removed the date range%' then 'removed due date' \n when action_description like 'removed the start date' then 'removed start date' \n when action_description like 'added subtask%' then 'added subtask' \n when action_description like 'added%collaborator%' then 'added collaborator' \n when action_description like 'moved%' then 'moved to section' \n when action_description like 'duplicated task from%' then 'duplicated this from other task' \n when action_description like 'marked%as a duplicate of this' then 'marked other task as duplicate of this' \n when action_description like 'marked this a duplicate of%' then 'marked as duplicate' \n when action_description like 'marked this task complete' then 'completed' \n when action_description like 'completed this task' then 'completed' \n when action_description like 'marked incomplete' then 'marked incomplete' \n when action_description like 'marked this task as a milestone' then 'marked as milestone' \n when action_description like 'unmarked this task as a milestone' then 'unmarked as milestone' \n when action_description like 'marked this milestone complete' then 'completed milestone' \n when action_description like 'completed this milestone' then 'completed milestone' \n when action_description like 'attached%' then 'attachment' \n when action_description like 'liked your comment' then 'liked comment' \n when action_description like 'liked this task' then 'liked task' \n when action_description like 'liked your attachment' then 'liked attachment' \n when action_description like 'liked that you completed this task' then 'liked completion' \n when action_description like 'completed the last task you were waiting on%' then 'completed dependency' \n when action_description like 'added feedback to%' then 'added feedback' \n when action_description like 'changed%to%' then 'changed tag' \n when action_description like 'cleared%' then 'cleared tag' \n when action_description like 'comment' then 'comment' \n when action_description like 'have a task due on%' then ''\n else action_description end as action_taken,\n action_description\n \n from split_comments\n\n),\n\n\nfinal as (\n \n select * \n from parse_actions\n\n -- remove actions you don't care about (set to null in the actions dictionary above)\n where action_taken is not null \n\n)\n\n\nselect * from final\n),task as (\n \n select *\n from `dbt-package-testing`.`asana_source_integration_source_stg_asana`.`stg_asana__task`\n\n),\n\nstory as (\n\n select * \n from __dbt__cte__int_asana__task_story\n\n),\n\nassignments as (\n \n select \n target_task_id as task_id,\n min(created_at) as first_assigned_at,\n max(created_at) as last_assigned_at -- current assignment\n\n from story\n where action_taken = 'assigned'\n\n group by 1\n\n),\n\n\nopen_assigned_length as (\n\n \n\n select\n task.task_id,\n task.is_completed,\n task.completed_at,\n task.assignee_user_id is not null as is_currently_assigned,\n assignments.task_id is not null as has_been_assigned,\n assignments.last_assigned_at as last_assigned_at,\n assignments.first_assigned_at as first_assigned_at,\n datetime_diff(\n cast(\n current_timestamp\n as datetime),\n cast(task.created_at as datetime),\n day\n ) as days_open,\n\n -- if the task is currently assigned, this is the time it has been assigned to this current user.\n datetime_diff(\n cast(\n current_timestamp\n as datetime),\n cast(assignments.last_assigned_at as datetime),\n day\n ) as days_since_last_assignment,\n\n datetime_diff(\n cast(\n current_timestamp\n as datetime),\n cast(assignments.first_assigned_at as datetime),\n day\n ) as days_since_first_assignment\n \n\n from task\n left join assignments \n on task.task_id = assignments.task_id\n\n)\n\n\nselect * from open_assigned_length", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.asana.int_asana__task_story", "sql": " __dbt__cte__int_asana__task_story as (\nwith story as (\n \n select * \n from `dbt-package-testing`.`asana_source_integration_source_stg_asana`.`stg_asana__story`\n\n),\n\nasana_user as (\n\n select * \n from `dbt-package-testing`.`asana_source_integration_source_stg_asana`.`stg_asana__user`\n),\n\nstory_user as (\n select \n story.*,\n asana_user.user_name as created_by_name\n from story\n join asana_user \n on story.created_by_user_id = asana_user.user_id\n),\n\nsplit_comments as (\n\n select\n story_id,\n created_at,\n created_by_user_id,\n created_by_name,\n target_task_id,\n \n case when event_type = 'comment' then story_content \n else null end as comment_content,\n\n case when event_type = 'system' then story_content \n else 'comment' end as action_description\n \n from story_user\n\n),\n\n\n-- the next CTE uses this dictionary to parse the type of action out of the event descfription\n\n\nparse_actions as (\n select\n story_id,\n target_task_id,\n created_at,\n created_by_user_id,\n created_by_name,\n comment_content,\n case \n when action_description like 'added the name%' then 'added name' \n when action_description like 'changed the name%' then 'changed name' \n when action_description like 'removed the name' then 'removed name' \n when action_description like 'added the description%' then 'added description' \n when action_description like 'changed the description%' then 'changed description' \n when action_description like 'removed the description' then 'removed description' \n when action_description like 'added to%' then 'added to project' \n when action_description like 'removed from%' then 'removed from project' \n when action_description like 'assigned%' then 'assigned' \n when action_description like 'unassigned%' then 'unassigned' \n when action_description like 'changed the due date%' then 'changed due date' \n when action_description like 'changed the start date%due date%' then 'changed due date' \n when action_description like 'changed the start date%' then 'changed start date' \n when action_description like 'removed the due date%' then 'removed due date' \n when action_description like 'removed the date range%' then 'removed due date' \n when action_description like 'removed the start date' then 'removed start date' \n when action_description like 'added subtask%' then 'added subtask' \n when action_description like 'added%collaborator%' then 'added collaborator' \n when action_description like 'moved%' then 'moved to section' \n when action_description like 'duplicated task from%' then 'duplicated this from other task' \n when action_description like 'marked%as a duplicate of this' then 'marked other task as duplicate of this' \n when action_description like 'marked this a duplicate of%' then 'marked as duplicate' \n when action_description like 'marked this task complete' then 'completed' \n when action_description like 'completed this task' then 'completed' \n when action_description like 'marked incomplete' then 'marked incomplete' \n when action_description like 'marked this task as a milestone' then 'marked as milestone' \n when action_description like 'unmarked this task as a milestone' then 'unmarked as milestone' \n when action_description like 'marked this milestone complete' then 'completed milestone' \n when action_description like 'completed this milestone' then 'completed milestone' \n when action_description like 'attached%' then 'attachment' \n when action_description like 'liked your comment' then 'liked comment' \n when action_description like 'liked this task' then 'liked task' \n when action_description like 'liked your attachment' then 'liked attachment' \n when action_description like 'liked that you completed this task' then 'liked completion' \n when action_description like 'completed the last task you were waiting on%' then 'completed dependency' \n when action_description like 'added feedback to%' then 'added feedback' \n when action_description like 'changed%to%' then 'changed tag' \n when action_description like 'cleared%' then 'cleared tag' \n when action_description like 'comment' then 'comment' \n when action_description like 'have a task due on%' then ''\n else action_description end as action_taken,\n action_description\n \n from split_comments\n\n),\n\n\nfinal as (\n \n select * \n from parse_actions\n\n -- remove actions you don't care about (set to null in the actions dictionary above)\n where action_taken is not null \n\n)\n\n\nselect * from final\n)"}], "relation_name": null}, "model.asana.int_asana__task_followers": {"raw_sql": "with task_follower as (\n \n select *\n from {{ var('task_follower') }}\n\n),\n\nasana_user as (\n\n select * \n from {{ var('user') }}\n\n),\n\nagg_followers as (\n\n select\n task_follower.task_id,\n {{ fivetran_utils.string_agg( 'asana_user.user_name', \"', '\" )}} as followers,\n count(*) as number_of_followers\n from task_follower \n join asana_user \n on asana_user.user_id = task_follower.user_id\n group by 1\n \n)\n\nselect * from agg_followers", "compiled": true, "resource_type": "model", "depends_on": {"macros": ["macro.fivetran_utils.string_agg"], "nodes": ["model.asana_source.stg_asana__task_follower", "model.asana_source.stg_asana__user"]}, "config": {"enabled": true, "alias": null, "schema": "asana", "database": null, "tags": [], "meta": {}, "materialized": "ephemeral", "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "asana_source_integration_source_asana", "fqn": ["asana", "intermediate", "int_asana__task_followers"], "unique_id": "model.asana.int_asana__task_followers", "package_name": "asana", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/asana", "path": "intermediate/int_asana__task_followers.sql", "original_file_path": "models/intermediate/int_asana__task_followers.sql", "name": "int_asana__task_followers", "alias": "int_asana__task_followers", "checksum": {"name": "sha256", "checksum": "fafdd691a271f08b345565db3962fd360163ec2213098c8fda86265d2680710c"}, "tags": [], "refs": [["stg_asana__task_follower"], ["stg_asana__user"]], "sources": [], "metrics": [], "description": "Aggregates a count of and a list of the names of the users who follow each task", "columns": {"task_id": {"name": "task_id", "description": "", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true}, "patch_path": "asana://models/intermediate/intermediate_asana.yml", "compiled_path": "target/compiled/asana/models/intermediate/int_asana__task_followers.sql", "build_path": null, "deferred": false, "unrendered_config": {"schema": "asana", "materialized": "ephemeral"}, "created_at": 1663600953.7959738, "compiled_sql": "with task_follower as (\n \n select *\n from `dbt-package-testing`.`asana_source_integration_source_stg_asana`.`stg_asana__task_follower`\n\n),\n\nasana_user as (\n\n select * \n from `dbt-package-testing`.`asana_source_integration_source_stg_asana`.`stg_asana__user`\n\n),\n\nagg_followers as (\n\n select\n task_follower.task_id,\n \n string_agg(asana_user.user_name, ', ')\n\n as followers,\n count(*) as number_of_followers\n from task_follower \n join asana_user \n on asana_user.user_id = task_follower.user_id\n group by 1\n \n)\n\nselect * from agg_followers", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null}, "model.asana.int_asana__project_user": {"raw_sql": "with project_tasks as (\n \n select *\n from {{ var('project_task') }}\n),\n\nassigned_tasks as (\n \n select * \n from {{ ref('int_asana__task_assignee') }}\n where has_assignee\n \n),\n\nproject as (\n \n select *\n from {{ var('project') }}\n\n where not is_archived\n\n),\n\nproject_assignee as (\n\n select\n project_tasks.project_id,\n project_tasks.task_id,\n assigned_tasks.assignee_user_id,\n assigned_tasks.assignee_name,\n not assigned_tasks.is_completed as currently_working_on\n\n from project_tasks \n join assigned_tasks \n on assigned_tasks.task_id = project_tasks.task_id\n\n),\n\nproject_owner as (\n\n select \n project_id,\n project_name,\n owner_user_id\n\n from project\n \n where owner_user_id is not null\n),\n\nproject_user as (\n \n select\n project_id,\n project_name,\n owner_user_id as user_id,\n 'owner' as role,\n null as currently_working_on\n \n from project_owner\n\n union all\n\n select\n project.project_id,\n project.project_name,\n project_assignee.assignee_user_id as user_id,\n 'task assignee' as role,\n project_assignee.currently_working_on\n \n from project \n \n join project_assignee \n on project.project_id = project_assignee.project_id\n group by 1,2,3,4,5\n\n)\n\n\nselect * from project_user", "compiled": true, "resource_type": "model", "depends_on": {"macros": [], "nodes": ["model.asana_source.stg_asana__project_task", "model.asana.int_asana__task_assignee", "model.asana_source.stg_asana__project"]}, "config": {"enabled": true, "alias": null, "schema": "asana", "database": null, "tags": [], "meta": {}, "materialized": "ephemeral", "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "asana_source_integration_source_asana", "fqn": ["asana", "intermediate", "int_asana__project_user"], "unique_id": "model.asana.int_asana__project_user", "package_name": "asana", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/asana", "path": "intermediate/int_asana__project_user.sql", "original_file_path": "models/intermediate/int_asana__project_user.sql", "name": "int_asana__project_user", "alias": "int_asana__project_user", "checksum": {"name": "sha256", "checksum": "28422acac2869e218af531cdd062ef4dcdde594a75a39e7ba4cc56119117e636"}, "tags": [], "refs": [["stg_asana__project_task"], ["int_asana__task_assignee"], ["stg_asana__project"]], "sources": [], "metrics": [], "description": "Table of who is *working* on the project -- its owner + users assigned to it tasks", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": "asana://models/intermediate/intermediate_asana.yml", "compiled_path": "target/compiled/asana/models/intermediate/int_asana__project_user.sql", "build_path": null, "deferred": false, "unrendered_config": {"schema": "asana", "materialized": "ephemeral"}, "created_at": 1663600953.794197, "compiled_sql": "with __dbt__cte__int_asana__task_assignee as (\nwith task as (\n\n select * \n from `dbt-package-testing`.`asana_source_integration_source_stg_asana`.`stg_asana__task`\n\n),\n\nasana_user as (\n\n select *\n from `dbt-package-testing`.`asana_source_integration_source_stg_asana`.`stg_asana__user`\n),\n\ntask_assignee as (\n\n select\n task.*,\n assignee_user_id is not null as has_assignee,\n asana_user.user_name as assignee_name,\n asana_user.email as assignee_email\n\n from task \n left join asana_user \n on task.assignee_user_id = asana_user.user_id\n)\n\nselect * from task_assignee\n),project_tasks as (\n \n select *\n from `dbt-package-testing`.`asana_source_integration_source_stg_asana`.`stg_asana__project_task`\n),\n\nassigned_tasks as (\n \n select * \n from __dbt__cte__int_asana__task_assignee\n where has_assignee\n \n),\n\nproject as (\n \n select *\n from `dbt-package-testing`.`asana_source_integration_source_stg_asana`.`stg_asana__project`\n\n where not is_archived\n\n),\n\nproject_assignee as (\n\n select\n project_tasks.project_id,\n project_tasks.task_id,\n assigned_tasks.assignee_user_id,\n assigned_tasks.assignee_name,\n not assigned_tasks.is_completed as currently_working_on\n\n from project_tasks \n join assigned_tasks \n on assigned_tasks.task_id = project_tasks.task_id\n\n),\n\nproject_owner as (\n\n select \n project_id,\n project_name,\n owner_user_id\n\n from project\n \n where owner_user_id is not null\n),\n\nproject_user as (\n \n select\n project_id,\n project_name,\n owner_user_id as user_id,\n 'owner' as role,\n null as currently_working_on\n \n from project_owner\n\n union all\n\n select\n project.project_id,\n project.project_name,\n project_assignee.assignee_user_id as user_id,\n 'task assignee' as role,\n project_assignee.currently_working_on\n \n from project \n \n join project_assignee \n on project.project_id = project_assignee.project_id\n group by 1,2,3,4,5\n\n)\n\n\nselect * from project_user", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.asana.int_asana__task_assignee", "sql": " __dbt__cte__int_asana__task_assignee as (\nwith task as (\n\n select * \n from `dbt-package-testing`.`asana_source_integration_source_stg_asana`.`stg_asana__task`\n\n),\n\nasana_user as (\n\n select *\n from `dbt-package-testing`.`asana_source_integration_source_stg_asana`.`stg_asana__user`\n),\n\ntask_assignee as (\n\n select\n task.*,\n assignee_user_id is not null as has_assignee,\n asana_user.user_name as assignee_name,\n asana_user.email as assignee_email\n\n from task \n left join asana_user \n on task.assignee_user_id = asana_user.user_id\n)\n\nselect * from task_assignee\n)"}], "relation_name": null}, "model.asana.int_asana__task_first_modifier": {"raw_sql": "with story as (\n\n select *\n from {{ ref('int_asana__task_story') }}\n where created_by_user_id is not null -- sometimes user id can be null in story. limit to ones with associated users\n),\n\nordered_stories as (\n\n select \n target_task_id,\n created_by_user_id,\n created_by_name,\n created_at,\n row_number() over ( partition by target_task_id order by created_at asc ) as nth_story\n \n from story\n\n),\n\nfirst_modifier as (\n\n select \n target_task_id as task_id,\n created_by_user_id as first_modifier_user_id,\n created_by_name as first_modifier_name\n\n from ordered_stories \n where nth_story = 1\n)\n\nselect *\nfrom first_modifier", "compiled": true, "resource_type": "model", "depends_on": {"macros": [], "nodes": ["model.asana.int_asana__task_story"]}, "config": {"enabled": true, "alias": null, "schema": "asana", "database": null, "tags": [], "meta": {}, "materialized": "ephemeral", "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "asana_source_integration_source_asana", "fqn": ["asana", "intermediate", "int_asana__task_first_modifier"], "unique_id": "model.asana.int_asana__task_first_modifier", "package_name": "asana", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/asana", "path": "intermediate/int_asana__task_first_modifier.sql", "original_file_path": "models/intermediate/int_asana__task_first_modifier.sql", "name": "int_asana__task_first_modifier", "alias": "int_asana__task_first_modifier", "checksum": {"name": "sha256", "checksum": "1f6f8640a32bd71cb45062dfd5cffc7c6c5232051c33580299b613717f7ba2f6"}, "tags": [], "refs": [["int_asana__task_story"]], "sources": [], "metrics": [], "description": "Extracts the first person to make a story (modify) the task. A proxy for the task creator, since that's not provided.", "columns": {"task_id": {"name": "task_id", "description": "", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true}, "patch_path": "asana://models/intermediate/intermediate_asana.yml", "compiled_path": "target/compiled/asana/models/intermediate/int_asana__task_first_modifier.sql", "build_path": null, "deferred": false, "unrendered_config": {"schema": "asana", "materialized": "ephemeral"}, "created_at": 1663600953.795628, "compiled_sql": "with __dbt__cte__int_asana__task_story as (\nwith story as (\n \n select * \n from `dbt-package-testing`.`asana_source_integration_source_stg_asana`.`stg_asana__story`\n\n),\n\nasana_user as (\n\n select * \n from `dbt-package-testing`.`asana_source_integration_source_stg_asana`.`stg_asana__user`\n),\n\nstory_user as (\n select \n story.*,\n asana_user.user_name as created_by_name\n from story\n join asana_user \n on story.created_by_user_id = asana_user.user_id\n),\n\nsplit_comments as (\n\n select\n story_id,\n created_at,\n created_by_user_id,\n created_by_name,\n target_task_id,\n \n case when event_type = 'comment' then story_content \n else null end as comment_content,\n\n case when event_type = 'system' then story_content \n else 'comment' end as action_description\n \n from story_user\n\n),\n\n\n-- the next CTE uses this dictionary to parse the type of action out of the event descfription\n\n\nparse_actions as (\n select\n story_id,\n target_task_id,\n created_at,\n created_by_user_id,\n created_by_name,\n comment_content,\n case \n when action_description like 'added the name%' then 'added name' \n when action_description like 'changed the name%' then 'changed name' \n when action_description like 'removed the name' then 'removed name' \n when action_description like 'added the description%' then 'added description' \n when action_description like 'changed the description%' then 'changed description' \n when action_description like 'removed the description' then 'removed description' \n when action_description like 'added to%' then 'added to project' \n when action_description like 'removed from%' then 'removed from project' \n when action_description like 'assigned%' then 'assigned' \n when action_description like 'unassigned%' then 'unassigned' \n when action_description like 'changed the due date%' then 'changed due date' \n when action_description like 'changed the start date%due date%' then 'changed due date' \n when action_description like 'changed the start date%' then 'changed start date' \n when action_description like 'removed the due date%' then 'removed due date' \n when action_description like 'removed the date range%' then 'removed due date' \n when action_description like 'removed the start date' then 'removed start date' \n when action_description like 'added subtask%' then 'added subtask' \n when action_description like 'added%collaborator%' then 'added collaborator' \n when action_description like 'moved%' then 'moved to section' \n when action_description like 'duplicated task from%' then 'duplicated this from other task' \n when action_description like 'marked%as a duplicate of this' then 'marked other task as duplicate of this' \n when action_description like 'marked this a duplicate of%' then 'marked as duplicate' \n when action_description like 'marked this task complete' then 'completed' \n when action_description like 'completed this task' then 'completed' \n when action_description like 'marked incomplete' then 'marked incomplete' \n when action_description like 'marked this task as a milestone' then 'marked as milestone' \n when action_description like 'unmarked this task as a milestone' then 'unmarked as milestone' \n when action_description like 'marked this milestone complete' then 'completed milestone' \n when action_description like 'completed this milestone' then 'completed milestone' \n when action_description like 'attached%' then 'attachment' \n when action_description like 'liked your comment' then 'liked comment' \n when action_description like 'liked this task' then 'liked task' \n when action_description like 'liked your attachment' then 'liked attachment' \n when action_description like 'liked that you completed this task' then 'liked completion' \n when action_description like 'completed the last task you were waiting on%' then 'completed dependency' \n when action_description like 'added feedback to%' then 'added feedback' \n when action_description like 'changed%to%' then 'changed tag' \n when action_description like 'cleared%' then 'cleared tag' \n when action_description like 'comment' then 'comment' \n when action_description like 'have a task due on%' then ''\n else action_description end as action_taken,\n action_description\n \n from split_comments\n\n),\n\n\nfinal as (\n \n select * \n from parse_actions\n\n -- remove actions you don't care about (set to null in the actions dictionary above)\n where action_taken is not null \n\n)\n\n\nselect * from final\n),story as (\n\n select *\n from __dbt__cte__int_asana__task_story\n where created_by_user_id is not null -- sometimes user id can be null in story. limit to ones with associated users\n),\n\nordered_stories as (\n\n select \n target_task_id,\n created_by_user_id,\n created_by_name,\n created_at,\n row_number() over ( partition by target_task_id order by created_at asc ) as nth_story\n \n from story\n\n),\n\nfirst_modifier as (\n\n select \n target_task_id as task_id,\n created_by_user_id as first_modifier_user_id,\n created_by_name as first_modifier_name\n\n from ordered_stories \n where nth_story = 1\n)\n\nselect *\nfrom first_modifier", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.asana.int_asana__task_story", "sql": " __dbt__cte__int_asana__task_story as (\nwith story as (\n \n select * \n from `dbt-package-testing`.`asana_source_integration_source_stg_asana`.`stg_asana__story`\n\n),\n\nasana_user as (\n\n select * \n from `dbt-package-testing`.`asana_source_integration_source_stg_asana`.`stg_asana__user`\n),\n\nstory_user as (\n select \n story.*,\n asana_user.user_name as created_by_name\n from story\n join asana_user \n on story.created_by_user_id = asana_user.user_id\n),\n\nsplit_comments as (\n\n select\n story_id,\n created_at,\n created_by_user_id,\n created_by_name,\n target_task_id,\n \n case when event_type = 'comment' then story_content \n else null end as comment_content,\n\n case when event_type = 'system' then story_content \n else 'comment' end as action_description\n \n from story_user\n\n),\n\n\n-- the next CTE uses this dictionary to parse the type of action out of the event descfription\n\n\nparse_actions as (\n select\n story_id,\n target_task_id,\n created_at,\n created_by_user_id,\n created_by_name,\n comment_content,\n case \n when action_description like 'added the name%' then 'added name' \n when action_description like 'changed the name%' then 'changed name' \n when action_description like 'removed the name' then 'removed name' \n when action_description like 'added the description%' then 'added description' \n when action_description like 'changed the description%' then 'changed description' \n when action_description like 'removed the description' then 'removed description' \n when action_description like 'added to%' then 'added to project' \n when action_description like 'removed from%' then 'removed from project' \n when action_description like 'assigned%' then 'assigned' \n when action_description like 'unassigned%' then 'unassigned' \n when action_description like 'changed the due date%' then 'changed due date' \n when action_description like 'changed the start date%due date%' then 'changed due date' \n when action_description like 'changed the start date%' then 'changed start date' \n when action_description like 'removed the due date%' then 'removed due date' \n when action_description like 'removed the date range%' then 'removed due date' \n when action_description like 'removed the start date' then 'removed start date' \n when action_description like 'added subtask%' then 'added subtask' \n when action_description like 'added%collaborator%' then 'added collaborator' \n when action_description like 'moved%' then 'moved to section' \n when action_description like 'duplicated task from%' then 'duplicated this from other task' \n when action_description like 'marked%as a duplicate of this' then 'marked other task as duplicate of this' \n when action_description like 'marked this a duplicate of%' then 'marked as duplicate' \n when action_description like 'marked this task complete' then 'completed' \n when action_description like 'completed this task' then 'completed' \n when action_description like 'marked incomplete' then 'marked incomplete' \n when action_description like 'marked this task as a milestone' then 'marked as milestone' \n when action_description like 'unmarked this task as a milestone' then 'unmarked as milestone' \n when action_description like 'marked this milestone complete' then 'completed milestone' \n when action_description like 'completed this milestone' then 'completed milestone' \n when action_description like 'attached%' then 'attachment' \n when action_description like 'liked your comment' then 'liked comment' \n when action_description like 'liked this task' then 'liked task' \n when action_description like 'liked your attachment' then 'liked attachment' \n when action_description like 'liked that you completed this task' then 'liked completion' \n when action_description like 'completed the last task you were waiting on%' then 'completed dependency' \n when action_description like 'added feedback to%' then 'added feedback' \n when action_description like 'changed%to%' then 'changed tag' \n when action_description like 'cleared%' then 'cleared tag' \n when action_description like 'comment' then 'comment' \n when action_description like 'have a task due on%' then ''\n else action_description end as action_taken,\n action_description\n \n from split_comments\n\n),\n\n\nfinal as (\n \n select * \n from parse_actions\n\n -- remove actions you don't care about (set to null in the actions dictionary above)\n where action_taken is not null \n\n)\n\n\nselect * from final\n)"}], "relation_name": null}, "model.asana.int_asana__task_projects": {"raw_sql": "with task_project as (\n\n select * \n from {{ var('project_task') }}\n\n),\n\nproject as (\n \n select * \n from {{ var ('project') }}\n),\n\ntask_section as (\n\n select * \n from {{ var('task_section') }}\n\n),\n\nsection as (\n \n select * \n from {{ var ('section') }}\n\n),\n\ntask_project_section as (\n\n select \n task_project.task_id,\n project.project_name || (case when section.section_name = '(no section)' then ''\n else ': ' || section.section_name end) as project_section, \n project.project_id\n from\n task_project \n join project \n on project.project_id = task_project.project_id\n join task_section\n on task_section.task_id = task_project.task_id\n join section \n on section.section_id = task_section.section_id \n and section.project_id = project.project_id\n),\n\nagg_project_sections as (\n select \n task_id,\n {{ fivetran_utils.string_agg( 'task_project_section.project_section', \"', '\" )}} as projects_sections,\n count(project_id) as number_of_projects\n\n from task_project_section \n\n group by 1\n)\n\nselect * from agg_project_sections", "compiled": true, "resource_type": "model", "depends_on": {"macros": ["macro.fivetran_utils.string_agg"], "nodes": ["model.asana_source.stg_asana__project_task", "model.asana_source.stg_asana__project", "model.asana_source.stg_asana__task_section", "model.asana_source.stg_asana__section"]}, "config": {"enabled": true, "alias": null, "schema": "asana", "database": null, "tags": [], "meta": {}, "materialized": "ephemeral", "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "asana_source_integration_source_asana", "fqn": ["asana", "intermediate", "int_asana__task_projects"], "unique_id": "model.asana.int_asana__task_projects", "package_name": "asana", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/asana", "path": "intermediate/int_asana__task_projects.sql", "original_file_path": "models/intermediate/int_asana__task_projects.sql", "name": "int_asana__task_projects", "alias": "int_asana__task_projects", "checksum": {"name": "sha256", "checksum": "fc36b507b9dba1840ad1d41d014cc5451ecb0c11c4e2043478f3ccf47d184aa2"}, "tags": [], "refs": [["stg_asana__project_task"], ["stg_asana__project"], ["stg_asana__task_section"], ["stg_asana__section"]], "sources": [], "metrics": [], "description": "Aggregates a count of and a list of the names of the projects and sections that each task belongs to.", "columns": {"task_id": {"name": "task_id", "description": "", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true}, "patch_path": "asana://models/intermediate/intermediate_asana.yml", "compiled_path": "target/compiled/asana/models/intermediate/int_asana__task_projects.sql", "build_path": null, "deferred": false, "unrendered_config": {"schema": "asana", "materialized": "ephemeral"}, "created_at": 1663600953.796758, "compiled_sql": "with task_project as (\n\n select * \n from `dbt-package-testing`.`asana_source_integration_source_stg_asana`.`stg_asana__project_task`\n\n),\n\nproject as (\n \n select * \n from `dbt-package-testing`.`asana_source_integration_source_stg_asana`.`stg_asana__project`\n),\n\ntask_section as (\n\n select * \n from `dbt-package-testing`.`asana_source_integration_source_stg_asana`.`stg_asana__task_section`\n\n),\n\nsection as (\n \n select * \n from `dbt-package-testing`.`asana_source_integration_source_stg_asana`.`stg_asana__section`\n\n),\n\ntask_project_section as (\n\n select \n task_project.task_id,\n project.project_name || (case when section.section_name = '(no section)' then ''\n else ': ' || section.section_name end) as project_section, \n project.project_id\n from\n task_project \n join project \n on project.project_id = task_project.project_id\n join task_section\n on task_section.task_id = task_project.task_id\n join section \n on section.section_id = task_section.section_id \n and section.project_id = project.project_id\n),\n\nagg_project_sections as (\n select \n task_id,\n \n string_agg(task_project_section.project_section, ', ')\n\n as projects_sections,\n count(project_id) as number_of_projects\n\n from task_project_section \n\n group by 1\n)\n\nselect * from agg_project_sections", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null}, "model.asana.int_asana__task_assignee": {"raw_sql": "with task as (\n\n select * \n from {{ var('task') }}\n\n),\n\nasana_user as (\n\n select *\n from {{ var('user') }}\n),\n\ntask_assignee as (\n\n select\n task.*,\n assignee_user_id is not null as has_assignee,\n asana_user.user_name as assignee_name,\n asana_user.email as assignee_email\n\n from task \n left join asana_user \n on task.assignee_user_id = asana_user.user_id\n)\n\nselect * from task_assignee", "compiled": true, "resource_type": "model", "depends_on": {"macros": [], "nodes": ["model.asana_source.stg_asana__task", "model.asana_source.stg_asana__user"]}, "config": {"enabled": true, "alias": null, "schema": "asana", "database": null, "tags": [], "meta": {}, "materialized": "ephemeral", "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "asana_source_integration_source_asana", "fqn": ["asana", "intermediate", "int_asana__task_assignee"], "unique_id": "model.asana.int_asana__task_assignee", "package_name": "asana", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/asana", "path": "intermediate/int_asana__task_assignee.sql", "original_file_path": "models/intermediate/int_asana__task_assignee.sql", "name": "int_asana__task_assignee", "alias": "int_asana__task_assignee", "checksum": {"name": "sha256", "checksum": "2dfff153566b1418a423d4275b9704e5d8b8c3a661be9e9babfc15aa4c5cead8"}, "tags": [], "refs": [["stg_asana__task"], ["stg_asana__user"]], "sources": [], "metrics": [], "description": "Combines tasks + information regarding their assigned user", "columns": {"task_id": {"name": "task_id", "description": "", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true}, "patch_path": "asana://models/intermediate/intermediate_asana.yml", "compiled_path": "target/compiled/asana/models/intermediate/int_asana__task_assignee.sql", "build_path": null, "deferred": false, "unrendered_config": {"schema": "asana", "materialized": "ephemeral"}, "created_at": 1663600953.794923, "compiled_sql": "with task as (\n\n select * \n from `dbt-package-testing`.`asana_source_integration_source_stg_asana`.`stg_asana__task`\n\n),\n\nasana_user as (\n\n select *\n from `dbt-package-testing`.`asana_source_integration_source_stg_asana`.`stg_asana__user`\n),\n\ntask_assignee as (\n\n select\n task.*,\n assignee_user_id is not null as has_assignee,\n asana_user.user_name as assignee_name,\n asana_user.email as assignee_email\n\n from task \n left join asana_user \n on task.assignee_user_id = asana_user.user_id\n)\n\nselect * from task_assignee", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null}, "model.asana.int_asana__subtask_parent": {"raw_sql": "with task_assignee as (\n\n select * \n from {{ ref('int_asana__task_assignee') }}\n\n),\n\n\nsubtask_parent as (\n\n select\n subtask.task_id as subtask_id,\n parent.task_id as parent_task_id,\n parent.task_name as parent_task_name,\n parent.due_date as parent_due_date,\n parent.created_at as parent_created_at,\n parent.assignee_user_id as parent_assignee_user_id,\n parent.assignee_name as parent_assignee_name\n\n from task_assignee as parent \n join task_assignee as subtask\n on parent.task_id = subtask.parent_task_id\n\n)\n\nselect * from subtask_parent", "compiled": true, "resource_type": "model", "depends_on": {"macros": [], "nodes": ["model.asana.int_asana__task_assignee"]}, "config": {"enabled": true, "alias": null, "schema": "asana", "database": null, "tags": [], "meta": {}, "materialized": "ephemeral", "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "asana_source_integration_source_asana", "fqn": ["asana", "intermediate", "int_asana__subtask_parent"], "unique_id": "model.asana.int_asana__subtask_parent", "package_name": "asana", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/asana", "path": "intermediate/int_asana__subtask_parent.sql", "original_file_path": "models/intermediate/int_asana__subtask_parent.sql", "name": "int_asana__subtask_parent", "alias": "int_asana__subtask_parent", "checksum": {"name": "sha256", "checksum": "4abb15c88cfe83c53f5d4d97013d37d41689f4940b334b296b076eff5528b7b7"}, "tags": [], "refs": [["int_asana__task_assignee"]], "sources": [], "metrics": [], "description": "Combines subtasks + information regarding parent tasks", "columns": {"subtask_id": {"name": "subtask_id", "description": "", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true}, "patch_path": "asana://models/intermediate/intermediate_asana.yml", "compiled_path": "target/compiled/asana/models/intermediate/int_asana__subtask_parent.sql", "build_path": null, "deferred": false, "unrendered_config": {"schema": "asana", "materialized": "ephemeral"}, "created_at": 1663600953.794566, "compiled_sql": "with __dbt__cte__int_asana__task_assignee as (\nwith task as (\n\n select * \n from `dbt-package-testing`.`asana_source_integration_source_stg_asana`.`stg_asana__task`\n\n),\n\nasana_user as (\n\n select *\n from `dbt-package-testing`.`asana_source_integration_source_stg_asana`.`stg_asana__user`\n),\n\ntask_assignee as (\n\n select\n task.*,\n assignee_user_id is not null as has_assignee,\n asana_user.user_name as assignee_name,\n asana_user.email as assignee_email\n\n from task \n left join asana_user \n on task.assignee_user_id = asana_user.user_id\n)\n\nselect * from task_assignee\n),task_assignee as (\n\n select * \n from __dbt__cte__int_asana__task_assignee\n\n),\n\n\nsubtask_parent as (\n\n select\n subtask.task_id as subtask_id,\n parent.task_id as parent_task_id,\n parent.task_name as parent_task_name,\n parent.due_date as parent_due_date,\n parent.created_at as parent_created_at,\n parent.assignee_user_id as parent_assignee_user_id,\n parent.assignee_name as parent_assignee_name\n\n from task_assignee as parent \n join task_assignee as subtask\n on parent.task_id = subtask.parent_task_id\n\n)\n\nselect * from subtask_parent", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.asana.int_asana__task_assignee", "sql": " __dbt__cte__int_asana__task_assignee as (\nwith task as (\n\n select * \n from `dbt-package-testing`.`asana_source_integration_source_stg_asana`.`stg_asana__task`\n\n),\n\nasana_user as (\n\n select *\n from `dbt-package-testing`.`asana_source_integration_source_stg_asana`.`stg_asana__user`\n),\n\ntask_assignee as (\n\n select\n task.*,\n assignee_user_id is not null as has_assignee,\n asana_user.user_name as assignee_name,\n asana_user.email as assignee_email\n\n from task \n left join asana_user \n on task.assignee_user_id = asana_user.user_id\n)\n\nselect * from task_assignee\n)"}], "relation_name": null}, "model.asana.int_asana__task_story": {"raw_sql": "with story as (\n \n select * \n from {{ var('story') }}\n\n),\n\nasana_user as (\n\n select * \n from {{ var('user') }}\n),\n\nstory_user as (\n select \n story.*,\n asana_user.user_name as created_by_name\n from story\n join asana_user \n on story.created_by_user_id = asana_user.user_id\n),\n\nsplit_comments as (\n\n select\n story_id,\n created_at,\n created_by_user_id,\n created_by_name,\n target_task_id,\n \n case when event_type = 'comment' then story_content \n else null end as comment_content,\n\n case when event_type = 'system' then story_content \n else 'comment' end as action_description\n \n from story_user\n\n),\n\n\n-- the next CTE uses this dictionary to parse the type of action out of the event descfription\n{% set actions = {\n 'added the name%': 'added name',\n 'changed the name%': 'changed name',\n 'removed the name': 'removed name',\n 'added the description%': 'added description',\n 'changed the description%': 'changed description',\n 'removed the description': 'removed description',\n 'added to%': 'added to project',\n 'removed from%': 'removed from project',\n 'assigned%': 'assigned',\n 'unassigned%': 'unassigned',\n 'changed the due date%': 'changed due date', \n 'changed the start date%due date%': 'changed due date',\n 'changed the start date%': 'changed start date',\n 'removed the due date%': 'removed due date',\n 'removed the date range%': 'removed due date',\n 'removed the start date': 'removed start date',\n 'added subtask%': 'added subtask',\n 'added%collaborator%': 'added collaborator',\n 'moved%': 'moved to section',\n 'duplicated task from%': 'duplicated this from other task',\n 'marked%as a duplicate of this': 'marked other task as duplicate of this',\n 'marked this a duplicate of%': 'marked as duplicate',\n 'marked this task complete': 'completed',\n 'completed this task': 'completed',\n 'marked incomplete': 'marked incomplete',\n 'marked this task as a milestone': 'marked as milestone',\n 'unmarked this task as a milestone': 'unmarked as milestone',\n 'marked this milestone complete': 'completed milestone',\n 'completed this milestone': 'completed milestone',\n 'attached%': 'attachment',\n 'liked your comment': 'liked comment',\n 'liked this task': 'liked task',\n 'liked your attachment': 'liked attachment',\n 'liked that you completed this task': 'liked completion',\n 'completed the last task you were waiting on%': 'completed dependency',\n 'added feedback to%': 'added feedback',\n 'changed%to%': 'changed tag',\n 'cleared%': 'cleared tag',\n 'comment': 'comment',\n \"have a task due on%\": null \n\n} %}\n\nparse_actions as (\n select\n story_id,\n target_task_id,\n created_at,\n created_by_user_id,\n created_by_name,\n comment_content,\n case \n {%- for key, value in actions.items() %} \n when action_description like '{{key}}' then '{{value}}' \n {%- endfor %}\n else action_description end as action_taken,\n action_description\n \n from split_comments\n\n),\n\n\nfinal as (\n \n select * \n from parse_actions\n\n -- remove actions you don't care about (set to null in the actions dictionary above)\n where action_taken is not null \n\n)\n\n\nselect * from final", "compiled": true, "resource_type": "model", "depends_on": {"macros": [], "nodes": ["model.asana_source.stg_asana__story", "model.asana_source.stg_asana__user"]}, "config": {"enabled": true, "alias": null, "schema": "asana", "database": null, "tags": [], "meta": {}, "materialized": "ephemeral", "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "asana_source_integration_source_asana", "fqn": ["asana", "intermediate", "int_asana__task_story"], "unique_id": "model.asana.int_asana__task_story", "package_name": "asana", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/asana", "path": "intermediate/int_asana__task_story.sql", "original_file_path": "models/intermediate/int_asana__task_story.sql", "name": "int_asana__task_story", "alias": "int_asana__task_story", "checksum": {"name": "sha256", "checksum": "805d894194316cd83e1d8545a98c05a3b63d808f0bdf342160be47c79c05f6e9"}, "tags": [], "refs": [["stg_asana__story"], ["stg_asana__user"]], "sources": [], "metrics": [], "description": "Parses and categorizes asana stories into action types. Useful for looking at individual-task histories", "columns": {"story_id": {"name": "story_id", "description": "", "meta": {}, "data_type": null, "quote": null, "tags": []}, "action_taken": {"name": "action_taken", "description": "The bucket that the story event falls into.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "comment_content": {"name": "comment_content", "description": "If the action taken is a comment, this is the comment's text. Otherwise null.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "action_description": {"name": "action_description", "description": "The original pre-categorized content of the story", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true}, "patch_path": "asana://models/intermediate/intermediate_asana.yml", "compiled_path": "target/compiled/asana/models/intermediate/int_asana__task_story.sql", "build_path": null, "deferred": false, "unrendered_config": {"schema": "asana", "materialized": "ephemeral"}, "created_at": 1663600953.797473, "compiled_sql": "with story as (\n \n select * \n from `dbt-package-testing`.`asana_source_integration_source_stg_asana`.`stg_asana__story`\n\n),\n\nasana_user as (\n\n select * \n from `dbt-package-testing`.`asana_source_integration_source_stg_asana`.`stg_asana__user`\n),\n\nstory_user as (\n select \n story.*,\n asana_user.user_name as created_by_name\n from story\n join asana_user \n on story.created_by_user_id = asana_user.user_id\n),\n\nsplit_comments as (\n\n select\n story_id,\n created_at,\n created_by_user_id,\n created_by_name,\n target_task_id,\n \n case when event_type = 'comment' then story_content \n else null end as comment_content,\n\n case when event_type = 'system' then story_content \n else 'comment' end as action_description\n \n from story_user\n\n),\n\n\n-- the next CTE uses this dictionary to parse the type of action out of the event descfription\n\n\nparse_actions as (\n select\n story_id,\n target_task_id,\n created_at,\n created_by_user_id,\n created_by_name,\n comment_content,\n case \n when action_description like 'added the name%' then 'added name' \n when action_description like 'changed the name%' then 'changed name' \n when action_description like 'removed the name' then 'removed name' \n when action_description like 'added the description%' then 'added description' \n when action_description like 'changed the description%' then 'changed description' \n when action_description like 'removed the description' then 'removed description' \n when action_description like 'added to%' then 'added to project' \n when action_description like 'removed from%' then 'removed from project' \n when action_description like 'assigned%' then 'assigned' \n when action_description like 'unassigned%' then 'unassigned' \n when action_description like 'changed the due date%' then 'changed due date' \n when action_description like 'changed the start date%due date%' then 'changed due date' \n when action_description like 'changed the start date%' then 'changed start date' \n when action_description like 'removed the due date%' then 'removed due date' \n when action_description like 'removed the date range%' then 'removed due date' \n when action_description like 'removed the start date' then 'removed start date' \n when action_description like 'added subtask%' then 'added subtask' \n when action_description like 'added%collaborator%' then 'added collaborator' \n when action_description like 'moved%' then 'moved to section' \n when action_description like 'duplicated task from%' then 'duplicated this from other task' \n when action_description like 'marked%as a duplicate of this' then 'marked other task as duplicate of this' \n when action_description like 'marked this a duplicate of%' then 'marked as duplicate' \n when action_description like 'marked this task complete' then 'completed' \n when action_description like 'completed this task' then 'completed' \n when action_description like 'marked incomplete' then 'marked incomplete' \n when action_description like 'marked this task as a milestone' then 'marked as milestone' \n when action_description like 'unmarked this task as a milestone' then 'unmarked as milestone' \n when action_description like 'marked this milestone complete' then 'completed milestone' \n when action_description like 'completed this milestone' then 'completed milestone' \n when action_description like 'attached%' then 'attachment' \n when action_description like 'liked your comment' then 'liked comment' \n when action_description like 'liked this task' then 'liked task' \n when action_description like 'liked your attachment' then 'liked attachment' \n when action_description like 'liked that you completed this task' then 'liked completion' \n when action_description like 'completed the last task you were waiting on%' then 'completed dependency' \n when action_description like 'added feedback to%' then 'added feedback' \n when action_description like 'changed%to%' then 'changed tag' \n when action_description like 'cleared%' then 'cleared tag' \n when action_description like 'comment' then 'comment' \n when action_description like 'have a task due on%' then ''\n else action_description end as action_taken,\n action_description\n \n from split_comments\n\n),\n\n\nfinal as (\n \n select * \n from parse_actions\n\n -- remove actions you don't care about (set to null in the actions dictionary above)\n where action_taken is not null \n\n)\n\n\nselect * from final", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null}, "test.asana_source.unique_stg_asana__project_project_id.67bfab1228": {"raw_sql": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "test_metadata": {"name": "unique", "kwargs": {"column_name": "project_id", "model": "{{ get_where_subquery(ref('stg_asana__project')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["model.asana_source.stg_asana__project"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "dbt-package-testing", "schema": "asana_source_integration_source_dbt_test__audit", "fqn": ["asana_source", "unique_stg_asana__project_project_id"], "unique_id": "test.asana_source.unique_stg_asana__project_project_id.67bfab1228", "package_name": "asana_source", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/asana_source", "path": "unique_stg_asana__project_project_id.sql", "original_file_path": "models/stg_asana.yml", "name": "unique_stg_asana__project_project_id", "alias": "unique_stg_asana__project_project_id", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["stg_asana__project"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/asana_source/models/stg_asana.yml/unique_stg_asana__project_project_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1663600953.7254379, "compiled_sql": "\n \n \n\nwith dbt_test__target as (\n\n select project_id as unique_field\n from `dbt-package-testing`.`asana_source_integration_source_stg_asana`.`stg_asana__project`\n where project_id is not null\n\n)\n\nselect\n unique_field,\n count(*) as n_records\n\nfrom dbt_test__target\ngroup by unique_field\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "project_id", "file_key_name": "models.stg_asana__project"}, "test.asana_source.not_null_stg_asana__project_project_id.d27dae84fa": {"raw_sql": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "project_id", "model": "{{ get_where_subquery(ref('stg_asana__project')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.asana_source.stg_asana__project"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "dbt-package-testing", "schema": "asana_source_integration_source_dbt_test__audit", "fqn": ["asana_source", "not_null_stg_asana__project_project_id"], "unique_id": "test.asana_source.not_null_stg_asana__project_project_id.d27dae84fa", "package_name": "asana_source", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/asana_source", "path": "not_null_stg_asana__project_project_id.sql", "original_file_path": "models/stg_asana.yml", "name": "not_null_stg_asana__project_project_id", "alias": "not_null_stg_asana__project_project_id", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["stg_asana__project"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/asana_source/models/stg_asana.yml/not_null_stg_asana__project_project_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1663600953.726561, "compiled_sql": "\n \n \n\n\n\nselect project_id\nfrom `dbt-package-testing`.`asana_source_integration_source_stg_asana`.`stg_asana__project`\nwhere project_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "project_id", "file_key_name": "models.stg_asana__project"}, "test.asana_source.not_null_stg_asana__project_task_project_id.e2450d16b1": {"raw_sql": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "project_id", "model": "{{ get_where_subquery(ref('stg_asana__project_task')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.asana_source.stg_asana__project_task"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "dbt-package-testing", "schema": "asana_source_integration_source_dbt_test__audit", "fqn": ["asana_source", "not_null_stg_asana__project_task_project_id"], "unique_id": "test.asana_source.not_null_stg_asana__project_task_project_id.e2450d16b1", "package_name": "asana_source", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/asana_source", "path": "not_null_stg_asana__project_task_project_id.sql", "original_file_path": "models/stg_asana.yml", "name": "not_null_stg_asana__project_task_project_id", "alias": "not_null_stg_asana__project_task_project_id", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["stg_asana__project_task"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/asana_source/models/stg_asana.yml/not_null_stg_asana__project_task_project_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1663600953.7275252, "compiled_sql": "\n \n \n\n\n\nselect project_id\nfrom `dbt-package-testing`.`asana_source_integration_source_stg_asana`.`stg_asana__project_task`\nwhere project_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "project_id", "file_key_name": "models.stg_asana__project_task"}, "test.asana_source.not_null_stg_asana__project_task_task_id.9479566014": {"raw_sql": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "task_id", "model": "{{ get_where_subquery(ref('stg_asana__project_task')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.asana_source.stg_asana__project_task"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "dbt-package-testing", "schema": "asana_source_integration_source_dbt_test__audit", "fqn": ["asana_source", "not_null_stg_asana__project_task_task_id"], "unique_id": "test.asana_source.not_null_stg_asana__project_task_task_id.9479566014", "package_name": "asana_source", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/asana_source", "path": "not_null_stg_asana__project_task_task_id.sql", "original_file_path": "models/stg_asana.yml", "name": "not_null_stg_asana__project_task_task_id", "alias": "not_null_stg_asana__project_task_task_id", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["stg_asana__project_task"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/asana_source/models/stg_asana.yml/not_null_stg_asana__project_task_task_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1663600953.7284741, "compiled_sql": "\n \n \n\n\n\nselect task_id\nfrom `dbt-package-testing`.`asana_source_integration_source_stg_asana`.`stg_asana__project_task`\nwhere task_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "task_id", "file_key_name": "models.stg_asana__project_task"}, "test.asana_source.unique_stg_asana__section_section_id.0495dd3d2f": {"raw_sql": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "test_metadata": {"name": "unique", "kwargs": {"column_name": "section_id", "model": "{{ get_where_subquery(ref('stg_asana__section')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["model.asana_source.stg_asana__section"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "dbt-package-testing", "schema": "asana_source_integration_source_dbt_test__audit", "fqn": ["asana_source", "unique_stg_asana__section_section_id"], "unique_id": "test.asana_source.unique_stg_asana__section_section_id.0495dd3d2f", "package_name": "asana_source", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/asana_source", "path": "unique_stg_asana__section_section_id.sql", "original_file_path": "models/stg_asana.yml", "name": "unique_stg_asana__section_section_id", "alias": "unique_stg_asana__section_section_id", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["stg_asana__section"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/asana_source/models/stg_asana.yml/unique_stg_asana__section_section_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1663600953.7295449, "compiled_sql": "\n \n \n\nwith dbt_test__target as (\n\n select section_id as unique_field\n from `dbt-package-testing`.`asana_source_integration_source_stg_asana`.`stg_asana__section`\n where section_id is not null\n\n)\n\nselect\n unique_field,\n count(*) as n_records\n\nfrom dbt_test__target\ngroup by unique_field\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "section_id", "file_key_name": "models.stg_asana__section"}, "test.asana_source.not_null_stg_asana__section_section_id.389ebce958": {"raw_sql": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "section_id", "model": "{{ get_where_subquery(ref('stg_asana__section')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.asana_source.stg_asana__section"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "dbt-package-testing", "schema": "asana_source_integration_source_dbt_test__audit", "fqn": ["asana_source", "not_null_stg_asana__section_section_id"], "unique_id": "test.asana_source.not_null_stg_asana__section_section_id.389ebce958", "package_name": "asana_source", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/asana_source", "path": "not_null_stg_asana__section_section_id.sql", "original_file_path": "models/stg_asana.yml", "name": "not_null_stg_asana__section_section_id", "alias": "not_null_stg_asana__section_section_id", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["stg_asana__section"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/asana_source/models/stg_asana.yml/not_null_stg_asana__section_section_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1663600953.730481, "compiled_sql": "\n \n \n\n\n\nselect section_id\nfrom `dbt-package-testing`.`asana_source_integration_source_stg_asana`.`stg_asana__section`\nwhere section_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "section_id", "file_key_name": "models.stg_asana__section"}, "test.asana_source.unique_stg_asana__story_story_id.414f25bb84": {"raw_sql": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "test_metadata": {"name": "unique", "kwargs": {"column_name": "story_id", "model": "{{ get_where_subquery(ref('stg_asana__story')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["model.asana_source.stg_asana__story"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "dbt-package-testing", "schema": "asana_source_integration_source_dbt_test__audit", "fqn": ["asana_source", "unique_stg_asana__story_story_id"], "unique_id": "test.asana_source.unique_stg_asana__story_story_id.414f25bb84", "package_name": "asana_source", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/asana_source", "path": "unique_stg_asana__story_story_id.sql", "original_file_path": "models/stg_asana.yml", "name": "unique_stg_asana__story_story_id", "alias": "unique_stg_asana__story_story_id", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["stg_asana__story"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/asana_source/models/stg_asana.yml/unique_stg_asana__story_story_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1663600953.731412, "compiled_sql": "\n \n \n\nwith dbt_test__target as (\n\n select story_id as unique_field\n from `dbt-package-testing`.`asana_source_integration_source_stg_asana`.`stg_asana__story`\n where story_id is not null\n\n)\n\nselect\n unique_field,\n count(*) as n_records\n\nfrom dbt_test__target\ngroup by unique_field\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "story_id", "file_key_name": "models.stg_asana__story"}, "test.asana_source.not_null_stg_asana__story_story_id.ca847d0848": {"raw_sql": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "story_id", "model": "{{ get_where_subquery(ref('stg_asana__story')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.asana_source.stg_asana__story"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "dbt-package-testing", "schema": "asana_source_integration_source_dbt_test__audit", "fqn": ["asana_source", "not_null_stg_asana__story_story_id"], "unique_id": "test.asana_source.not_null_stg_asana__story_story_id.ca847d0848", "package_name": "asana_source", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/asana_source", "path": "not_null_stg_asana__story_story_id.sql", "original_file_path": "models/stg_asana.yml", "name": "not_null_stg_asana__story_story_id", "alias": "not_null_stg_asana__story_story_id", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["stg_asana__story"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/asana_source/models/stg_asana.yml/not_null_stg_asana__story_story_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1663600953.732336, "compiled_sql": "\n \n \n\n\n\nselect story_id\nfrom `dbt-package-testing`.`asana_source_integration_source_stg_asana`.`stg_asana__story`\nwhere story_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "story_id", "file_key_name": "models.stg_asana__story"}, "test.asana_source.not_null_stg_asana__story_target_task_id.3f971de06e": {"raw_sql": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "target_task_id", "model": "{{ get_where_subquery(ref('stg_asana__story')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.asana_source.stg_asana__story"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "dbt-package-testing", "schema": "asana_source_integration_source_dbt_test__audit", "fqn": ["asana_source", "not_null_stg_asana__story_target_task_id"], "unique_id": "test.asana_source.not_null_stg_asana__story_target_task_id.3f971de06e", "package_name": "asana_source", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/asana_source", "path": "not_null_stg_asana__story_target_task_id.sql", "original_file_path": "models/stg_asana.yml", "name": "not_null_stg_asana__story_target_task_id", "alias": "not_null_stg_asana__story_target_task_id", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["stg_asana__story"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/asana_source/models/stg_asana.yml/not_null_stg_asana__story_target_task_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1663600953.733394, "compiled_sql": "\n \n \n\n\n\nselect target_task_id\nfrom `dbt-package-testing`.`asana_source_integration_source_stg_asana`.`stg_asana__story`\nwhere target_task_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "target_task_id", "file_key_name": "models.stg_asana__story"}, "test.asana_source.unique_stg_asana__tag_tag_id.fd78b190c7": {"raw_sql": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "test_metadata": {"name": "unique", "kwargs": {"column_name": "tag_id", "model": "{{ get_where_subquery(ref('stg_asana__tag')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["model.asana_source.stg_asana__tag"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "dbt-package-testing", "schema": "asana_source_integration_source_dbt_test__audit", "fqn": ["asana_source", "unique_stg_asana__tag_tag_id"], "unique_id": "test.asana_source.unique_stg_asana__tag_tag_id.fd78b190c7", "package_name": "asana_source", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/asana_source", "path": "unique_stg_asana__tag_tag_id.sql", "original_file_path": "models/stg_asana.yml", "name": "unique_stg_asana__tag_tag_id", "alias": "unique_stg_asana__tag_tag_id", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["stg_asana__tag"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/asana_source/models/stg_asana.yml/unique_stg_asana__tag_tag_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1663600953.7343202, "compiled_sql": "\n \n \n\nwith dbt_test__target as (\n\n select tag_id as unique_field\n from `dbt-package-testing`.`asana_source_integration_source_stg_asana`.`stg_asana__tag`\n where tag_id is not null\n\n)\n\nselect\n unique_field,\n count(*) as n_records\n\nfrom dbt_test__target\ngroup by unique_field\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "tag_id", "file_key_name": "models.stg_asana__tag"}, "test.asana_source.not_null_stg_asana__tag_tag_id.c6a8187ca2": {"raw_sql": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "tag_id", "model": "{{ get_where_subquery(ref('stg_asana__tag')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.asana_source.stg_asana__tag"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "dbt-package-testing", "schema": "asana_source_integration_source_dbt_test__audit", "fqn": ["asana_source", "not_null_stg_asana__tag_tag_id"], "unique_id": "test.asana_source.not_null_stg_asana__tag_tag_id.c6a8187ca2", "package_name": "asana_source", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/asana_source", "path": "not_null_stg_asana__tag_tag_id.sql", "original_file_path": "models/stg_asana.yml", "name": "not_null_stg_asana__tag_tag_id", "alias": "not_null_stg_asana__tag_tag_id", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["stg_asana__tag"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/asana_source/models/stg_asana.yml/not_null_stg_asana__tag_tag_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1663600953.73524, "compiled_sql": "\n \n \n\n\n\nselect tag_id\nfrom `dbt-package-testing`.`asana_source_integration_source_stg_asana`.`stg_asana__tag`\nwhere tag_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "tag_id", "file_key_name": "models.stg_asana__tag"}, "test.asana_source.unique_stg_asana__task_task_id.a5271275a5": {"raw_sql": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "test_metadata": {"name": "unique", "kwargs": {"column_name": "task_id", "model": "{{ get_where_subquery(ref('stg_asana__task')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["model.asana_source.stg_asana__task"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "dbt-package-testing", "schema": "asana_source_integration_source_dbt_test__audit", "fqn": ["asana_source", "unique_stg_asana__task_task_id"], "unique_id": "test.asana_source.unique_stg_asana__task_task_id.a5271275a5", "package_name": "asana_source", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/asana_source", "path": "unique_stg_asana__task_task_id.sql", "original_file_path": "models/stg_asana.yml", "name": "unique_stg_asana__task_task_id", "alias": "unique_stg_asana__task_task_id", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["stg_asana__task"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/asana_source/models/stg_asana.yml/unique_stg_asana__task_task_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1663600953.7363122, "compiled_sql": "\n \n \n\nwith dbt_test__target as (\n\n select task_id as unique_field\n from `dbt-package-testing`.`asana_source_integration_source_stg_asana`.`stg_asana__task`\n where task_id is not null\n\n)\n\nselect\n unique_field,\n count(*) as n_records\n\nfrom dbt_test__target\ngroup by unique_field\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "task_id", "file_key_name": "models.stg_asana__task"}, "test.asana_source.not_null_stg_asana__task_task_id.924cc69000": {"raw_sql": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "task_id", "model": "{{ get_where_subquery(ref('stg_asana__task')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.asana_source.stg_asana__task"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "dbt-package-testing", "schema": "asana_source_integration_source_dbt_test__audit", "fqn": ["asana_source", "not_null_stg_asana__task_task_id"], "unique_id": "test.asana_source.not_null_stg_asana__task_task_id.924cc69000", "package_name": "asana_source", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/asana_source", "path": "not_null_stg_asana__task_task_id.sql", "original_file_path": "models/stg_asana.yml", "name": "not_null_stg_asana__task_task_id", "alias": "not_null_stg_asana__task_task_id", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["stg_asana__task"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/asana_source/models/stg_asana.yml/not_null_stg_asana__task_task_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1663600953.737237, "compiled_sql": "\n \n \n\n\n\nselect task_id\nfrom `dbt-package-testing`.`asana_source_integration_source_stg_asana`.`stg_asana__task`\nwhere task_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "task_id", "file_key_name": "models.stg_asana__task"}, "test.asana_source.not_null_stg_asana__task_follower_task_id.5af35f322c": {"raw_sql": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "task_id", "model": "{{ get_where_subquery(ref('stg_asana__task_follower')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.asana_source.stg_asana__task_follower"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "dbt-package-testing", "schema": "asana_source_integration_source_dbt_test__audit", "fqn": ["asana_source", "not_null_stg_asana__task_follower_task_id"], "unique_id": "test.asana_source.not_null_stg_asana__task_follower_task_id.5af35f322c", "package_name": "asana_source", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/asana_source", "path": "not_null_stg_asana__task_follower_task_id.sql", "original_file_path": "models/stg_asana.yml", "name": "not_null_stg_asana__task_follower_task_id", "alias": "not_null_stg_asana__task_follower_task_id", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["stg_asana__task_follower"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/asana_source/models/stg_asana.yml/not_null_stg_asana__task_follower_task_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1663600953.738165, "compiled_sql": "\n \n \n\n\n\nselect task_id\nfrom `dbt-package-testing`.`asana_source_integration_source_stg_asana`.`stg_asana__task_follower`\nwhere task_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "task_id", "file_key_name": "models.stg_asana__task_follower"}, "test.asana_source.not_null_stg_asana__task_follower_user_id.e0aea0b15e": {"raw_sql": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "user_id", "model": "{{ get_where_subquery(ref('stg_asana__task_follower')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.asana_source.stg_asana__task_follower"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "dbt-package-testing", "schema": "asana_source_integration_source_dbt_test__audit", "fqn": ["asana_source", "not_null_stg_asana__task_follower_user_id"], "unique_id": "test.asana_source.not_null_stg_asana__task_follower_user_id.e0aea0b15e", "package_name": "asana_source", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/asana_source", "path": "not_null_stg_asana__task_follower_user_id.sql", "original_file_path": "models/stg_asana.yml", "name": "not_null_stg_asana__task_follower_user_id", "alias": "not_null_stg_asana__task_follower_user_id", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["stg_asana__task_follower"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/asana_source/models/stg_asana.yml/not_null_stg_asana__task_follower_user_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1663600953.739083, "compiled_sql": "\n \n \n\n\n\nselect user_id\nfrom `dbt-package-testing`.`asana_source_integration_source_stg_asana`.`stg_asana__task_follower`\nwhere user_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "user_id", "file_key_name": "models.stg_asana__task_follower"}, "test.asana_source.not_null_stg_asana__task_section_task_id.ab81301de8": {"raw_sql": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "task_id", "model": "{{ get_where_subquery(ref('stg_asana__task_section')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.asana_source.stg_asana__task_section"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "dbt-package-testing", "schema": "asana_source_integration_source_dbt_test__audit", "fqn": ["asana_source", "not_null_stg_asana__task_section_task_id"], "unique_id": "test.asana_source.not_null_stg_asana__task_section_task_id.ab81301de8", "package_name": "asana_source", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/asana_source", "path": "not_null_stg_asana__task_section_task_id.sql", "original_file_path": "models/stg_asana.yml", "name": "not_null_stg_asana__task_section_task_id", "alias": "not_null_stg_asana__task_section_task_id", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["stg_asana__task_section"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/asana_source/models/stg_asana.yml/not_null_stg_asana__task_section_task_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1663600953.740341, "compiled_sql": "\n \n \n\n\n\nselect task_id\nfrom `dbt-package-testing`.`asana_source_integration_source_stg_asana`.`stg_asana__task_section`\nwhere task_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "task_id", "file_key_name": "models.stg_asana__task_section"}, "test.asana_source.not_null_stg_asana__task_section_section_id.b0977a4cfe": {"raw_sql": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "section_id", "model": "{{ get_where_subquery(ref('stg_asana__task_section')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.asana_source.stg_asana__task_section"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "dbt-package-testing", "schema": "asana_source_integration_source_dbt_test__audit", "fqn": ["asana_source", "not_null_stg_asana__task_section_section_id"], "unique_id": "test.asana_source.not_null_stg_asana__task_section_section_id.b0977a4cfe", "package_name": "asana_source", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/asana_source", "path": "not_null_stg_asana__task_section_section_id.sql", "original_file_path": "models/stg_asana.yml", "name": "not_null_stg_asana__task_section_section_id", "alias": "not_null_stg_asana__task_section_section_id", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["stg_asana__task_section"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/asana_source/models/stg_asana.yml/not_null_stg_asana__task_section_section_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1663600953.7412632, "compiled_sql": "\n \n \n\n\n\nselect section_id\nfrom `dbt-package-testing`.`asana_source_integration_source_stg_asana`.`stg_asana__task_section`\nwhere section_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "section_id", "file_key_name": "models.stg_asana__task_section"}, "test.asana_source.not_null_stg_asana__task_tag_tag_id.d523de41d8": {"raw_sql": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "tag_id", "model": "{{ get_where_subquery(ref('stg_asana__task_tag')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.asana_source.stg_asana__task_tag"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "dbt-package-testing", "schema": "asana_source_integration_source_dbt_test__audit", "fqn": ["asana_source", "not_null_stg_asana__task_tag_tag_id"], "unique_id": "test.asana_source.not_null_stg_asana__task_tag_tag_id.d523de41d8", "package_name": "asana_source", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/asana_source", "path": "not_null_stg_asana__task_tag_tag_id.sql", "original_file_path": "models/stg_asana.yml", "name": "not_null_stg_asana__task_tag_tag_id", "alias": "not_null_stg_asana__task_tag_tag_id", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["stg_asana__task_tag"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/asana_source/models/stg_asana.yml/not_null_stg_asana__task_tag_tag_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1663600953.74218, "compiled_sql": "\n \n \n\n\n\nselect tag_id\nfrom `dbt-package-testing`.`asana_source_integration_source_stg_asana`.`stg_asana__task_tag`\nwhere tag_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "tag_id", "file_key_name": "models.stg_asana__task_tag"}, "test.asana_source.not_null_stg_asana__task_tag_task_id.9d27624748": {"raw_sql": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "task_id", "model": "{{ get_where_subquery(ref('stg_asana__task_tag')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.asana_source.stg_asana__task_tag"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "dbt-package-testing", "schema": "asana_source_integration_source_dbt_test__audit", "fqn": ["asana_source", "not_null_stg_asana__task_tag_task_id"], "unique_id": "test.asana_source.not_null_stg_asana__task_tag_task_id.9d27624748", "package_name": "asana_source", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/asana_source", "path": "not_null_stg_asana__task_tag_task_id.sql", "original_file_path": "models/stg_asana.yml", "name": "not_null_stg_asana__task_tag_task_id", "alias": "not_null_stg_asana__task_tag_task_id", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["stg_asana__task_tag"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/asana_source/models/stg_asana.yml/not_null_stg_asana__task_tag_task_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1663600953.743237, "compiled_sql": "\n \n \n\n\n\nselect task_id\nfrom `dbt-package-testing`.`asana_source_integration_source_stg_asana`.`stg_asana__task_tag`\nwhere task_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "task_id", "file_key_name": "models.stg_asana__task_tag"}, "test.asana_source.unique_stg_asana__team_team_id.111fe15873": {"raw_sql": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "test_metadata": {"name": "unique", "kwargs": {"column_name": "team_id", "model": "{{ get_where_subquery(ref('stg_asana__team')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["model.asana_source.stg_asana__team"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "dbt-package-testing", "schema": "asana_source_integration_source_dbt_test__audit", "fqn": ["asana_source", "unique_stg_asana__team_team_id"], "unique_id": "test.asana_source.unique_stg_asana__team_team_id.111fe15873", "package_name": "asana_source", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/asana_source", "path": "unique_stg_asana__team_team_id.sql", "original_file_path": "models/stg_asana.yml", "name": "unique_stg_asana__team_team_id", "alias": "unique_stg_asana__team_team_id", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["stg_asana__team"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/asana_source/models/stg_asana.yml/unique_stg_asana__team_team_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1663600953.744151, "compiled_sql": "\n \n \n\nwith dbt_test__target as (\n\n select team_id as unique_field\n from `dbt-package-testing`.`asana_source_integration_source_stg_asana`.`stg_asana__team`\n where team_id is not null\n\n)\n\nselect\n unique_field,\n count(*) as n_records\n\nfrom dbt_test__target\ngroup by unique_field\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "team_id", "file_key_name": "models.stg_asana__team"}, "test.asana_source.not_null_stg_asana__team_team_id.e12b563474": {"raw_sql": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "team_id", "model": "{{ get_where_subquery(ref('stg_asana__team')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.asana_source.stg_asana__team"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "dbt-package-testing", "schema": "asana_source_integration_source_dbt_test__audit", "fqn": ["asana_source", "not_null_stg_asana__team_team_id"], "unique_id": "test.asana_source.not_null_stg_asana__team_team_id.e12b563474", "package_name": "asana_source", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/asana_source", "path": "not_null_stg_asana__team_team_id.sql", "original_file_path": "models/stg_asana.yml", "name": "not_null_stg_asana__team_team_id", "alias": "not_null_stg_asana__team_team_id", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["stg_asana__team"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/asana_source/models/stg_asana.yml/not_null_stg_asana__team_team_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1663600953.7450628, "compiled_sql": "\n \n \n\n\n\nselect team_id\nfrom `dbt-package-testing`.`asana_source_integration_source_stg_asana`.`stg_asana__team`\nwhere team_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "team_id", "file_key_name": "models.stg_asana__team"}, "test.asana_source.unique_stg_asana__user_user_id.73808d6267": {"raw_sql": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "test_metadata": {"name": "unique", "kwargs": {"column_name": "user_id", "model": "{{ get_where_subquery(ref('stg_asana__user')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["model.asana_source.stg_asana__user"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "dbt-package-testing", "schema": "asana_source_integration_source_dbt_test__audit", "fqn": ["asana_source", "unique_stg_asana__user_user_id"], "unique_id": "test.asana_source.unique_stg_asana__user_user_id.73808d6267", "package_name": "asana_source", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/asana_source", "path": "unique_stg_asana__user_user_id.sql", "original_file_path": "models/stg_asana.yml", "name": "unique_stg_asana__user_user_id", "alias": "unique_stg_asana__user_user_id", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["stg_asana__user"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/asana_source/models/stg_asana.yml/unique_stg_asana__user_user_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1663600953.745976, "compiled_sql": "\n \n \n\nwith dbt_test__target as (\n\n select user_id as unique_field\n from `dbt-package-testing`.`asana_source_integration_source_stg_asana`.`stg_asana__user`\n where user_id is not null\n\n)\n\nselect\n unique_field,\n count(*) as n_records\n\nfrom dbt_test__target\ngroup by unique_field\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "user_id", "file_key_name": "models.stg_asana__user"}, "test.asana_source.not_null_stg_asana__user_user_id.4e900e8ec6": {"raw_sql": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "user_id", "model": "{{ get_where_subquery(ref('stg_asana__user')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.asana_source.stg_asana__user"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "dbt-package-testing", "schema": "asana_source_integration_source_dbt_test__audit", "fqn": ["asana_source", "not_null_stg_asana__user_user_id"], "unique_id": "test.asana_source.not_null_stg_asana__user_user_id.4e900e8ec6", "package_name": "asana_source", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/asana_source", "path": "not_null_stg_asana__user_user_id.sql", "original_file_path": "models/stg_asana.yml", "name": "not_null_stg_asana__user_user_id", "alias": "not_null_stg_asana__user_user_id", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["stg_asana__user"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/asana_source/models/stg_asana.yml/not_null_stg_asana__user_user_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1663600953.7470028, "compiled_sql": "\n \n \n\n\n\nselect user_id\nfrom `dbt-package-testing`.`asana_source_integration_source_stg_asana`.`stg_asana__user`\nwhere user_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "user_id", "file_key_name": "models.stg_asana__user"}, "test.asana.unique_asana__task_task_id.ebfe331df1": {"raw_sql": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "test_metadata": {"name": "unique", "kwargs": {"column_name": "task_id", "model": "{{ get_where_subquery(ref('asana__task')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["model.asana.asana__task"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "dbt-package-testing", "schema": "asana_source_integration_source_dbt_test__audit", "fqn": ["asana", "unique_asana__task_task_id"], "unique_id": "test.asana.unique_asana__task_task_id.ebfe331df1", "package_name": "asana", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/asana", "path": "unique_asana__task_task_id.sql", "original_file_path": "models/asana.yml", "name": "unique_asana__task_task_id", "alias": "unique_asana__task_task_id", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["asana__task"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/asana/models/asana.yml/unique_asana__task_task_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1663600953.7819781, "compiled_sql": "\n \n \n\nwith dbt_test__target as (\n\n select task_id as unique_field\n from `dbt-package-testing`.`asana_source_integration_source_asana`.`asana__task`\n where task_id is not null\n\n)\n\nselect\n unique_field,\n count(*) as n_records\n\nfrom dbt_test__target\ngroup by unique_field\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "task_id", "file_key_name": "models.asana__task"}, "test.asana.not_null_asana__task_task_id.6d36eb2cd0": {"raw_sql": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "task_id", "model": "{{ get_where_subquery(ref('asana__task')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.asana.asana__task"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "dbt-package-testing", "schema": "asana_source_integration_source_dbt_test__audit", "fqn": ["asana", "not_null_asana__task_task_id"], "unique_id": "test.asana.not_null_asana__task_task_id.6d36eb2cd0", "package_name": "asana", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/asana", "path": "not_null_asana__task_task_id.sql", "original_file_path": "models/asana.yml", "name": "not_null_asana__task_task_id", "alias": "not_null_asana__task_task_id", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["asana__task"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/asana/models/asana.yml/not_null_asana__task_task_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1663600953.782986, "compiled_sql": "\n \n \n\n\n\nselect task_id\nfrom `dbt-package-testing`.`asana_source_integration_source_asana`.`asana__task`\nwhere task_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "task_id", "file_key_name": "models.asana__task"}, "test.asana.unique_asana__user_user_id.3c4b63387e": {"raw_sql": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "test_metadata": {"name": "unique", "kwargs": {"column_name": "user_id", "model": "{{ get_where_subquery(ref('asana__user')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["model.asana.asana__user"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "dbt-package-testing", "schema": "asana_source_integration_source_dbt_test__audit", "fqn": ["asana", "unique_asana__user_user_id"], "unique_id": "test.asana.unique_asana__user_user_id.3c4b63387e", "package_name": "asana", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/asana", "path": "unique_asana__user_user_id.sql", "original_file_path": "models/asana.yml", "name": "unique_asana__user_user_id", "alias": "unique_asana__user_user_id", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["asana__user"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/asana/models/asana.yml/unique_asana__user_user_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1663600953.784045, "compiled_sql": "\n \n \n\nwith dbt_test__target as (\n\n select user_id as unique_field\n from `dbt-package-testing`.`asana_source_integration_source_asana`.`asana__user`\n where user_id is not null\n\n)\n\nselect\n unique_field,\n count(*) as n_records\n\nfrom dbt_test__target\ngroup by unique_field\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "user_id", "file_key_name": "models.asana__user"}, "test.asana.not_null_asana__user_user_id.eb9cd93a43": {"raw_sql": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "user_id", "model": "{{ get_where_subquery(ref('asana__user')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.asana.asana__user"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "dbt-package-testing", "schema": "asana_source_integration_source_dbt_test__audit", "fqn": ["asana", "not_null_asana__user_user_id"], "unique_id": "test.asana.not_null_asana__user_user_id.eb9cd93a43", "package_name": "asana", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/asana", "path": "not_null_asana__user_user_id.sql", "original_file_path": "models/asana.yml", "name": "not_null_asana__user_user_id", "alias": "not_null_asana__user_user_id", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["asana__user"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/asana/models/asana.yml/not_null_asana__user_user_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1663600953.78497, "compiled_sql": "\n \n \n\n\n\nselect user_id\nfrom `dbt-package-testing`.`asana_source_integration_source_asana`.`asana__user`\nwhere user_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "user_id", "file_key_name": "models.asana__user"}, "test.asana.unique_asana__project_project_id.66a76364ef": {"raw_sql": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "test_metadata": {"name": "unique", "kwargs": {"column_name": "project_id", "model": "{{ get_where_subquery(ref('asana__project')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["model.asana.asana__project"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "dbt-package-testing", "schema": "asana_source_integration_source_dbt_test__audit", "fqn": ["asana", "unique_asana__project_project_id"], "unique_id": "test.asana.unique_asana__project_project_id.66a76364ef", "package_name": "asana", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/asana", "path": "unique_asana__project_project_id.sql", "original_file_path": "models/asana.yml", "name": "unique_asana__project_project_id", "alias": "unique_asana__project_project_id", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["asana__project"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/asana/models/asana.yml/unique_asana__project_project_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1663600953.785905, "compiled_sql": "\n \n \n\nwith dbt_test__target as (\n\n select project_id as unique_field\n from `dbt-package-testing`.`asana_source_integration_source_asana`.`asana__project`\n where project_id is not null\n\n)\n\nselect\n unique_field,\n count(*) as n_records\n\nfrom dbt_test__target\ngroup by unique_field\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "project_id", "file_key_name": "models.asana__project"}, "test.asana.not_null_asana__project_project_id.78420e1b45": {"raw_sql": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "project_id", "model": "{{ get_where_subquery(ref('asana__project')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.asana.asana__project"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "dbt-package-testing", "schema": "asana_source_integration_source_dbt_test__audit", "fqn": ["asana", "not_null_asana__project_project_id"], "unique_id": "test.asana.not_null_asana__project_project_id.78420e1b45", "package_name": "asana", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/asana", "path": "not_null_asana__project_project_id.sql", "original_file_path": "models/asana.yml", "name": "not_null_asana__project_project_id", "alias": "not_null_asana__project_project_id", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["asana__project"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/asana/models/asana.yml/not_null_asana__project_project_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1663600953.7869692, "compiled_sql": "\n \n \n\n\n\nselect project_id\nfrom `dbt-package-testing`.`asana_source_integration_source_asana`.`asana__project`\nwhere project_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "project_id", "file_key_name": "models.asana__project"}, "test.asana.unique_asana__team_team_id.ada6b5e093": {"raw_sql": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "test_metadata": {"name": "unique", "kwargs": {"column_name": "team_id", "model": "{{ get_where_subquery(ref('asana__team')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["model.asana.asana__team"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "dbt-package-testing", "schema": "asana_source_integration_source_dbt_test__audit", "fqn": ["asana", "unique_asana__team_team_id"], "unique_id": "test.asana.unique_asana__team_team_id.ada6b5e093", "package_name": "asana", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/asana", "path": "unique_asana__team_team_id.sql", "original_file_path": "models/asana.yml", "name": "unique_asana__team_team_id", "alias": "unique_asana__team_team_id", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["asana__team"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/asana/models/asana.yml/unique_asana__team_team_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1663600953.787894, "compiled_sql": "\n \n \n\nwith dbt_test__target as (\n\n select team_id as unique_field\n from `dbt-package-testing`.`asana_source_integration_source_asana`.`asana__team`\n where team_id is not null\n\n)\n\nselect\n unique_field,\n count(*) as n_records\n\nfrom dbt_test__target\ngroup by unique_field\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "team_id", "file_key_name": "models.asana__team"}, "test.asana.not_null_asana__team_team_id.cd6b6c88bf": {"raw_sql": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "team_id", "model": "{{ get_where_subquery(ref('asana__team')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.asana.asana__team"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "dbt-package-testing", "schema": "asana_source_integration_source_dbt_test__audit", "fqn": ["asana", "not_null_asana__team_team_id"], "unique_id": "test.asana.not_null_asana__team_team_id.cd6b6c88bf", "package_name": "asana", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/asana", "path": "not_null_asana__team_team_id.sql", "original_file_path": "models/asana.yml", "name": "not_null_asana__team_team_id", "alias": "not_null_asana__team_team_id", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["asana__team"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/asana/models/asana.yml/not_null_asana__team_team_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1663600953.788813, "compiled_sql": "\n \n \n\n\n\nselect team_id\nfrom `dbt-package-testing`.`asana_source_integration_source_asana`.`asana__team`\nwhere team_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "team_id", "file_key_name": "models.asana__team"}, "test.asana.unique_asana__tag_tag_id.46c0d2510f": {"raw_sql": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "test_metadata": {"name": "unique", "kwargs": {"column_name": "tag_id", "model": "{{ get_where_subquery(ref('asana__tag')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["model.asana.asana__tag"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "dbt-package-testing", "schema": "asana_source_integration_source_dbt_test__audit", "fqn": ["asana", "unique_asana__tag_tag_id"], "unique_id": "test.asana.unique_asana__tag_tag_id.46c0d2510f", "package_name": "asana", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/asana", "path": "unique_asana__tag_tag_id.sql", "original_file_path": "models/asana.yml", "name": "unique_asana__tag_tag_id", "alias": "unique_asana__tag_tag_id", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["asana__tag"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/asana/models/asana.yml/unique_asana__tag_tag_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1663600953.789728, "compiled_sql": "\n \n \n\nwith dbt_test__target as (\n\n select tag_id as unique_field\n from `dbt-package-testing`.`asana_source_integration_source_asana`.`asana__tag`\n where tag_id is not null\n\n)\n\nselect\n unique_field,\n count(*) as n_records\n\nfrom dbt_test__target\ngroup by unique_field\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "tag_id", "file_key_name": "models.asana__tag"}, "test.asana.not_null_asana__tag_tag_id.593d626953": {"raw_sql": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "tag_id", "model": "{{ get_where_subquery(ref('asana__tag')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.asana.asana__tag"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "dbt-package-testing", "schema": "asana_source_integration_source_dbt_test__audit", "fqn": ["asana", "not_null_asana__tag_tag_id"], "unique_id": "test.asana.not_null_asana__tag_tag_id.593d626953", "package_name": "asana", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/asana", "path": "not_null_asana__tag_tag_id.sql", "original_file_path": "models/asana.yml", "name": "not_null_asana__tag_tag_id", "alias": "not_null_asana__tag_tag_id", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["asana__tag"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/asana/models/asana.yml/not_null_asana__tag_tag_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1663600953.790965, "compiled_sql": "\n \n \n\n\n\nselect tag_id\nfrom `dbt-package-testing`.`asana_source_integration_source_asana`.`asana__tag`\nwhere tag_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "tag_id", "file_key_name": "models.asana__tag"}, "test.asana.unique_asana__daily_metrics_date_day.e8d67f545d": {"raw_sql": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "test_metadata": {"name": "unique", "kwargs": {"column_name": "date_day", "model": "{{ get_where_subquery(ref('asana__daily_metrics')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["model.asana.asana__daily_metrics"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "dbt-package-testing", "schema": "asana_source_integration_source_dbt_test__audit", "fqn": ["asana", "unique_asana__daily_metrics_date_day"], "unique_id": "test.asana.unique_asana__daily_metrics_date_day.e8d67f545d", "package_name": "asana", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/asana", "path": "unique_asana__daily_metrics_date_day.sql", "original_file_path": "models/asana.yml", "name": "unique_asana__daily_metrics_date_day", "alias": "unique_asana__daily_metrics_date_day", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["asana__daily_metrics"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/asana/models/asana.yml/unique_asana__daily_metrics_date_day.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1663600953.791883, "compiled_sql": "\n \n \n\nwith dbt_test__target as (\n\n select date_day as unique_field\n from `dbt-package-testing`.`asana_source_integration_source_asana`.`asana__daily_metrics`\n where date_day is not null\n\n)\n\nselect\n unique_field,\n count(*) as n_records\n\nfrom dbt_test__target\ngroup by unique_field\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "date_day", "file_key_name": "models.asana__daily_metrics"}, "test.asana.not_null_asana__daily_metrics_date_day.363a2a09cf": {"raw_sql": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "date_day", "model": "{{ get_where_subquery(ref('asana__daily_metrics')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.asana.asana__daily_metrics"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "dbt-package-testing", "schema": "asana_source_integration_source_dbt_test__audit", "fqn": ["asana", "not_null_asana__daily_metrics_date_day"], "unique_id": "test.asana.not_null_asana__daily_metrics_date_day.363a2a09cf", "package_name": "asana", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/asana", "path": "not_null_asana__daily_metrics_date_day.sql", "original_file_path": "models/asana.yml", "name": "not_null_asana__daily_metrics_date_day", "alias": "not_null_asana__daily_metrics_date_day", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["asana__daily_metrics"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/asana/models/asana.yml/not_null_asana__daily_metrics_date_day.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1663600953.792793, "compiled_sql": "\n \n \n\n\n\nselect date_day\nfrom `dbt-package-testing`.`asana_source_integration_source_asana`.`asana__daily_metrics`\nwhere date_day is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "date_day", "file_key_name": "models.asana__daily_metrics"}, "test.asana.unique_int_asana__project_task_metrics_project_id.049cc9b8a6": {"raw_sql": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "test_metadata": {"name": "unique", "kwargs": {"column_name": "project_id", "model": "{{ get_where_subquery(ref('int_asana__project_task_metrics')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["model.asana.int_asana__project_task_metrics"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "dbt-package-testing", "schema": "asana_source_integration_source_dbt_test__audit", "fqn": ["asana", "intermediate", "unique_int_asana__project_task_metrics_project_id"], "unique_id": "test.asana.unique_int_asana__project_task_metrics_project_id.049cc9b8a6", "package_name": "asana", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/asana", "path": "unique_int_asana__project_task_metrics_project_id.sql", "original_file_path": "models/intermediate/intermediate_asana.yml", "name": "unique_int_asana__project_task_metrics_project_id", "alias": "unique_int_asana__project_task_metrics_project_id", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["int_asana__project_task_metrics"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/asana/models/intermediate/intermediate_asana.yml/unique_int_asana__project_task_metrics_project_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1663600953.79853, "compiled_sql": "\n \n \n\nwith __dbt__cte__int_asana__project_task_metrics as (\nwith task as (\n\n select *\n from `dbt-package-testing`.`asana_source_integration_source_asana`.`asana__task`\n\n),\n\nproject as (\n\n select * \n from `dbt-package-testing`.`asana_source_integration_source_stg_asana`.`stg_asana__project`\n\n),\n\nproject_task as (\n\n select * \n from `dbt-package-testing`.`asana_source_integration_source_stg_asana`.`stg_asana__project_task`\n),\n\nproject_task_history as (\n\n select\n project.project_id,\n task.task_id,\n task.is_completed as task_is_completed,\n task.assignee_user_id as task_assignee_user_id,\n task.days_open as task_days_open,\n task.days_since_last_assignment as task_days_assigned_current_user\n\n from project\n left join project_task \n on project.project_id = project_task.project_id\n left join task \n on project_task.task_id = task.task_id\n\n),\n\nagg_proj_tasks as (\n\n select \n project_id,\n sum(case when not task_is_completed then 1 else 0 end) as number_of_open_tasks,\n sum(case when not task_is_completed and task_assignee_user_id is not null then 1 else 0 end) as number_of_assigned_open_tasks,\n sum(case when task_is_completed then 1 else 0 end) as number_of_tasks_completed,\n sum(case when task_is_completed and task_assignee_user_id is not null then 1 else 0 end) as number_of_assigned_tasks_completed,\n sum(case when task_is_completed then task_days_open else 0 end) as total_days_open,\n sum(case when task_is_completed then task_days_assigned_current_user else 0 end) as total_days_assigned_last_user -- will divde later for avg\n\n from project_task_history\n\n group by 1\n\n),\n\nfinal as (\n\n select\n agg_proj_tasks.*,\n round(nullif(total_days_open, 0) * 1.0 / nullif(number_of_tasks_completed, 0), 0) as avg_close_time_days,\n round(nullif(total_days_assigned_last_user, 0) * 1.0 / nullif(number_of_assigned_tasks_completed, 0), 0) as avg_close_time_assigned_days\n\n from agg_proj_tasks\n \n)\n\nselect * from final\n),dbt_test__target as (\n\n select project_id as unique_field\n from __dbt__cte__int_asana__project_task_metrics\n where project_id is not null\n\n)\n\nselect\n unique_field,\n count(*) as n_records\n\nfrom dbt_test__target\ngroup by unique_field\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.asana.int_asana__project_task_metrics", "sql": " __dbt__cte__int_asana__project_task_metrics as (\nwith task as (\n\n select *\n from `dbt-package-testing`.`asana_source_integration_source_asana`.`asana__task`\n\n),\n\nproject as (\n\n select * \n from `dbt-package-testing`.`asana_source_integration_source_stg_asana`.`stg_asana__project`\n\n),\n\nproject_task as (\n\n select * \n from `dbt-package-testing`.`asana_source_integration_source_stg_asana`.`stg_asana__project_task`\n),\n\nproject_task_history as (\n\n select\n project.project_id,\n task.task_id,\n task.is_completed as task_is_completed,\n task.assignee_user_id as task_assignee_user_id,\n task.days_open as task_days_open,\n task.days_since_last_assignment as task_days_assigned_current_user\n\n from project\n left join project_task \n on project.project_id = project_task.project_id\n left join task \n on project_task.task_id = task.task_id\n\n),\n\nagg_proj_tasks as (\n\n select \n project_id,\n sum(case when not task_is_completed then 1 else 0 end) as number_of_open_tasks,\n sum(case when not task_is_completed and task_assignee_user_id is not null then 1 else 0 end) as number_of_assigned_open_tasks,\n sum(case when task_is_completed then 1 else 0 end) as number_of_tasks_completed,\n sum(case when task_is_completed and task_assignee_user_id is not null then 1 else 0 end) as number_of_assigned_tasks_completed,\n sum(case when task_is_completed then task_days_open else 0 end) as total_days_open,\n sum(case when task_is_completed then task_days_assigned_current_user else 0 end) as total_days_assigned_last_user -- will divde later for avg\n\n from project_task_history\n\n group by 1\n\n),\n\nfinal as (\n\n select\n agg_proj_tasks.*,\n round(nullif(total_days_open, 0) * 1.0 / nullif(number_of_tasks_completed, 0), 0) as avg_close_time_days,\n round(nullif(total_days_assigned_last_user, 0) * 1.0 / nullif(number_of_assigned_tasks_completed, 0), 0) as avg_close_time_assigned_days\n\n from agg_proj_tasks\n \n)\n\nselect * from final\n)"}], "relation_name": null, "column_name": "project_id", "file_key_name": "models.int_asana__project_task_metrics"}, "test.asana.not_null_int_asana__project_task_metrics_project_id.804fd1daf3": {"raw_sql": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "project_id", "model": "{{ get_where_subquery(ref('int_asana__project_task_metrics')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.asana.int_asana__project_task_metrics"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "dbt-package-testing", "schema": "asana_source_integration_source_dbt_test__audit", "fqn": ["asana", "intermediate", "not_null_int_asana__project_task_metrics_project_id"], "unique_id": "test.asana.not_null_int_asana__project_task_metrics_project_id.804fd1daf3", "package_name": "asana", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/asana", "path": "not_null_int_asana__project_task_metrics_project_id.sql", "original_file_path": "models/intermediate/intermediate_asana.yml", "name": "not_null_int_asana__project_task_metrics_project_id", "alias": "not_null_int_asana__project_task_metrics_project_id", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["int_asana__project_task_metrics"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/asana/models/intermediate/intermediate_asana.yml/not_null_int_asana__project_task_metrics_project_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1663600953.799594, "compiled_sql": "\n \n \n\n\n\nwith __dbt__cte__int_asana__project_task_metrics as (\nwith task as (\n\n select *\n from `dbt-package-testing`.`asana_source_integration_source_asana`.`asana__task`\n\n),\n\nproject as (\n\n select * \n from `dbt-package-testing`.`asana_source_integration_source_stg_asana`.`stg_asana__project`\n\n),\n\nproject_task as (\n\n select * \n from `dbt-package-testing`.`asana_source_integration_source_stg_asana`.`stg_asana__project_task`\n),\n\nproject_task_history as (\n\n select\n project.project_id,\n task.task_id,\n task.is_completed as task_is_completed,\n task.assignee_user_id as task_assignee_user_id,\n task.days_open as task_days_open,\n task.days_since_last_assignment as task_days_assigned_current_user\n\n from project\n left join project_task \n on project.project_id = project_task.project_id\n left join task \n on project_task.task_id = task.task_id\n\n),\n\nagg_proj_tasks as (\n\n select \n project_id,\n sum(case when not task_is_completed then 1 else 0 end) as number_of_open_tasks,\n sum(case when not task_is_completed and task_assignee_user_id is not null then 1 else 0 end) as number_of_assigned_open_tasks,\n sum(case when task_is_completed then 1 else 0 end) as number_of_tasks_completed,\n sum(case when task_is_completed and task_assignee_user_id is not null then 1 else 0 end) as number_of_assigned_tasks_completed,\n sum(case when task_is_completed then task_days_open else 0 end) as total_days_open,\n sum(case when task_is_completed then task_days_assigned_current_user else 0 end) as total_days_assigned_last_user -- will divde later for avg\n\n from project_task_history\n\n group by 1\n\n),\n\nfinal as (\n\n select\n agg_proj_tasks.*,\n round(nullif(total_days_open, 0) * 1.0 / nullif(number_of_tasks_completed, 0), 0) as avg_close_time_days,\n round(nullif(total_days_assigned_last_user, 0) * 1.0 / nullif(number_of_assigned_tasks_completed, 0), 0) as avg_close_time_assigned_days\n\n from agg_proj_tasks\n \n)\n\nselect * from final\n)select project_id\nfrom __dbt__cte__int_asana__project_task_metrics\nwhere project_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.asana.int_asana__project_task_metrics", "sql": " __dbt__cte__int_asana__project_task_metrics as (\nwith task as (\n\n select *\n from `dbt-package-testing`.`asana_source_integration_source_asana`.`asana__task`\n\n),\n\nproject as (\n\n select * \n from `dbt-package-testing`.`asana_source_integration_source_stg_asana`.`stg_asana__project`\n\n),\n\nproject_task as (\n\n select * \n from `dbt-package-testing`.`asana_source_integration_source_stg_asana`.`stg_asana__project_task`\n),\n\nproject_task_history as (\n\n select\n project.project_id,\n task.task_id,\n task.is_completed as task_is_completed,\n task.assignee_user_id as task_assignee_user_id,\n task.days_open as task_days_open,\n task.days_since_last_assignment as task_days_assigned_current_user\n\n from project\n left join project_task \n on project.project_id = project_task.project_id\n left join task \n on project_task.task_id = task.task_id\n\n),\n\nagg_proj_tasks as (\n\n select \n project_id,\n sum(case when not task_is_completed then 1 else 0 end) as number_of_open_tasks,\n sum(case when not task_is_completed and task_assignee_user_id is not null then 1 else 0 end) as number_of_assigned_open_tasks,\n sum(case when task_is_completed then 1 else 0 end) as number_of_tasks_completed,\n sum(case when task_is_completed and task_assignee_user_id is not null then 1 else 0 end) as number_of_assigned_tasks_completed,\n sum(case when task_is_completed then task_days_open else 0 end) as total_days_open,\n sum(case when task_is_completed then task_days_assigned_current_user else 0 end) as total_days_assigned_last_user -- will divde later for avg\n\n from project_task_history\n\n group by 1\n\n),\n\nfinal as (\n\n select\n agg_proj_tasks.*,\n round(nullif(total_days_open, 0) * 1.0 / nullif(number_of_tasks_completed, 0), 0) as avg_close_time_days,\n round(nullif(total_days_assigned_last_user, 0) * 1.0 / nullif(number_of_assigned_tasks_completed, 0), 0) as avg_close_time_assigned_days\n\n from agg_proj_tasks\n \n)\n\nselect * from final\n)"}], "relation_name": null, "column_name": "project_id", "file_key_name": "models.int_asana__project_task_metrics"}, "test.asana.dbt_utils_unique_combination_of_columns_int_asana__project_user_project_id__user_id__role__currently_working_on.f9493098e0": {"raw_sql": "{{ dbt_utils.test_unique_combination_of_columns(**_dbt_generic_test_kwargs) }}{{ config(alias=\"dbt_utils_unique_combination_o_2eee10354a4e647bd50fdf44bb16839c\") }}", "test_metadata": {"name": "unique_combination_of_columns", "kwargs": {"combination_of_columns": ["project_id", "user_id", "role", "currently_working_on"], "model": "{{ get_where_subquery(ref('int_asana__project_user')) }}"}, "namespace": "dbt_utils"}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt_utils.test_unique_combination_of_columns", "macro.dbt.get_where_subquery"], "nodes": ["model.asana.int_asana__project_user"]}, "config": {"enabled": true, "alias": "dbt_utils_unique_combination_o_2eee10354a4e647bd50fdf44bb16839c", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "dbt-package-testing", "schema": "asana_source_integration_source_dbt_test__audit", "fqn": ["asana", "intermediate", "dbt_utils_unique_combination_of_columns_int_asana__project_user_project_id__user_id__role__currently_working_on"], "unique_id": "test.asana.dbt_utils_unique_combination_of_columns_int_asana__project_user_project_id__user_id__role__currently_working_on.f9493098e0", "package_name": "asana", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/asana", "path": "dbt_utils_unique_combination_o_2eee10354a4e647bd50fdf44bb16839c.sql", "original_file_path": "models/intermediate/intermediate_asana.yml", "name": "dbt_utils_unique_combination_of_columns_int_asana__project_user_project_id__user_id__role__currently_working_on", "alias": "dbt_utils_unique_combination_o_2eee10354a4e647bd50fdf44bb16839c", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["int_asana__project_user"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/asana/models/intermediate/intermediate_asana.yml/dbt_utils_unique_combination_o_2eee10354a4e647bd50fdf44bb16839c.sql", "build_path": null, "deferred": false, "unrendered_config": {"alias": "dbt_utils_unique_combination_o_2eee10354a4e647bd50fdf44bb16839c"}, "created_at": 1663600953.800538, "compiled_sql": "\n\n\n\n\n\nwith __dbt__cte__int_asana__task_assignee as (\nwith task as (\n\n select * \n from `dbt-package-testing`.`asana_source_integration_source_stg_asana`.`stg_asana__task`\n\n),\n\nasana_user as (\n\n select *\n from `dbt-package-testing`.`asana_source_integration_source_stg_asana`.`stg_asana__user`\n),\n\ntask_assignee as (\n\n select\n task.*,\n assignee_user_id is not null as has_assignee,\n asana_user.user_name as assignee_name,\n asana_user.email as assignee_email\n\n from task \n left join asana_user \n on task.assignee_user_id = asana_user.user_id\n)\n\nselect * from task_assignee\n), __dbt__cte__int_asana__project_user as (\nwith project_tasks as (\n \n select *\n from `dbt-package-testing`.`asana_source_integration_source_stg_asana`.`stg_asana__project_task`\n),\n\nassigned_tasks as (\n \n select * \n from __dbt__cte__int_asana__task_assignee\n where has_assignee\n \n),\n\nproject as (\n \n select *\n from `dbt-package-testing`.`asana_source_integration_source_stg_asana`.`stg_asana__project`\n\n where not is_archived\n\n),\n\nproject_assignee as (\n\n select\n project_tasks.project_id,\n project_tasks.task_id,\n assigned_tasks.assignee_user_id,\n assigned_tasks.assignee_name,\n not assigned_tasks.is_completed as currently_working_on\n\n from project_tasks \n join assigned_tasks \n on assigned_tasks.task_id = project_tasks.task_id\n\n),\n\nproject_owner as (\n\n select \n project_id,\n project_name,\n owner_user_id\n\n from project\n \n where owner_user_id is not null\n),\n\nproject_user as (\n \n select\n project_id,\n project_name,\n owner_user_id as user_id,\n 'owner' as role,\n null as currently_working_on\n \n from project_owner\n\n union all\n\n select\n project.project_id,\n project.project_name,\n project_assignee.assignee_user_id as user_id,\n 'task assignee' as role,\n project_assignee.currently_working_on\n \n from project \n \n join project_assignee \n on project.project_id = project_assignee.project_id\n group by 1,2,3,4,5\n\n)\n\n\nselect * from project_user\n),validation_errors as (\n\n select\n project_id, user_id, role, currently_working_on\n from __dbt__cte__int_asana__project_user\n group by project_id, user_id, role, currently_working_on\n having count(*) > 1\n\n)\n\nselect *\nfrom validation_errors\n\n\n", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.asana.int_asana__task_assignee", "sql": " __dbt__cte__int_asana__task_assignee as (\nwith task as (\n\n select * \n from `dbt-package-testing`.`asana_source_integration_source_stg_asana`.`stg_asana__task`\n\n),\n\nasana_user as (\n\n select *\n from `dbt-package-testing`.`asana_source_integration_source_stg_asana`.`stg_asana__user`\n),\n\ntask_assignee as (\n\n select\n task.*,\n assignee_user_id is not null as has_assignee,\n asana_user.user_name as assignee_name,\n asana_user.email as assignee_email\n\n from task \n left join asana_user \n on task.assignee_user_id = asana_user.user_id\n)\n\nselect * from task_assignee\n)"}, {"id": "model.asana.int_asana__project_user", "sql": " __dbt__cte__int_asana__project_user as (\nwith project_tasks as (\n \n select *\n from `dbt-package-testing`.`asana_source_integration_source_stg_asana`.`stg_asana__project_task`\n),\n\nassigned_tasks as (\n \n select * \n from __dbt__cte__int_asana__task_assignee\n where has_assignee\n \n),\n\nproject as (\n \n select *\n from `dbt-package-testing`.`asana_source_integration_source_stg_asana`.`stg_asana__project`\n\n where not is_archived\n\n),\n\nproject_assignee as (\n\n select\n project_tasks.project_id,\n project_tasks.task_id,\n assigned_tasks.assignee_user_id,\n assigned_tasks.assignee_name,\n not assigned_tasks.is_completed as currently_working_on\n\n from project_tasks \n join assigned_tasks \n on assigned_tasks.task_id = project_tasks.task_id\n\n),\n\nproject_owner as (\n\n select \n project_id,\n project_name,\n owner_user_id\n\n from project\n \n where owner_user_id is not null\n),\n\nproject_user as (\n \n select\n project_id,\n project_name,\n owner_user_id as user_id,\n 'owner' as role,\n null as currently_working_on\n \n from project_owner\n\n union all\n\n select\n project.project_id,\n project.project_name,\n project_assignee.assignee_user_id as user_id,\n 'task assignee' as role,\n project_assignee.currently_working_on\n \n from project \n \n join project_assignee \n on project.project_id = project_assignee.project_id\n group by 1,2,3,4,5\n\n)\n\n\nselect * from project_user\n)"}], "relation_name": null, "column_name": null, "file_key_name": "models.int_asana__project_user"}, "test.asana.unique_int_asana__subtask_parent_subtask_id.641dfb3c8f": {"raw_sql": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "test_metadata": {"name": "unique", "kwargs": {"column_name": "subtask_id", "model": "{{ get_where_subquery(ref('int_asana__subtask_parent')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["model.asana.int_asana__subtask_parent"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "dbt-package-testing", "schema": "asana_source_integration_source_dbt_test__audit", "fqn": ["asana", "intermediate", "unique_int_asana__subtask_parent_subtask_id"], "unique_id": "test.asana.unique_int_asana__subtask_parent_subtask_id.641dfb3c8f", "package_name": "asana", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/asana", "path": "unique_int_asana__subtask_parent_subtask_id.sql", "original_file_path": "models/intermediate/intermediate_asana.yml", "name": "unique_int_asana__subtask_parent_subtask_id", "alias": "unique_int_asana__subtask_parent_subtask_id", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["int_asana__subtask_parent"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/asana/models/intermediate/intermediate_asana.yml/unique_int_asana__subtask_parent_subtask_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1663600953.807439, "compiled_sql": "\n \n \n\nwith __dbt__cte__int_asana__task_assignee as (\nwith task as (\n\n select * \n from `dbt-package-testing`.`asana_source_integration_source_stg_asana`.`stg_asana__task`\n\n),\n\nasana_user as (\n\n select *\n from `dbt-package-testing`.`asana_source_integration_source_stg_asana`.`stg_asana__user`\n),\n\ntask_assignee as (\n\n select\n task.*,\n assignee_user_id is not null as has_assignee,\n asana_user.user_name as assignee_name,\n asana_user.email as assignee_email\n\n from task \n left join asana_user \n on task.assignee_user_id = asana_user.user_id\n)\n\nselect * from task_assignee\n), __dbt__cte__int_asana__subtask_parent as (\nwith task_assignee as (\n\n select * \n from __dbt__cte__int_asana__task_assignee\n\n),\n\n\nsubtask_parent as (\n\n select\n subtask.task_id as subtask_id,\n parent.task_id as parent_task_id,\n parent.task_name as parent_task_name,\n parent.due_date as parent_due_date,\n parent.created_at as parent_created_at,\n parent.assignee_user_id as parent_assignee_user_id,\n parent.assignee_name as parent_assignee_name\n\n from task_assignee as parent \n join task_assignee as subtask\n on parent.task_id = subtask.parent_task_id\n\n)\n\nselect * from subtask_parent\n),dbt_test__target as (\n\n select subtask_id as unique_field\n from __dbt__cte__int_asana__subtask_parent\n where subtask_id is not null\n\n)\n\nselect\n unique_field,\n count(*) as n_records\n\nfrom dbt_test__target\ngroup by unique_field\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.asana.int_asana__task_assignee", "sql": " __dbt__cte__int_asana__task_assignee as (\nwith task as (\n\n select * \n from `dbt-package-testing`.`asana_source_integration_source_stg_asana`.`stg_asana__task`\n\n),\n\nasana_user as (\n\n select *\n from `dbt-package-testing`.`asana_source_integration_source_stg_asana`.`stg_asana__user`\n),\n\ntask_assignee as (\n\n select\n task.*,\n assignee_user_id is not null as has_assignee,\n asana_user.user_name as assignee_name,\n asana_user.email as assignee_email\n\n from task \n left join asana_user \n on task.assignee_user_id = asana_user.user_id\n)\n\nselect * from task_assignee\n)"}, {"id": "model.asana.int_asana__subtask_parent", "sql": " __dbt__cte__int_asana__subtask_parent as (\nwith task_assignee as (\n\n select * \n from __dbt__cte__int_asana__task_assignee\n\n),\n\n\nsubtask_parent as (\n\n select\n subtask.task_id as subtask_id,\n parent.task_id as parent_task_id,\n parent.task_name as parent_task_name,\n parent.due_date as parent_due_date,\n parent.created_at as parent_created_at,\n parent.assignee_user_id as parent_assignee_user_id,\n parent.assignee_name as parent_assignee_name\n\n from task_assignee as parent \n join task_assignee as subtask\n on parent.task_id = subtask.parent_task_id\n\n)\n\nselect * from subtask_parent\n)"}], "relation_name": null, "column_name": "subtask_id", "file_key_name": "models.int_asana__subtask_parent"}, "test.asana.not_null_int_asana__subtask_parent_subtask_id.024565c768": {"raw_sql": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "subtask_id", "model": "{{ get_where_subquery(ref('int_asana__subtask_parent')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.asana.int_asana__subtask_parent"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "dbt-package-testing", "schema": "asana_source_integration_source_dbt_test__audit", "fqn": ["asana", "intermediate", "not_null_int_asana__subtask_parent_subtask_id"], "unique_id": "test.asana.not_null_int_asana__subtask_parent_subtask_id.024565c768", "package_name": "asana", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/asana", "path": "not_null_int_asana__subtask_parent_subtask_id.sql", "original_file_path": "models/intermediate/intermediate_asana.yml", "name": "not_null_int_asana__subtask_parent_subtask_id", "alias": "not_null_int_asana__subtask_parent_subtask_id", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["int_asana__subtask_parent"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/asana/models/intermediate/intermediate_asana.yml/not_null_int_asana__subtask_parent_subtask_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1663600953.808511, "compiled_sql": "\n \n \n\n\n\nwith __dbt__cte__int_asana__task_assignee as (\nwith task as (\n\n select * \n from `dbt-package-testing`.`asana_source_integration_source_stg_asana`.`stg_asana__task`\n\n),\n\nasana_user as (\n\n select *\n from `dbt-package-testing`.`asana_source_integration_source_stg_asana`.`stg_asana__user`\n),\n\ntask_assignee as (\n\n select\n task.*,\n assignee_user_id is not null as has_assignee,\n asana_user.user_name as assignee_name,\n asana_user.email as assignee_email\n\n from task \n left join asana_user \n on task.assignee_user_id = asana_user.user_id\n)\n\nselect * from task_assignee\n), __dbt__cte__int_asana__subtask_parent as (\nwith task_assignee as (\n\n select * \n from __dbt__cte__int_asana__task_assignee\n\n),\n\n\nsubtask_parent as (\n\n select\n subtask.task_id as subtask_id,\n parent.task_id as parent_task_id,\n parent.task_name as parent_task_name,\n parent.due_date as parent_due_date,\n parent.created_at as parent_created_at,\n parent.assignee_user_id as parent_assignee_user_id,\n parent.assignee_name as parent_assignee_name\n\n from task_assignee as parent \n join task_assignee as subtask\n on parent.task_id = subtask.parent_task_id\n\n)\n\nselect * from subtask_parent\n)select subtask_id\nfrom __dbt__cte__int_asana__subtask_parent\nwhere subtask_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.asana.int_asana__task_assignee", "sql": " __dbt__cte__int_asana__task_assignee as (\nwith task as (\n\n select * \n from `dbt-package-testing`.`asana_source_integration_source_stg_asana`.`stg_asana__task`\n\n),\n\nasana_user as (\n\n select *\n from `dbt-package-testing`.`asana_source_integration_source_stg_asana`.`stg_asana__user`\n),\n\ntask_assignee as (\n\n select\n task.*,\n assignee_user_id is not null as has_assignee,\n asana_user.user_name as assignee_name,\n asana_user.email as assignee_email\n\n from task \n left join asana_user \n on task.assignee_user_id = asana_user.user_id\n)\n\nselect * from task_assignee\n)"}, {"id": "model.asana.int_asana__subtask_parent", "sql": " __dbt__cte__int_asana__subtask_parent as (\nwith task_assignee as (\n\n select * \n from __dbt__cte__int_asana__task_assignee\n\n),\n\n\nsubtask_parent as (\n\n select\n subtask.task_id as subtask_id,\n parent.task_id as parent_task_id,\n parent.task_name as parent_task_name,\n parent.due_date as parent_due_date,\n parent.created_at as parent_created_at,\n parent.assignee_user_id as parent_assignee_user_id,\n parent.assignee_name as parent_assignee_name\n\n from task_assignee as parent \n join task_assignee as subtask\n on parent.task_id = subtask.parent_task_id\n\n)\n\nselect * from subtask_parent\n)"}], "relation_name": null, "column_name": "subtask_id", "file_key_name": "models.int_asana__subtask_parent"}, "test.asana.unique_int_asana__task_assignee_task_id.b4e2ea04e1": {"raw_sql": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "test_metadata": {"name": "unique", "kwargs": {"column_name": "task_id", "model": "{{ get_where_subquery(ref('int_asana__task_assignee')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["model.asana.int_asana__task_assignee"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "dbt-package-testing", "schema": "asana_source_integration_source_dbt_test__audit", "fqn": ["asana", "intermediate", "unique_int_asana__task_assignee_task_id"], "unique_id": "test.asana.unique_int_asana__task_assignee_task_id.b4e2ea04e1", "package_name": "asana", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/asana", "path": "unique_int_asana__task_assignee_task_id.sql", "original_file_path": "models/intermediate/intermediate_asana.yml", "name": "unique_int_asana__task_assignee_task_id", "alias": "unique_int_asana__task_assignee_task_id", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["int_asana__task_assignee"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/asana/models/intermediate/intermediate_asana.yml/unique_int_asana__task_assignee_task_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1663600953.8094451, "compiled_sql": "\n \n \n\nwith __dbt__cte__int_asana__task_assignee as (\nwith task as (\n\n select * \n from `dbt-package-testing`.`asana_source_integration_source_stg_asana`.`stg_asana__task`\n\n),\n\nasana_user as (\n\n select *\n from `dbt-package-testing`.`asana_source_integration_source_stg_asana`.`stg_asana__user`\n),\n\ntask_assignee as (\n\n select\n task.*,\n assignee_user_id is not null as has_assignee,\n asana_user.user_name as assignee_name,\n asana_user.email as assignee_email\n\n from task \n left join asana_user \n on task.assignee_user_id = asana_user.user_id\n)\n\nselect * from task_assignee\n),dbt_test__target as (\n\n select task_id as unique_field\n from __dbt__cte__int_asana__task_assignee\n where task_id is not null\n\n)\n\nselect\n unique_field,\n count(*) as n_records\n\nfrom dbt_test__target\ngroup by unique_field\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.asana.int_asana__task_assignee", "sql": " __dbt__cte__int_asana__task_assignee as (\nwith task as (\n\n select * \n from `dbt-package-testing`.`asana_source_integration_source_stg_asana`.`stg_asana__task`\n\n),\n\nasana_user as (\n\n select *\n from `dbt-package-testing`.`asana_source_integration_source_stg_asana`.`stg_asana__user`\n),\n\ntask_assignee as (\n\n select\n task.*,\n assignee_user_id is not null as has_assignee,\n asana_user.user_name as assignee_name,\n asana_user.email as assignee_email\n\n from task \n left join asana_user \n on task.assignee_user_id = asana_user.user_id\n)\n\nselect * from task_assignee\n)"}], "relation_name": null, "column_name": "task_id", "file_key_name": "models.int_asana__task_assignee"}, "test.asana.not_null_int_asana__task_assignee_task_id.a9c81bd443": {"raw_sql": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "task_id", "model": "{{ get_where_subquery(ref('int_asana__task_assignee')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.asana.int_asana__task_assignee"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "dbt-package-testing", "schema": "asana_source_integration_source_dbt_test__audit", "fqn": ["asana", "intermediate", "not_null_int_asana__task_assignee_task_id"], "unique_id": "test.asana.not_null_int_asana__task_assignee_task_id.a9c81bd443", "package_name": "asana", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/asana", "path": "not_null_int_asana__task_assignee_task_id.sql", "original_file_path": "models/intermediate/intermediate_asana.yml", "name": "not_null_int_asana__task_assignee_task_id", "alias": "not_null_int_asana__task_assignee_task_id", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["int_asana__task_assignee"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/asana/models/intermediate/intermediate_asana.yml/not_null_int_asana__task_assignee_task_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1663600953.810377, "compiled_sql": "\n \n \n\n\n\nwith __dbt__cte__int_asana__task_assignee as (\nwith task as (\n\n select * \n from `dbt-package-testing`.`asana_source_integration_source_stg_asana`.`stg_asana__task`\n\n),\n\nasana_user as (\n\n select *\n from `dbt-package-testing`.`asana_source_integration_source_stg_asana`.`stg_asana__user`\n),\n\ntask_assignee as (\n\n select\n task.*,\n assignee_user_id is not null as has_assignee,\n asana_user.user_name as assignee_name,\n asana_user.email as assignee_email\n\n from task \n left join asana_user \n on task.assignee_user_id = asana_user.user_id\n)\n\nselect * from task_assignee\n)select task_id\nfrom __dbt__cte__int_asana__task_assignee\nwhere task_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.asana.int_asana__task_assignee", "sql": " __dbt__cte__int_asana__task_assignee as (\nwith task as (\n\n select * \n from `dbt-package-testing`.`asana_source_integration_source_stg_asana`.`stg_asana__task`\n\n),\n\nasana_user as (\n\n select *\n from `dbt-package-testing`.`asana_source_integration_source_stg_asana`.`stg_asana__user`\n),\n\ntask_assignee as (\n\n select\n task.*,\n assignee_user_id is not null as has_assignee,\n asana_user.user_name as assignee_name,\n asana_user.email as assignee_email\n\n from task \n left join asana_user \n on task.assignee_user_id = asana_user.user_id\n)\n\nselect * from task_assignee\n)"}], "relation_name": null, "column_name": "task_id", "file_key_name": "models.int_asana__task_assignee"}, "test.asana.unique_int_asana__task_comments_task_id.f012fa6a04": {"raw_sql": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "test_metadata": {"name": "unique", "kwargs": {"column_name": "task_id", "model": "{{ get_where_subquery(ref('int_asana__task_comments')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["model.asana.int_asana__task_comments"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "dbt-package-testing", "schema": "asana_source_integration_source_dbt_test__audit", "fqn": ["asana", "intermediate", "unique_int_asana__task_comments_task_id"], "unique_id": "test.asana.unique_int_asana__task_comments_task_id.f012fa6a04", "package_name": "asana", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/asana", "path": "unique_int_asana__task_comments_task_id.sql", "original_file_path": "models/intermediate/intermediate_asana.yml", "name": "unique_int_asana__task_comments_task_id", "alias": "unique_int_asana__task_comments_task_id", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["int_asana__task_comments"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/asana/models/intermediate/intermediate_asana.yml/unique_int_asana__task_comments_task_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1663600953.811305, "compiled_sql": "\n \n \n\nwith __dbt__cte__int_asana__task_story as (\nwith story as (\n \n select * \n from `dbt-package-testing`.`asana_source_integration_source_stg_asana`.`stg_asana__story`\n\n),\n\nasana_user as (\n\n select * \n from `dbt-package-testing`.`asana_source_integration_source_stg_asana`.`stg_asana__user`\n),\n\nstory_user as (\n select \n story.*,\n asana_user.user_name as created_by_name\n from story\n join asana_user \n on story.created_by_user_id = asana_user.user_id\n),\n\nsplit_comments as (\n\n select\n story_id,\n created_at,\n created_by_user_id,\n created_by_name,\n target_task_id,\n \n case when event_type = 'comment' then story_content \n else null end as comment_content,\n\n case when event_type = 'system' then story_content \n else 'comment' end as action_description\n \n from story_user\n\n),\n\n\n-- the next CTE uses this dictionary to parse the type of action out of the event descfription\n\n\nparse_actions as (\n select\n story_id,\n target_task_id,\n created_at,\n created_by_user_id,\n created_by_name,\n comment_content,\n case \n when action_description like 'added the name%' then 'added name' \n when action_description like 'changed the name%' then 'changed name' \n when action_description like 'removed the name' then 'removed name' \n when action_description like 'added the description%' then 'added description' \n when action_description like 'changed the description%' then 'changed description' \n when action_description like 'removed the description' then 'removed description' \n when action_description like 'added to%' then 'added to project' \n when action_description like 'removed from%' then 'removed from project' \n when action_description like 'assigned%' then 'assigned' \n when action_description like 'unassigned%' then 'unassigned' \n when action_description like 'changed the due date%' then 'changed due date' \n when action_description like 'changed the start date%due date%' then 'changed due date' \n when action_description like 'changed the start date%' then 'changed start date' \n when action_description like 'removed the due date%' then 'removed due date' \n when action_description like 'removed the date range%' then 'removed due date' \n when action_description like 'removed the start date' then 'removed start date' \n when action_description like 'added subtask%' then 'added subtask' \n when action_description like 'added%collaborator%' then 'added collaborator' \n when action_description like 'moved%' then 'moved to section' \n when action_description like 'duplicated task from%' then 'duplicated this from other task' \n when action_description like 'marked%as a duplicate of this' then 'marked other task as duplicate of this' \n when action_description like 'marked this a duplicate of%' then 'marked as duplicate' \n when action_description like 'marked this task complete' then 'completed' \n when action_description like 'completed this task' then 'completed' \n when action_description like 'marked incomplete' then 'marked incomplete' \n when action_description like 'marked this task as a milestone' then 'marked as milestone' \n when action_description like 'unmarked this task as a milestone' then 'unmarked as milestone' \n when action_description like 'marked this milestone complete' then 'completed milestone' \n when action_description like 'completed this milestone' then 'completed milestone' \n when action_description like 'attached%' then 'attachment' \n when action_description like 'liked your comment' then 'liked comment' \n when action_description like 'liked this task' then 'liked task' \n when action_description like 'liked your attachment' then 'liked attachment' \n when action_description like 'liked that you completed this task' then 'liked completion' \n when action_description like 'completed the last task you were waiting on%' then 'completed dependency' \n when action_description like 'added feedback to%' then 'added feedback' \n when action_description like 'changed%to%' then 'changed tag' \n when action_description like 'cleared%' then 'cleared tag' \n when action_description like 'comment' then 'comment' \n when action_description like 'have a task due on%' then ''\n else action_description end as action_taken,\n action_description\n \n from split_comments\n\n),\n\n\nfinal as (\n \n select * \n from parse_actions\n\n -- remove actions you don't care about (set to null in the actions dictionary above)\n where action_taken is not null \n\n)\n\n\nselect * from final\n), __dbt__cte__int_asana__task_comments as (\nwith comments as (\n \n select *\n from __dbt__cte__int_asana__task_story\n where comment_content is not null\n order by target_task_id, created_at asc\n\n),\n\ntask_conversation as (\n\n select\n target_task_id as task_id,\n -- creates a chronologically ordered conversation about the task\n \n string_agg(created_at || ' - ' || created_by_name || ': ' || comment_content, '\\n')\n\n as conversation,\n count(*) as number_of_comments\n\n from comments \n group by 1\n)\n\nselect * from task_conversation\n),dbt_test__target as (\n\n select task_id as unique_field\n from __dbt__cte__int_asana__task_comments\n where task_id is not null\n\n)\n\nselect\n unique_field,\n count(*) as n_records\n\nfrom dbt_test__target\ngroup by unique_field\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.asana.int_asana__task_story", "sql": " __dbt__cte__int_asana__task_story as (\nwith story as (\n \n select * \n from `dbt-package-testing`.`asana_source_integration_source_stg_asana`.`stg_asana__story`\n\n),\n\nasana_user as (\n\n select * \n from `dbt-package-testing`.`asana_source_integration_source_stg_asana`.`stg_asana__user`\n),\n\nstory_user as (\n select \n story.*,\n asana_user.user_name as created_by_name\n from story\n join asana_user \n on story.created_by_user_id = asana_user.user_id\n),\n\nsplit_comments as (\n\n select\n story_id,\n created_at,\n created_by_user_id,\n created_by_name,\n target_task_id,\n \n case when event_type = 'comment' then story_content \n else null end as comment_content,\n\n case when event_type = 'system' then story_content \n else 'comment' end as action_description\n \n from story_user\n\n),\n\n\n-- the next CTE uses this dictionary to parse the type of action out of the event descfription\n\n\nparse_actions as (\n select\n story_id,\n target_task_id,\n created_at,\n created_by_user_id,\n created_by_name,\n comment_content,\n case \n when action_description like 'added the name%' then 'added name' \n when action_description like 'changed the name%' then 'changed name' \n when action_description like 'removed the name' then 'removed name' \n when action_description like 'added the description%' then 'added description' \n when action_description like 'changed the description%' then 'changed description' \n when action_description like 'removed the description' then 'removed description' \n when action_description like 'added to%' then 'added to project' \n when action_description like 'removed from%' then 'removed from project' \n when action_description like 'assigned%' then 'assigned' \n when action_description like 'unassigned%' then 'unassigned' \n when action_description like 'changed the due date%' then 'changed due date' \n when action_description like 'changed the start date%due date%' then 'changed due date' \n when action_description like 'changed the start date%' then 'changed start date' \n when action_description like 'removed the due date%' then 'removed due date' \n when action_description like 'removed the date range%' then 'removed due date' \n when action_description like 'removed the start date' then 'removed start date' \n when action_description like 'added subtask%' then 'added subtask' \n when action_description like 'added%collaborator%' then 'added collaborator' \n when action_description like 'moved%' then 'moved to section' \n when action_description like 'duplicated task from%' then 'duplicated this from other task' \n when action_description like 'marked%as a duplicate of this' then 'marked other task as duplicate of this' \n when action_description like 'marked this a duplicate of%' then 'marked as duplicate' \n when action_description like 'marked this task complete' then 'completed' \n when action_description like 'completed this task' then 'completed' \n when action_description like 'marked incomplete' then 'marked incomplete' \n when action_description like 'marked this task as a milestone' then 'marked as milestone' \n when action_description like 'unmarked this task as a milestone' then 'unmarked as milestone' \n when action_description like 'marked this milestone complete' then 'completed milestone' \n when action_description like 'completed this milestone' then 'completed milestone' \n when action_description like 'attached%' then 'attachment' \n when action_description like 'liked your comment' then 'liked comment' \n when action_description like 'liked this task' then 'liked task' \n when action_description like 'liked your attachment' then 'liked attachment' \n when action_description like 'liked that you completed this task' then 'liked completion' \n when action_description like 'completed the last task you were waiting on%' then 'completed dependency' \n when action_description like 'added feedback to%' then 'added feedback' \n when action_description like 'changed%to%' then 'changed tag' \n when action_description like 'cleared%' then 'cleared tag' \n when action_description like 'comment' then 'comment' \n when action_description like 'have a task due on%' then ''\n else action_description end as action_taken,\n action_description\n \n from split_comments\n\n),\n\n\nfinal as (\n \n select * \n from parse_actions\n\n -- remove actions you don't care about (set to null in the actions dictionary above)\n where action_taken is not null \n\n)\n\n\nselect * from final\n)"}, {"id": "model.asana.int_asana__task_comments", "sql": " __dbt__cte__int_asana__task_comments as (\nwith comments as (\n \n select *\n from __dbt__cte__int_asana__task_story\n where comment_content is not null\n order by target_task_id, created_at asc\n\n),\n\ntask_conversation as (\n\n select\n target_task_id as task_id,\n -- creates a chronologically ordered conversation about the task\n \n string_agg(created_at || ' - ' || created_by_name || ': ' || comment_content, '\\n')\n\n as conversation,\n count(*) as number_of_comments\n\n from comments \n group by 1\n)\n\nselect * from task_conversation\n)"}], "relation_name": null, "column_name": "task_id", "file_key_name": "models.int_asana__task_comments"}, "test.asana.not_null_int_asana__task_comments_task_id.6986f1d77f": {"raw_sql": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "task_id", "model": "{{ get_where_subquery(ref('int_asana__task_comments')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.asana.int_asana__task_comments"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "dbt-package-testing", "schema": "asana_source_integration_source_dbt_test__audit", "fqn": ["asana", "intermediate", "not_null_int_asana__task_comments_task_id"], "unique_id": "test.asana.not_null_int_asana__task_comments_task_id.6986f1d77f", "package_name": "asana", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/asana", "path": "not_null_int_asana__task_comments_task_id.sql", "original_file_path": "models/intermediate/intermediate_asana.yml", "name": "not_null_int_asana__task_comments_task_id", "alias": "not_null_int_asana__task_comments_task_id", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["int_asana__task_comments"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/asana/models/intermediate/intermediate_asana.yml/not_null_int_asana__task_comments_task_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1663600953.812355, "compiled_sql": "\n \n \n\n\n\nwith __dbt__cte__int_asana__task_story as (\nwith story as (\n \n select * \n from `dbt-package-testing`.`asana_source_integration_source_stg_asana`.`stg_asana__story`\n\n),\n\nasana_user as (\n\n select * \n from `dbt-package-testing`.`asana_source_integration_source_stg_asana`.`stg_asana__user`\n),\n\nstory_user as (\n select \n story.*,\n asana_user.user_name as created_by_name\n from story\n join asana_user \n on story.created_by_user_id = asana_user.user_id\n),\n\nsplit_comments as (\n\n select\n story_id,\n created_at,\n created_by_user_id,\n created_by_name,\n target_task_id,\n \n case when event_type = 'comment' then story_content \n else null end as comment_content,\n\n case when event_type = 'system' then story_content \n else 'comment' end as action_description\n \n from story_user\n\n),\n\n\n-- the next CTE uses this dictionary to parse the type of action out of the event descfription\n\n\nparse_actions as (\n select\n story_id,\n target_task_id,\n created_at,\n created_by_user_id,\n created_by_name,\n comment_content,\n case \n when action_description like 'added the name%' then 'added name' \n when action_description like 'changed the name%' then 'changed name' \n when action_description like 'removed the name' then 'removed name' \n when action_description like 'added the description%' then 'added description' \n when action_description like 'changed the description%' then 'changed description' \n when action_description like 'removed the description' then 'removed description' \n when action_description like 'added to%' then 'added to project' \n when action_description like 'removed from%' then 'removed from project' \n when action_description like 'assigned%' then 'assigned' \n when action_description like 'unassigned%' then 'unassigned' \n when action_description like 'changed the due date%' then 'changed due date' \n when action_description like 'changed the start date%due date%' then 'changed due date' \n when action_description like 'changed the start date%' then 'changed start date' \n when action_description like 'removed the due date%' then 'removed due date' \n when action_description like 'removed the date range%' then 'removed due date' \n when action_description like 'removed the start date' then 'removed start date' \n when action_description like 'added subtask%' then 'added subtask' \n when action_description like 'added%collaborator%' then 'added collaborator' \n when action_description like 'moved%' then 'moved to section' \n when action_description like 'duplicated task from%' then 'duplicated this from other task' \n when action_description like 'marked%as a duplicate of this' then 'marked other task as duplicate of this' \n when action_description like 'marked this a duplicate of%' then 'marked as duplicate' \n when action_description like 'marked this task complete' then 'completed' \n when action_description like 'completed this task' then 'completed' \n when action_description like 'marked incomplete' then 'marked incomplete' \n when action_description like 'marked this task as a milestone' then 'marked as milestone' \n when action_description like 'unmarked this task as a milestone' then 'unmarked as milestone' \n when action_description like 'marked this milestone complete' then 'completed milestone' \n when action_description like 'completed this milestone' then 'completed milestone' \n when action_description like 'attached%' then 'attachment' \n when action_description like 'liked your comment' then 'liked comment' \n when action_description like 'liked this task' then 'liked task' \n when action_description like 'liked your attachment' then 'liked attachment' \n when action_description like 'liked that you completed this task' then 'liked completion' \n when action_description like 'completed the last task you were waiting on%' then 'completed dependency' \n when action_description like 'added feedback to%' then 'added feedback' \n when action_description like 'changed%to%' then 'changed tag' \n when action_description like 'cleared%' then 'cleared tag' \n when action_description like 'comment' then 'comment' \n when action_description like 'have a task due on%' then ''\n else action_description end as action_taken,\n action_description\n \n from split_comments\n\n),\n\n\nfinal as (\n \n select * \n from parse_actions\n\n -- remove actions you don't care about (set to null in the actions dictionary above)\n where action_taken is not null \n\n)\n\n\nselect * from final\n), __dbt__cte__int_asana__task_comments as (\nwith comments as (\n \n select *\n from __dbt__cte__int_asana__task_story\n where comment_content is not null\n order by target_task_id, created_at asc\n\n),\n\ntask_conversation as (\n\n select\n target_task_id as task_id,\n -- creates a chronologically ordered conversation about the task\n \n string_agg(created_at || ' - ' || created_by_name || ': ' || comment_content, '\\n')\n\n as conversation,\n count(*) as number_of_comments\n\n from comments \n group by 1\n)\n\nselect * from task_conversation\n)select task_id\nfrom __dbt__cte__int_asana__task_comments\nwhere task_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.asana.int_asana__task_story", "sql": " __dbt__cte__int_asana__task_story as (\nwith story as (\n \n select * \n from `dbt-package-testing`.`asana_source_integration_source_stg_asana`.`stg_asana__story`\n\n),\n\nasana_user as (\n\n select * \n from `dbt-package-testing`.`asana_source_integration_source_stg_asana`.`stg_asana__user`\n),\n\nstory_user as (\n select \n story.*,\n asana_user.user_name as created_by_name\n from story\n join asana_user \n on story.created_by_user_id = asana_user.user_id\n),\n\nsplit_comments as (\n\n select\n story_id,\n created_at,\n created_by_user_id,\n created_by_name,\n target_task_id,\n \n case when event_type = 'comment' then story_content \n else null end as comment_content,\n\n case when event_type = 'system' then story_content \n else 'comment' end as action_description\n \n from story_user\n\n),\n\n\n-- the next CTE uses this dictionary to parse the type of action out of the event descfription\n\n\nparse_actions as (\n select\n story_id,\n target_task_id,\n created_at,\n created_by_user_id,\n created_by_name,\n comment_content,\n case \n when action_description like 'added the name%' then 'added name' \n when action_description like 'changed the name%' then 'changed name' \n when action_description like 'removed the name' then 'removed name' \n when action_description like 'added the description%' then 'added description' \n when action_description like 'changed the description%' then 'changed description' \n when action_description like 'removed the description' then 'removed description' \n when action_description like 'added to%' then 'added to project' \n when action_description like 'removed from%' then 'removed from project' \n when action_description like 'assigned%' then 'assigned' \n when action_description like 'unassigned%' then 'unassigned' \n when action_description like 'changed the due date%' then 'changed due date' \n when action_description like 'changed the start date%due date%' then 'changed due date' \n when action_description like 'changed the start date%' then 'changed start date' \n when action_description like 'removed the due date%' then 'removed due date' \n when action_description like 'removed the date range%' then 'removed due date' \n when action_description like 'removed the start date' then 'removed start date' \n when action_description like 'added subtask%' then 'added subtask' \n when action_description like 'added%collaborator%' then 'added collaborator' \n when action_description like 'moved%' then 'moved to section' \n when action_description like 'duplicated task from%' then 'duplicated this from other task' \n when action_description like 'marked%as a duplicate of this' then 'marked other task as duplicate of this' \n when action_description like 'marked this a duplicate of%' then 'marked as duplicate' \n when action_description like 'marked this task complete' then 'completed' \n when action_description like 'completed this task' then 'completed' \n when action_description like 'marked incomplete' then 'marked incomplete' \n when action_description like 'marked this task as a milestone' then 'marked as milestone' \n when action_description like 'unmarked this task as a milestone' then 'unmarked as milestone' \n when action_description like 'marked this milestone complete' then 'completed milestone' \n when action_description like 'completed this milestone' then 'completed milestone' \n when action_description like 'attached%' then 'attachment' \n when action_description like 'liked your comment' then 'liked comment' \n when action_description like 'liked this task' then 'liked task' \n when action_description like 'liked your attachment' then 'liked attachment' \n when action_description like 'liked that you completed this task' then 'liked completion' \n when action_description like 'completed the last task you were waiting on%' then 'completed dependency' \n when action_description like 'added feedback to%' then 'added feedback' \n when action_description like 'changed%to%' then 'changed tag' \n when action_description like 'cleared%' then 'cleared tag' \n when action_description like 'comment' then 'comment' \n when action_description like 'have a task due on%' then ''\n else action_description end as action_taken,\n action_description\n \n from split_comments\n\n),\n\n\nfinal as (\n \n select * \n from parse_actions\n\n -- remove actions you don't care about (set to null in the actions dictionary above)\n where action_taken is not null \n\n)\n\n\nselect * from final\n)"}, {"id": "model.asana.int_asana__task_comments", "sql": " __dbt__cte__int_asana__task_comments as (\nwith comments as (\n \n select *\n from __dbt__cte__int_asana__task_story\n where comment_content is not null\n order by target_task_id, created_at asc\n\n),\n\ntask_conversation as (\n\n select\n target_task_id as task_id,\n -- creates a chronologically ordered conversation about the task\n \n string_agg(created_at || ' - ' || created_by_name || ': ' || comment_content, '\\n')\n\n as conversation,\n count(*) as number_of_comments\n\n from comments \n group by 1\n)\n\nselect * from task_conversation\n)"}], "relation_name": null, "column_name": "task_id", "file_key_name": "models.int_asana__task_comments"}, "test.asana.unique_int_asana__task_first_modifier_task_id.59583c6dc2": {"raw_sql": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "test_metadata": {"name": "unique", "kwargs": {"column_name": "task_id", "model": "{{ get_where_subquery(ref('int_asana__task_first_modifier')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["model.asana.int_asana__task_first_modifier"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "dbt-package-testing", "schema": "asana_source_integration_source_dbt_test__audit", "fqn": ["asana", "intermediate", "unique_int_asana__task_first_modifier_task_id"], "unique_id": "test.asana.unique_int_asana__task_first_modifier_task_id.59583c6dc2", "package_name": "asana", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/asana", "path": "unique_int_asana__task_first_modifier_task_id.sql", "original_file_path": "models/intermediate/intermediate_asana.yml", "name": "unique_int_asana__task_first_modifier_task_id", "alias": "unique_int_asana__task_first_modifier_task_id", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["int_asana__task_first_modifier"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/asana/models/intermediate/intermediate_asana.yml/unique_int_asana__task_first_modifier_task_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1663600953.81328, "compiled_sql": "\n \n \n\nwith __dbt__cte__int_asana__task_story as (\nwith story as (\n \n select * \n from `dbt-package-testing`.`asana_source_integration_source_stg_asana`.`stg_asana__story`\n\n),\n\nasana_user as (\n\n select * \n from `dbt-package-testing`.`asana_source_integration_source_stg_asana`.`stg_asana__user`\n),\n\nstory_user as (\n select \n story.*,\n asana_user.user_name as created_by_name\n from story\n join asana_user \n on story.created_by_user_id = asana_user.user_id\n),\n\nsplit_comments as (\n\n select\n story_id,\n created_at,\n created_by_user_id,\n created_by_name,\n target_task_id,\n \n case when event_type = 'comment' then story_content \n else null end as comment_content,\n\n case when event_type = 'system' then story_content \n else 'comment' end as action_description\n \n from story_user\n\n),\n\n\n-- the next CTE uses this dictionary to parse the type of action out of the event descfription\n\n\nparse_actions as (\n select\n story_id,\n target_task_id,\n created_at,\n created_by_user_id,\n created_by_name,\n comment_content,\n case \n when action_description like 'added the name%' then 'added name' \n when action_description like 'changed the name%' then 'changed name' \n when action_description like 'removed the name' then 'removed name' \n when action_description like 'added the description%' then 'added description' \n when action_description like 'changed the description%' then 'changed description' \n when action_description like 'removed the description' then 'removed description' \n when action_description like 'added to%' then 'added to project' \n when action_description like 'removed from%' then 'removed from project' \n when action_description like 'assigned%' then 'assigned' \n when action_description like 'unassigned%' then 'unassigned' \n when action_description like 'changed the due date%' then 'changed due date' \n when action_description like 'changed the start date%due date%' then 'changed due date' \n when action_description like 'changed the start date%' then 'changed start date' \n when action_description like 'removed the due date%' then 'removed due date' \n when action_description like 'removed the date range%' then 'removed due date' \n when action_description like 'removed the start date' then 'removed start date' \n when action_description like 'added subtask%' then 'added subtask' \n when action_description like 'added%collaborator%' then 'added collaborator' \n when action_description like 'moved%' then 'moved to section' \n when action_description like 'duplicated task from%' then 'duplicated this from other task' \n when action_description like 'marked%as a duplicate of this' then 'marked other task as duplicate of this' \n when action_description like 'marked this a duplicate of%' then 'marked as duplicate' \n when action_description like 'marked this task complete' then 'completed' \n when action_description like 'completed this task' then 'completed' \n when action_description like 'marked incomplete' then 'marked incomplete' \n when action_description like 'marked this task as a milestone' then 'marked as milestone' \n when action_description like 'unmarked this task as a milestone' then 'unmarked as milestone' \n when action_description like 'marked this milestone complete' then 'completed milestone' \n when action_description like 'completed this milestone' then 'completed milestone' \n when action_description like 'attached%' then 'attachment' \n when action_description like 'liked your comment' then 'liked comment' \n when action_description like 'liked this task' then 'liked task' \n when action_description like 'liked your attachment' then 'liked attachment' \n when action_description like 'liked that you completed this task' then 'liked completion' \n when action_description like 'completed the last task you were waiting on%' then 'completed dependency' \n when action_description like 'added feedback to%' then 'added feedback' \n when action_description like 'changed%to%' then 'changed tag' \n when action_description like 'cleared%' then 'cleared tag' \n when action_description like 'comment' then 'comment' \n when action_description like 'have a task due on%' then ''\n else action_description end as action_taken,\n action_description\n \n from split_comments\n\n),\n\n\nfinal as (\n \n select * \n from parse_actions\n\n -- remove actions you don't care about (set to null in the actions dictionary above)\n where action_taken is not null \n\n)\n\n\nselect * from final\n), __dbt__cte__int_asana__task_first_modifier as (\nwith story as (\n\n select *\n from __dbt__cte__int_asana__task_story\n where created_by_user_id is not null -- sometimes user id can be null in story. limit to ones with associated users\n),\n\nordered_stories as (\n\n select \n target_task_id,\n created_by_user_id,\n created_by_name,\n created_at,\n row_number() over ( partition by target_task_id order by created_at asc ) as nth_story\n \n from story\n\n),\n\nfirst_modifier as (\n\n select \n target_task_id as task_id,\n created_by_user_id as first_modifier_user_id,\n created_by_name as first_modifier_name\n\n from ordered_stories \n where nth_story = 1\n)\n\nselect *\nfrom first_modifier\n),dbt_test__target as (\n\n select task_id as unique_field\n from __dbt__cte__int_asana__task_first_modifier\n where task_id is not null\n\n)\n\nselect\n unique_field,\n count(*) as n_records\n\nfrom dbt_test__target\ngroup by unique_field\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.asana.int_asana__task_story", "sql": " __dbt__cte__int_asana__task_story as (\nwith story as (\n \n select * \n from `dbt-package-testing`.`asana_source_integration_source_stg_asana`.`stg_asana__story`\n\n),\n\nasana_user as (\n\n select * \n from `dbt-package-testing`.`asana_source_integration_source_stg_asana`.`stg_asana__user`\n),\n\nstory_user as (\n select \n story.*,\n asana_user.user_name as created_by_name\n from story\n join asana_user \n on story.created_by_user_id = asana_user.user_id\n),\n\nsplit_comments as (\n\n select\n story_id,\n created_at,\n created_by_user_id,\n created_by_name,\n target_task_id,\n \n case when event_type = 'comment' then story_content \n else null end as comment_content,\n\n case when event_type = 'system' then story_content \n else 'comment' end as action_description\n \n from story_user\n\n),\n\n\n-- the next CTE uses this dictionary to parse the type of action out of the event descfription\n\n\nparse_actions as (\n select\n story_id,\n target_task_id,\n created_at,\n created_by_user_id,\n created_by_name,\n comment_content,\n case \n when action_description like 'added the name%' then 'added name' \n when action_description like 'changed the name%' then 'changed name' \n when action_description like 'removed the name' then 'removed name' \n when action_description like 'added the description%' then 'added description' \n when action_description like 'changed the description%' then 'changed description' \n when action_description like 'removed the description' then 'removed description' \n when action_description like 'added to%' then 'added to project' \n when action_description like 'removed from%' then 'removed from project' \n when action_description like 'assigned%' then 'assigned' \n when action_description like 'unassigned%' then 'unassigned' \n when action_description like 'changed the due date%' then 'changed due date' \n when action_description like 'changed the start date%due date%' then 'changed due date' \n when action_description like 'changed the start date%' then 'changed start date' \n when action_description like 'removed the due date%' then 'removed due date' \n when action_description like 'removed the date range%' then 'removed due date' \n when action_description like 'removed the start date' then 'removed start date' \n when action_description like 'added subtask%' then 'added subtask' \n when action_description like 'added%collaborator%' then 'added collaborator' \n when action_description like 'moved%' then 'moved to section' \n when action_description like 'duplicated task from%' then 'duplicated this from other task' \n when action_description like 'marked%as a duplicate of this' then 'marked other task as duplicate of this' \n when action_description like 'marked this a duplicate of%' then 'marked as duplicate' \n when action_description like 'marked this task complete' then 'completed' \n when action_description like 'completed this task' then 'completed' \n when action_description like 'marked incomplete' then 'marked incomplete' \n when action_description like 'marked this task as a milestone' then 'marked as milestone' \n when action_description like 'unmarked this task as a milestone' then 'unmarked as milestone' \n when action_description like 'marked this milestone complete' then 'completed milestone' \n when action_description like 'completed this milestone' then 'completed milestone' \n when action_description like 'attached%' then 'attachment' \n when action_description like 'liked your comment' then 'liked comment' \n when action_description like 'liked this task' then 'liked task' \n when action_description like 'liked your attachment' then 'liked attachment' \n when action_description like 'liked that you completed this task' then 'liked completion' \n when action_description like 'completed the last task you were waiting on%' then 'completed dependency' \n when action_description like 'added feedback to%' then 'added feedback' \n when action_description like 'changed%to%' then 'changed tag' \n when action_description like 'cleared%' then 'cleared tag' \n when action_description like 'comment' then 'comment' \n when action_description like 'have a task due on%' then ''\n else action_description end as action_taken,\n action_description\n \n from split_comments\n\n),\n\n\nfinal as (\n \n select * \n from parse_actions\n\n -- remove actions you don't care about (set to null in the actions dictionary above)\n where action_taken is not null \n\n)\n\n\nselect * from final\n)"}, {"id": "model.asana.int_asana__task_first_modifier", "sql": " __dbt__cte__int_asana__task_first_modifier as (\nwith story as (\n\n select *\n from __dbt__cte__int_asana__task_story\n where created_by_user_id is not null -- sometimes user id can be null in story. limit to ones with associated users\n),\n\nordered_stories as (\n\n select \n target_task_id,\n created_by_user_id,\n created_by_name,\n created_at,\n row_number() over ( partition by target_task_id order by created_at asc ) as nth_story\n \n from story\n\n),\n\nfirst_modifier as (\n\n select \n target_task_id as task_id,\n created_by_user_id as first_modifier_user_id,\n created_by_name as first_modifier_name\n\n from ordered_stories \n where nth_story = 1\n)\n\nselect *\nfrom first_modifier\n)"}], "relation_name": null, "column_name": "task_id", "file_key_name": "models.int_asana__task_first_modifier"}, "test.asana.not_null_int_asana__task_first_modifier_task_id.495738ff52": {"raw_sql": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "task_id", "model": "{{ get_where_subquery(ref('int_asana__task_first_modifier')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.asana.int_asana__task_first_modifier"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "dbt-package-testing", "schema": "asana_source_integration_source_dbt_test__audit", "fqn": ["asana", "intermediate", "not_null_int_asana__task_first_modifier_task_id"], "unique_id": "test.asana.not_null_int_asana__task_first_modifier_task_id.495738ff52", "package_name": "asana", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/asana", "path": "not_null_int_asana__task_first_modifier_task_id.sql", "original_file_path": "models/intermediate/intermediate_asana.yml", "name": "not_null_int_asana__task_first_modifier_task_id", "alias": "not_null_int_asana__task_first_modifier_task_id", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["int_asana__task_first_modifier"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/asana/models/intermediate/intermediate_asana.yml/not_null_int_asana__task_first_modifier_task_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1663600953.8142028, "compiled_sql": "\n \n \n\n\n\nwith __dbt__cte__int_asana__task_story as (\nwith story as (\n \n select * \n from `dbt-package-testing`.`asana_source_integration_source_stg_asana`.`stg_asana__story`\n\n),\n\nasana_user as (\n\n select * \n from `dbt-package-testing`.`asana_source_integration_source_stg_asana`.`stg_asana__user`\n),\n\nstory_user as (\n select \n story.*,\n asana_user.user_name as created_by_name\n from story\n join asana_user \n on story.created_by_user_id = asana_user.user_id\n),\n\nsplit_comments as (\n\n select\n story_id,\n created_at,\n created_by_user_id,\n created_by_name,\n target_task_id,\n \n case when event_type = 'comment' then story_content \n else null end as comment_content,\n\n case when event_type = 'system' then story_content \n else 'comment' end as action_description\n \n from story_user\n\n),\n\n\n-- the next CTE uses this dictionary to parse the type of action out of the event descfription\n\n\nparse_actions as (\n select\n story_id,\n target_task_id,\n created_at,\n created_by_user_id,\n created_by_name,\n comment_content,\n case \n when action_description like 'added the name%' then 'added name' \n when action_description like 'changed the name%' then 'changed name' \n when action_description like 'removed the name' then 'removed name' \n when action_description like 'added the description%' then 'added description' \n when action_description like 'changed the description%' then 'changed description' \n when action_description like 'removed the description' then 'removed description' \n when action_description like 'added to%' then 'added to project' \n when action_description like 'removed from%' then 'removed from project' \n when action_description like 'assigned%' then 'assigned' \n when action_description like 'unassigned%' then 'unassigned' \n when action_description like 'changed the due date%' then 'changed due date' \n when action_description like 'changed the start date%due date%' then 'changed due date' \n when action_description like 'changed the start date%' then 'changed start date' \n when action_description like 'removed the due date%' then 'removed due date' \n when action_description like 'removed the date range%' then 'removed due date' \n when action_description like 'removed the start date' then 'removed start date' \n when action_description like 'added subtask%' then 'added subtask' \n when action_description like 'added%collaborator%' then 'added collaborator' \n when action_description like 'moved%' then 'moved to section' \n when action_description like 'duplicated task from%' then 'duplicated this from other task' \n when action_description like 'marked%as a duplicate of this' then 'marked other task as duplicate of this' \n when action_description like 'marked this a duplicate of%' then 'marked as duplicate' \n when action_description like 'marked this task complete' then 'completed' \n when action_description like 'completed this task' then 'completed' \n when action_description like 'marked incomplete' then 'marked incomplete' \n when action_description like 'marked this task as a milestone' then 'marked as milestone' \n when action_description like 'unmarked this task as a milestone' then 'unmarked as milestone' \n when action_description like 'marked this milestone complete' then 'completed milestone' \n when action_description like 'completed this milestone' then 'completed milestone' \n when action_description like 'attached%' then 'attachment' \n when action_description like 'liked your comment' then 'liked comment' \n when action_description like 'liked this task' then 'liked task' \n when action_description like 'liked your attachment' then 'liked attachment' \n when action_description like 'liked that you completed this task' then 'liked completion' \n when action_description like 'completed the last task you were waiting on%' then 'completed dependency' \n when action_description like 'added feedback to%' then 'added feedback' \n when action_description like 'changed%to%' then 'changed tag' \n when action_description like 'cleared%' then 'cleared tag' \n when action_description like 'comment' then 'comment' \n when action_description like 'have a task due on%' then ''\n else action_description end as action_taken,\n action_description\n \n from split_comments\n\n),\n\n\nfinal as (\n \n select * \n from parse_actions\n\n -- remove actions you don't care about (set to null in the actions dictionary above)\n where action_taken is not null \n\n)\n\n\nselect * from final\n), __dbt__cte__int_asana__task_first_modifier as (\nwith story as (\n\n select *\n from __dbt__cte__int_asana__task_story\n where created_by_user_id is not null -- sometimes user id can be null in story. limit to ones with associated users\n),\n\nordered_stories as (\n\n select \n target_task_id,\n created_by_user_id,\n created_by_name,\n created_at,\n row_number() over ( partition by target_task_id order by created_at asc ) as nth_story\n \n from story\n\n),\n\nfirst_modifier as (\n\n select \n target_task_id as task_id,\n created_by_user_id as first_modifier_user_id,\n created_by_name as first_modifier_name\n\n from ordered_stories \n where nth_story = 1\n)\n\nselect *\nfrom first_modifier\n)select task_id\nfrom __dbt__cte__int_asana__task_first_modifier\nwhere task_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.asana.int_asana__task_story", "sql": " __dbt__cte__int_asana__task_story as (\nwith story as (\n \n select * \n from `dbt-package-testing`.`asana_source_integration_source_stg_asana`.`stg_asana__story`\n\n),\n\nasana_user as (\n\n select * \n from `dbt-package-testing`.`asana_source_integration_source_stg_asana`.`stg_asana__user`\n),\n\nstory_user as (\n select \n story.*,\n asana_user.user_name as created_by_name\n from story\n join asana_user \n on story.created_by_user_id = asana_user.user_id\n),\n\nsplit_comments as (\n\n select\n story_id,\n created_at,\n created_by_user_id,\n created_by_name,\n target_task_id,\n \n case when event_type = 'comment' then story_content \n else null end as comment_content,\n\n case when event_type = 'system' then story_content \n else 'comment' end as action_description\n \n from story_user\n\n),\n\n\n-- the next CTE uses this dictionary to parse the type of action out of the event descfription\n\n\nparse_actions as (\n select\n story_id,\n target_task_id,\n created_at,\n created_by_user_id,\n created_by_name,\n comment_content,\n case \n when action_description like 'added the name%' then 'added name' \n when action_description like 'changed the name%' then 'changed name' \n when action_description like 'removed the name' then 'removed name' \n when action_description like 'added the description%' then 'added description' \n when action_description like 'changed the description%' then 'changed description' \n when action_description like 'removed the description' then 'removed description' \n when action_description like 'added to%' then 'added to project' \n when action_description like 'removed from%' then 'removed from project' \n when action_description like 'assigned%' then 'assigned' \n when action_description like 'unassigned%' then 'unassigned' \n when action_description like 'changed the due date%' then 'changed due date' \n when action_description like 'changed the start date%due date%' then 'changed due date' \n when action_description like 'changed the start date%' then 'changed start date' \n when action_description like 'removed the due date%' then 'removed due date' \n when action_description like 'removed the date range%' then 'removed due date' \n when action_description like 'removed the start date' then 'removed start date' \n when action_description like 'added subtask%' then 'added subtask' \n when action_description like 'added%collaborator%' then 'added collaborator' \n when action_description like 'moved%' then 'moved to section' \n when action_description like 'duplicated task from%' then 'duplicated this from other task' \n when action_description like 'marked%as a duplicate of this' then 'marked other task as duplicate of this' \n when action_description like 'marked this a duplicate of%' then 'marked as duplicate' \n when action_description like 'marked this task complete' then 'completed' \n when action_description like 'completed this task' then 'completed' \n when action_description like 'marked incomplete' then 'marked incomplete' \n when action_description like 'marked this task as a milestone' then 'marked as milestone' \n when action_description like 'unmarked this task as a milestone' then 'unmarked as milestone' \n when action_description like 'marked this milestone complete' then 'completed milestone' \n when action_description like 'completed this milestone' then 'completed milestone' \n when action_description like 'attached%' then 'attachment' \n when action_description like 'liked your comment' then 'liked comment' \n when action_description like 'liked this task' then 'liked task' \n when action_description like 'liked your attachment' then 'liked attachment' \n when action_description like 'liked that you completed this task' then 'liked completion' \n when action_description like 'completed the last task you were waiting on%' then 'completed dependency' \n when action_description like 'added feedback to%' then 'added feedback' \n when action_description like 'changed%to%' then 'changed tag' \n when action_description like 'cleared%' then 'cleared tag' \n when action_description like 'comment' then 'comment' \n when action_description like 'have a task due on%' then ''\n else action_description end as action_taken,\n action_description\n \n from split_comments\n\n),\n\n\nfinal as (\n \n select * \n from parse_actions\n\n -- remove actions you don't care about (set to null in the actions dictionary above)\n where action_taken is not null \n\n)\n\n\nselect * from final\n)"}, {"id": "model.asana.int_asana__task_first_modifier", "sql": " __dbt__cte__int_asana__task_first_modifier as (\nwith story as (\n\n select *\n from __dbt__cte__int_asana__task_story\n where created_by_user_id is not null -- sometimes user id can be null in story. limit to ones with associated users\n),\n\nordered_stories as (\n\n select \n target_task_id,\n created_by_user_id,\n created_by_name,\n created_at,\n row_number() over ( partition by target_task_id order by created_at asc ) as nth_story\n \n from story\n\n),\n\nfirst_modifier as (\n\n select \n target_task_id as task_id,\n created_by_user_id as first_modifier_user_id,\n created_by_name as first_modifier_name\n\n from ordered_stories \n where nth_story = 1\n)\n\nselect *\nfrom first_modifier\n)"}], "relation_name": null, "column_name": "task_id", "file_key_name": "models.int_asana__task_first_modifier"}, "test.asana.unique_int_asana__task_followers_task_id.eeb3667df9": {"raw_sql": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "test_metadata": {"name": "unique", "kwargs": {"column_name": "task_id", "model": "{{ get_where_subquery(ref('int_asana__task_followers')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["model.asana.int_asana__task_followers"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "dbt-package-testing", "schema": "asana_source_integration_source_dbt_test__audit", "fqn": ["asana", "intermediate", "unique_int_asana__task_followers_task_id"], "unique_id": "test.asana.unique_int_asana__task_followers_task_id.eeb3667df9", "package_name": "asana", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/asana", "path": "unique_int_asana__task_followers_task_id.sql", "original_file_path": "models/intermediate/intermediate_asana.yml", "name": "unique_int_asana__task_followers_task_id", "alias": "unique_int_asana__task_followers_task_id", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["int_asana__task_followers"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/asana/models/intermediate/intermediate_asana.yml/unique_int_asana__task_followers_task_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1663600953.815271, "compiled_sql": "\n \n \n\nwith __dbt__cte__int_asana__task_followers as (\nwith task_follower as (\n \n select *\n from `dbt-package-testing`.`asana_source_integration_source_stg_asana`.`stg_asana__task_follower`\n\n),\n\nasana_user as (\n\n select * \n from `dbt-package-testing`.`asana_source_integration_source_stg_asana`.`stg_asana__user`\n\n),\n\nagg_followers as (\n\n select\n task_follower.task_id,\n \n string_agg(asana_user.user_name, ', ')\n\n as followers,\n count(*) as number_of_followers\n from task_follower \n join asana_user \n on asana_user.user_id = task_follower.user_id\n group by 1\n \n)\n\nselect * from agg_followers\n),dbt_test__target as (\n\n select task_id as unique_field\n from __dbt__cte__int_asana__task_followers\n where task_id is not null\n\n)\n\nselect\n unique_field,\n count(*) as n_records\n\nfrom dbt_test__target\ngroup by unique_field\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.asana.int_asana__task_followers", "sql": " __dbt__cte__int_asana__task_followers as (\nwith task_follower as (\n \n select *\n from `dbt-package-testing`.`asana_source_integration_source_stg_asana`.`stg_asana__task_follower`\n\n),\n\nasana_user as (\n\n select * \n from `dbt-package-testing`.`asana_source_integration_source_stg_asana`.`stg_asana__user`\n\n),\n\nagg_followers as (\n\n select\n task_follower.task_id,\n \n string_agg(asana_user.user_name, ', ')\n\n as followers,\n count(*) as number_of_followers\n from task_follower \n join asana_user \n on asana_user.user_id = task_follower.user_id\n group by 1\n \n)\n\nselect * from agg_followers\n)"}], "relation_name": null, "column_name": "task_id", "file_key_name": "models.int_asana__task_followers"}, "test.asana.not_null_int_asana__task_followers_task_id.6791bf2573": {"raw_sql": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "task_id", "model": "{{ get_where_subquery(ref('int_asana__task_followers')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.asana.int_asana__task_followers"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "dbt-package-testing", "schema": "asana_source_integration_source_dbt_test__audit", "fqn": ["asana", "intermediate", "not_null_int_asana__task_followers_task_id"], "unique_id": "test.asana.not_null_int_asana__task_followers_task_id.6791bf2573", "package_name": "asana", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/asana", "path": "not_null_int_asana__task_followers_task_id.sql", "original_file_path": "models/intermediate/intermediate_asana.yml", "name": "not_null_int_asana__task_followers_task_id", "alias": "not_null_int_asana__task_followers_task_id", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["int_asana__task_followers"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/asana/models/intermediate/intermediate_asana.yml/not_null_int_asana__task_followers_task_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1663600953.81619, "compiled_sql": "\n \n \n\n\n\nwith __dbt__cte__int_asana__task_followers as (\nwith task_follower as (\n \n select *\n from `dbt-package-testing`.`asana_source_integration_source_stg_asana`.`stg_asana__task_follower`\n\n),\n\nasana_user as (\n\n select * \n from `dbt-package-testing`.`asana_source_integration_source_stg_asana`.`stg_asana__user`\n\n),\n\nagg_followers as (\n\n select\n task_follower.task_id,\n \n string_agg(asana_user.user_name, ', ')\n\n as followers,\n count(*) as number_of_followers\n from task_follower \n join asana_user \n on asana_user.user_id = task_follower.user_id\n group by 1\n \n)\n\nselect * from agg_followers\n)select task_id\nfrom __dbt__cte__int_asana__task_followers\nwhere task_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.asana.int_asana__task_followers", "sql": " __dbt__cte__int_asana__task_followers as (\nwith task_follower as (\n \n select *\n from `dbt-package-testing`.`asana_source_integration_source_stg_asana`.`stg_asana__task_follower`\n\n),\n\nasana_user as (\n\n select * \n from `dbt-package-testing`.`asana_source_integration_source_stg_asana`.`stg_asana__user`\n\n),\n\nagg_followers as (\n\n select\n task_follower.task_id,\n \n string_agg(asana_user.user_name, ', ')\n\n as followers,\n count(*) as number_of_followers\n from task_follower \n join asana_user \n on asana_user.user_id = task_follower.user_id\n group by 1\n \n)\n\nselect * from agg_followers\n)"}], "relation_name": null, "column_name": "task_id", "file_key_name": "models.int_asana__task_followers"}, "test.asana.unique_int_asana__task_open_length_task_id.f26c49b044": {"raw_sql": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "test_metadata": {"name": "unique", "kwargs": {"column_name": "task_id", "model": "{{ get_where_subquery(ref('int_asana__task_open_length')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["model.asana.int_asana__task_open_length"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "dbt-package-testing", "schema": "asana_source_integration_source_dbt_test__audit", "fqn": ["asana", "intermediate", "unique_int_asana__task_open_length_task_id"], "unique_id": "test.asana.unique_int_asana__task_open_length_task_id.f26c49b044", "package_name": "asana", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/asana", "path": "unique_int_asana__task_open_length_task_id.sql", "original_file_path": "models/intermediate/intermediate_asana.yml", "name": "unique_int_asana__task_open_length_task_id", "alias": "unique_int_asana__task_open_length_task_id", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["int_asana__task_open_length"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/asana/models/intermediate/intermediate_asana.yml/unique_int_asana__task_open_length_task_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1663600953.8171039, "compiled_sql": "\n \n \n\nwith __dbt__cte__int_asana__task_story as (\nwith story as (\n \n select * \n from `dbt-package-testing`.`asana_source_integration_source_stg_asana`.`stg_asana__story`\n\n),\n\nasana_user as (\n\n select * \n from `dbt-package-testing`.`asana_source_integration_source_stg_asana`.`stg_asana__user`\n),\n\nstory_user as (\n select \n story.*,\n asana_user.user_name as created_by_name\n from story\n join asana_user \n on story.created_by_user_id = asana_user.user_id\n),\n\nsplit_comments as (\n\n select\n story_id,\n created_at,\n created_by_user_id,\n created_by_name,\n target_task_id,\n \n case when event_type = 'comment' then story_content \n else null end as comment_content,\n\n case when event_type = 'system' then story_content \n else 'comment' end as action_description\n \n from story_user\n\n),\n\n\n-- the next CTE uses this dictionary to parse the type of action out of the event descfription\n\n\nparse_actions as (\n select\n story_id,\n target_task_id,\n created_at,\n created_by_user_id,\n created_by_name,\n comment_content,\n case \n when action_description like 'added the name%' then 'added name' \n when action_description like 'changed the name%' then 'changed name' \n when action_description like 'removed the name' then 'removed name' \n when action_description like 'added the description%' then 'added description' \n when action_description like 'changed the description%' then 'changed description' \n when action_description like 'removed the description' then 'removed description' \n when action_description like 'added to%' then 'added to project' \n when action_description like 'removed from%' then 'removed from project' \n when action_description like 'assigned%' then 'assigned' \n when action_description like 'unassigned%' then 'unassigned' \n when action_description like 'changed the due date%' then 'changed due date' \n when action_description like 'changed the start date%due date%' then 'changed due date' \n when action_description like 'changed the start date%' then 'changed start date' \n when action_description like 'removed the due date%' then 'removed due date' \n when action_description like 'removed the date range%' then 'removed due date' \n when action_description like 'removed the start date' then 'removed start date' \n when action_description like 'added subtask%' then 'added subtask' \n when action_description like 'added%collaborator%' then 'added collaborator' \n when action_description like 'moved%' then 'moved to section' \n when action_description like 'duplicated task from%' then 'duplicated this from other task' \n when action_description like 'marked%as a duplicate of this' then 'marked other task as duplicate of this' \n when action_description like 'marked this a duplicate of%' then 'marked as duplicate' \n when action_description like 'marked this task complete' then 'completed' \n when action_description like 'completed this task' then 'completed' \n when action_description like 'marked incomplete' then 'marked incomplete' \n when action_description like 'marked this task as a milestone' then 'marked as milestone' \n when action_description like 'unmarked this task as a milestone' then 'unmarked as milestone' \n when action_description like 'marked this milestone complete' then 'completed milestone' \n when action_description like 'completed this milestone' then 'completed milestone' \n when action_description like 'attached%' then 'attachment' \n when action_description like 'liked your comment' then 'liked comment' \n when action_description like 'liked this task' then 'liked task' \n when action_description like 'liked your attachment' then 'liked attachment' \n when action_description like 'liked that you completed this task' then 'liked completion' \n when action_description like 'completed the last task you were waiting on%' then 'completed dependency' \n when action_description like 'added feedback to%' then 'added feedback' \n when action_description like 'changed%to%' then 'changed tag' \n when action_description like 'cleared%' then 'cleared tag' \n when action_description like 'comment' then 'comment' \n when action_description like 'have a task due on%' then ''\n else action_description end as action_taken,\n action_description\n \n from split_comments\n\n),\n\n\nfinal as (\n \n select * \n from parse_actions\n\n -- remove actions you don't care about (set to null in the actions dictionary above)\n where action_taken is not null \n\n)\n\n\nselect * from final\n), __dbt__cte__int_asana__task_open_length as (\nwith task as (\n \n select *\n from `dbt-package-testing`.`asana_source_integration_source_stg_asana`.`stg_asana__task`\n\n),\n\nstory as (\n\n select * \n from __dbt__cte__int_asana__task_story\n\n),\n\nassignments as (\n \n select \n target_task_id as task_id,\n min(created_at) as first_assigned_at,\n max(created_at) as last_assigned_at -- current assignment\n\n from story\n where action_taken = 'assigned'\n\n group by 1\n\n),\n\n\nopen_assigned_length as (\n\n \n\n select\n task.task_id,\n task.is_completed,\n task.completed_at,\n task.assignee_user_id is not null as is_currently_assigned,\n assignments.task_id is not null as has_been_assigned,\n assignments.last_assigned_at as last_assigned_at,\n assignments.first_assigned_at as first_assigned_at,\n datetime_diff(\n cast(\n current_timestamp\n as datetime),\n cast(task.created_at as datetime),\n day\n ) as days_open,\n\n -- if the task is currently assigned, this is the time it has been assigned to this current user.\n datetime_diff(\n cast(\n current_timestamp\n as datetime),\n cast(assignments.last_assigned_at as datetime),\n day\n ) as days_since_last_assignment,\n\n datetime_diff(\n cast(\n current_timestamp\n as datetime),\n cast(assignments.first_assigned_at as datetime),\n day\n ) as days_since_first_assignment\n \n\n from task\n left join assignments \n on task.task_id = assignments.task_id\n\n)\n\n\nselect * from open_assigned_length\n),dbt_test__target as (\n\n select task_id as unique_field\n from __dbt__cte__int_asana__task_open_length\n where task_id is not null\n\n)\n\nselect\n unique_field,\n count(*) as n_records\n\nfrom dbt_test__target\ngroup by unique_field\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.asana.int_asana__task_story", "sql": " __dbt__cte__int_asana__task_story as (\nwith story as (\n \n select * \n from `dbt-package-testing`.`asana_source_integration_source_stg_asana`.`stg_asana__story`\n\n),\n\nasana_user as (\n\n select * \n from `dbt-package-testing`.`asana_source_integration_source_stg_asana`.`stg_asana__user`\n),\n\nstory_user as (\n select \n story.*,\n asana_user.user_name as created_by_name\n from story\n join asana_user \n on story.created_by_user_id = asana_user.user_id\n),\n\nsplit_comments as (\n\n select\n story_id,\n created_at,\n created_by_user_id,\n created_by_name,\n target_task_id,\n \n case when event_type = 'comment' then story_content \n else null end as comment_content,\n\n case when event_type = 'system' then story_content \n else 'comment' end as action_description\n \n from story_user\n\n),\n\n\n-- the next CTE uses this dictionary to parse the type of action out of the event descfription\n\n\nparse_actions as (\n select\n story_id,\n target_task_id,\n created_at,\n created_by_user_id,\n created_by_name,\n comment_content,\n case \n when action_description like 'added the name%' then 'added name' \n when action_description like 'changed the name%' then 'changed name' \n when action_description like 'removed the name' then 'removed name' \n when action_description like 'added the description%' then 'added description' \n when action_description like 'changed the description%' then 'changed description' \n when action_description like 'removed the description' then 'removed description' \n when action_description like 'added to%' then 'added to project' \n when action_description like 'removed from%' then 'removed from project' \n when action_description like 'assigned%' then 'assigned' \n when action_description like 'unassigned%' then 'unassigned' \n when action_description like 'changed the due date%' then 'changed due date' \n when action_description like 'changed the start date%due date%' then 'changed due date' \n when action_description like 'changed the start date%' then 'changed start date' \n when action_description like 'removed the due date%' then 'removed due date' \n when action_description like 'removed the date range%' then 'removed due date' \n when action_description like 'removed the start date' then 'removed start date' \n when action_description like 'added subtask%' then 'added subtask' \n when action_description like 'added%collaborator%' then 'added collaborator' \n when action_description like 'moved%' then 'moved to section' \n when action_description like 'duplicated task from%' then 'duplicated this from other task' \n when action_description like 'marked%as a duplicate of this' then 'marked other task as duplicate of this' \n when action_description like 'marked this a duplicate of%' then 'marked as duplicate' \n when action_description like 'marked this task complete' then 'completed' \n when action_description like 'completed this task' then 'completed' \n when action_description like 'marked incomplete' then 'marked incomplete' \n when action_description like 'marked this task as a milestone' then 'marked as milestone' \n when action_description like 'unmarked this task as a milestone' then 'unmarked as milestone' \n when action_description like 'marked this milestone complete' then 'completed milestone' \n when action_description like 'completed this milestone' then 'completed milestone' \n when action_description like 'attached%' then 'attachment' \n when action_description like 'liked your comment' then 'liked comment' \n when action_description like 'liked this task' then 'liked task' \n when action_description like 'liked your attachment' then 'liked attachment' \n when action_description like 'liked that you completed this task' then 'liked completion' \n when action_description like 'completed the last task you were waiting on%' then 'completed dependency' \n when action_description like 'added feedback to%' then 'added feedback' \n when action_description like 'changed%to%' then 'changed tag' \n when action_description like 'cleared%' then 'cleared tag' \n when action_description like 'comment' then 'comment' \n when action_description like 'have a task due on%' then ''\n else action_description end as action_taken,\n action_description\n \n from split_comments\n\n),\n\n\nfinal as (\n \n select * \n from parse_actions\n\n -- remove actions you don't care about (set to null in the actions dictionary above)\n where action_taken is not null \n\n)\n\n\nselect * from final\n)"}, {"id": "model.asana.int_asana__task_open_length", "sql": " __dbt__cte__int_asana__task_open_length as (\nwith task as (\n \n select *\n from `dbt-package-testing`.`asana_source_integration_source_stg_asana`.`stg_asana__task`\n\n),\n\nstory as (\n\n select * \n from __dbt__cte__int_asana__task_story\n\n),\n\nassignments as (\n \n select \n target_task_id as task_id,\n min(created_at) as first_assigned_at,\n max(created_at) as last_assigned_at -- current assignment\n\n from story\n where action_taken = 'assigned'\n\n group by 1\n\n),\n\n\nopen_assigned_length as (\n\n \n\n select\n task.task_id,\n task.is_completed,\n task.completed_at,\n task.assignee_user_id is not null as is_currently_assigned,\n assignments.task_id is not null as has_been_assigned,\n assignments.last_assigned_at as last_assigned_at,\n assignments.first_assigned_at as first_assigned_at,\n datetime_diff(\n cast(\n current_timestamp\n as datetime),\n cast(task.created_at as datetime),\n day\n ) as days_open,\n\n -- if the task is currently assigned, this is the time it has been assigned to this current user.\n datetime_diff(\n cast(\n current_timestamp\n as datetime),\n cast(assignments.last_assigned_at as datetime),\n day\n ) as days_since_last_assignment,\n\n datetime_diff(\n cast(\n current_timestamp\n as datetime),\n cast(assignments.first_assigned_at as datetime),\n day\n ) as days_since_first_assignment\n \n\n from task\n left join assignments \n on task.task_id = assignments.task_id\n\n)\n\n\nselect * from open_assigned_length\n)"}], "relation_name": null, "column_name": "task_id", "file_key_name": "models.int_asana__task_open_length"}, "test.asana.not_null_int_asana__task_open_length_task_id.23bb23b2e9": {"raw_sql": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "task_id", "model": "{{ get_where_subquery(ref('int_asana__task_open_length')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.asana.int_asana__task_open_length"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "dbt-package-testing", "schema": "asana_source_integration_source_dbt_test__audit", "fqn": ["asana", "intermediate", "not_null_int_asana__task_open_length_task_id"], "unique_id": "test.asana.not_null_int_asana__task_open_length_task_id.23bb23b2e9", "package_name": "asana", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/asana", "path": "not_null_int_asana__task_open_length_task_id.sql", "original_file_path": "models/intermediate/intermediate_asana.yml", "name": "not_null_int_asana__task_open_length_task_id", "alias": "not_null_int_asana__task_open_length_task_id", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["int_asana__task_open_length"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/asana/models/intermediate/intermediate_asana.yml/not_null_int_asana__task_open_length_task_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1663600953.8181472, "compiled_sql": "\n \n \n\n\n\nwith __dbt__cte__int_asana__task_story as (\nwith story as (\n \n select * \n from `dbt-package-testing`.`asana_source_integration_source_stg_asana`.`stg_asana__story`\n\n),\n\nasana_user as (\n\n select * \n from `dbt-package-testing`.`asana_source_integration_source_stg_asana`.`stg_asana__user`\n),\n\nstory_user as (\n select \n story.*,\n asana_user.user_name as created_by_name\n from story\n join asana_user \n on story.created_by_user_id = asana_user.user_id\n),\n\nsplit_comments as (\n\n select\n story_id,\n created_at,\n created_by_user_id,\n created_by_name,\n target_task_id,\n \n case when event_type = 'comment' then story_content \n else null end as comment_content,\n\n case when event_type = 'system' then story_content \n else 'comment' end as action_description\n \n from story_user\n\n),\n\n\n-- the next CTE uses this dictionary to parse the type of action out of the event descfription\n\n\nparse_actions as (\n select\n story_id,\n target_task_id,\n created_at,\n created_by_user_id,\n created_by_name,\n comment_content,\n case \n when action_description like 'added the name%' then 'added name' \n when action_description like 'changed the name%' then 'changed name' \n when action_description like 'removed the name' then 'removed name' \n when action_description like 'added the description%' then 'added description' \n when action_description like 'changed the description%' then 'changed description' \n when action_description like 'removed the description' then 'removed description' \n when action_description like 'added to%' then 'added to project' \n when action_description like 'removed from%' then 'removed from project' \n when action_description like 'assigned%' then 'assigned' \n when action_description like 'unassigned%' then 'unassigned' \n when action_description like 'changed the due date%' then 'changed due date' \n when action_description like 'changed the start date%due date%' then 'changed due date' \n when action_description like 'changed the start date%' then 'changed start date' \n when action_description like 'removed the due date%' then 'removed due date' \n when action_description like 'removed the date range%' then 'removed due date' \n when action_description like 'removed the start date' then 'removed start date' \n when action_description like 'added subtask%' then 'added subtask' \n when action_description like 'added%collaborator%' then 'added collaborator' \n when action_description like 'moved%' then 'moved to section' \n when action_description like 'duplicated task from%' then 'duplicated this from other task' \n when action_description like 'marked%as a duplicate of this' then 'marked other task as duplicate of this' \n when action_description like 'marked this a duplicate of%' then 'marked as duplicate' \n when action_description like 'marked this task complete' then 'completed' \n when action_description like 'completed this task' then 'completed' \n when action_description like 'marked incomplete' then 'marked incomplete' \n when action_description like 'marked this task as a milestone' then 'marked as milestone' \n when action_description like 'unmarked this task as a milestone' then 'unmarked as milestone' \n when action_description like 'marked this milestone complete' then 'completed milestone' \n when action_description like 'completed this milestone' then 'completed milestone' \n when action_description like 'attached%' then 'attachment' \n when action_description like 'liked your comment' then 'liked comment' \n when action_description like 'liked this task' then 'liked task' \n when action_description like 'liked your attachment' then 'liked attachment' \n when action_description like 'liked that you completed this task' then 'liked completion' \n when action_description like 'completed the last task you were waiting on%' then 'completed dependency' \n when action_description like 'added feedback to%' then 'added feedback' \n when action_description like 'changed%to%' then 'changed tag' \n when action_description like 'cleared%' then 'cleared tag' \n when action_description like 'comment' then 'comment' \n when action_description like 'have a task due on%' then ''\n else action_description end as action_taken,\n action_description\n \n from split_comments\n\n),\n\n\nfinal as (\n \n select * \n from parse_actions\n\n -- remove actions you don't care about (set to null in the actions dictionary above)\n where action_taken is not null \n\n)\n\n\nselect * from final\n), __dbt__cte__int_asana__task_open_length as (\nwith task as (\n \n select *\n from `dbt-package-testing`.`asana_source_integration_source_stg_asana`.`stg_asana__task`\n\n),\n\nstory as (\n\n select * \n from __dbt__cte__int_asana__task_story\n\n),\n\nassignments as (\n \n select \n target_task_id as task_id,\n min(created_at) as first_assigned_at,\n max(created_at) as last_assigned_at -- current assignment\n\n from story\n where action_taken = 'assigned'\n\n group by 1\n\n),\n\n\nopen_assigned_length as (\n\n \n\n select\n task.task_id,\n task.is_completed,\n task.completed_at,\n task.assignee_user_id is not null as is_currently_assigned,\n assignments.task_id is not null as has_been_assigned,\n assignments.last_assigned_at as last_assigned_at,\n assignments.first_assigned_at as first_assigned_at,\n datetime_diff(\n cast(\n current_timestamp\n as datetime),\n cast(task.created_at as datetime),\n day\n ) as days_open,\n\n -- if the task is currently assigned, this is the time it has been assigned to this current user.\n datetime_diff(\n cast(\n current_timestamp\n as datetime),\n cast(assignments.last_assigned_at as datetime),\n day\n ) as days_since_last_assignment,\n\n datetime_diff(\n cast(\n current_timestamp\n as datetime),\n cast(assignments.first_assigned_at as datetime),\n day\n ) as days_since_first_assignment\n \n\n from task\n left join assignments \n on task.task_id = assignments.task_id\n\n)\n\n\nselect * from open_assigned_length\n)select task_id\nfrom __dbt__cte__int_asana__task_open_length\nwhere task_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.asana.int_asana__task_story", "sql": " __dbt__cte__int_asana__task_story as (\nwith story as (\n \n select * \n from `dbt-package-testing`.`asana_source_integration_source_stg_asana`.`stg_asana__story`\n\n),\n\nasana_user as (\n\n select * \n from `dbt-package-testing`.`asana_source_integration_source_stg_asana`.`stg_asana__user`\n),\n\nstory_user as (\n select \n story.*,\n asana_user.user_name as created_by_name\n from story\n join asana_user \n on story.created_by_user_id = asana_user.user_id\n),\n\nsplit_comments as (\n\n select\n story_id,\n created_at,\n created_by_user_id,\n created_by_name,\n target_task_id,\n \n case when event_type = 'comment' then story_content \n else null end as comment_content,\n\n case when event_type = 'system' then story_content \n else 'comment' end as action_description\n \n from story_user\n\n),\n\n\n-- the next CTE uses this dictionary to parse the type of action out of the event descfription\n\n\nparse_actions as (\n select\n story_id,\n target_task_id,\n created_at,\n created_by_user_id,\n created_by_name,\n comment_content,\n case \n when action_description like 'added the name%' then 'added name' \n when action_description like 'changed the name%' then 'changed name' \n when action_description like 'removed the name' then 'removed name' \n when action_description like 'added the description%' then 'added description' \n when action_description like 'changed the description%' then 'changed description' \n when action_description like 'removed the description' then 'removed description' \n when action_description like 'added to%' then 'added to project' \n when action_description like 'removed from%' then 'removed from project' \n when action_description like 'assigned%' then 'assigned' \n when action_description like 'unassigned%' then 'unassigned' \n when action_description like 'changed the due date%' then 'changed due date' \n when action_description like 'changed the start date%due date%' then 'changed due date' \n when action_description like 'changed the start date%' then 'changed start date' \n when action_description like 'removed the due date%' then 'removed due date' \n when action_description like 'removed the date range%' then 'removed due date' \n when action_description like 'removed the start date' then 'removed start date' \n when action_description like 'added subtask%' then 'added subtask' \n when action_description like 'added%collaborator%' then 'added collaborator' \n when action_description like 'moved%' then 'moved to section' \n when action_description like 'duplicated task from%' then 'duplicated this from other task' \n when action_description like 'marked%as a duplicate of this' then 'marked other task as duplicate of this' \n when action_description like 'marked this a duplicate of%' then 'marked as duplicate' \n when action_description like 'marked this task complete' then 'completed' \n when action_description like 'completed this task' then 'completed' \n when action_description like 'marked incomplete' then 'marked incomplete' \n when action_description like 'marked this task as a milestone' then 'marked as milestone' \n when action_description like 'unmarked this task as a milestone' then 'unmarked as milestone' \n when action_description like 'marked this milestone complete' then 'completed milestone' \n when action_description like 'completed this milestone' then 'completed milestone' \n when action_description like 'attached%' then 'attachment' \n when action_description like 'liked your comment' then 'liked comment' \n when action_description like 'liked this task' then 'liked task' \n when action_description like 'liked your attachment' then 'liked attachment' \n when action_description like 'liked that you completed this task' then 'liked completion' \n when action_description like 'completed the last task you were waiting on%' then 'completed dependency' \n when action_description like 'added feedback to%' then 'added feedback' \n when action_description like 'changed%to%' then 'changed tag' \n when action_description like 'cleared%' then 'cleared tag' \n when action_description like 'comment' then 'comment' \n when action_description like 'have a task due on%' then ''\n else action_description end as action_taken,\n action_description\n \n from split_comments\n\n),\n\n\nfinal as (\n \n select * \n from parse_actions\n\n -- remove actions you don't care about (set to null in the actions dictionary above)\n where action_taken is not null \n\n)\n\n\nselect * from final\n)"}, {"id": "model.asana.int_asana__task_open_length", "sql": " __dbt__cte__int_asana__task_open_length as (\nwith task as (\n \n select *\n from `dbt-package-testing`.`asana_source_integration_source_stg_asana`.`stg_asana__task`\n\n),\n\nstory as (\n\n select * \n from __dbt__cte__int_asana__task_story\n\n),\n\nassignments as (\n \n select \n target_task_id as task_id,\n min(created_at) as first_assigned_at,\n max(created_at) as last_assigned_at -- current assignment\n\n from story\n where action_taken = 'assigned'\n\n group by 1\n\n),\n\n\nopen_assigned_length as (\n\n \n\n select\n task.task_id,\n task.is_completed,\n task.completed_at,\n task.assignee_user_id is not null as is_currently_assigned,\n assignments.task_id is not null as has_been_assigned,\n assignments.last_assigned_at as last_assigned_at,\n assignments.first_assigned_at as first_assigned_at,\n datetime_diff(\n cast(\n current_timestamp\n as datetime),\n cast(task.created_at as datetime),\n day\n ) as days_open,\n\n -- if the task is currently assigned, this is the time it has been assigned to this current user.\n datetime_diff(\n cast(\n current_timestamp\n as datetime),\n cast(assignments.last_assigned_at as datetime),\n day\n ) as days_since_last_assignment,\n\n datetime_diff(\n cast(\n current_timestamp\n as datetime),\n cast(assignments.first_assigned_at as datetime),\n day\n ) as days_since_first_assignment\n \n\n from task\n left join assignments \n on task.task_id = assignments.task_id\n\n)\n\n\nselect * from open_assigned_length\n)"}], "relation_name": null, "column_name": "task_id", "file_key_name": "models.int_asana__task_open_length"}, "test.asana.unique_int_asana__task_projects_task_id.8a6b2f262d": {"raw_sql": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "test_metadata": {"name": "unique", "kwargs": {"column_name": "task_id", "model": "{{ get_where_subquery(ref('int_asana__task_projects')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["model.asana.int_asana__task_projects"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "dbt-package-testing", "schema": "asana_source_integration_source_dbt_test__audit", "fqn": ["asana", "intermediate", "unique_int_asana__task_projects_task_id"], "unique_id": "test.asana.unique_int_asana__task_projects_task_id.8a6b2f262d", "package_name": "asana", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/asana", "path": "unique_int_asana__task_projects_task_id.sql", "original_file_path": "models/intermediate/intermediate_asana.yml", "name": "unique_int_asana__task_projects_task_id", "alias": "unique_int_asana__task_projects_task_id", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["int_asana__task_projects"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/asana/models/intermediate/intermediate_asana.yml/unique_int_asana__task_projects_task_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1663600953.819066, "compiled_sql": "\n \n \n\nwith __dbt__cte__int_asana__task_projects as (\nwith task_project as (\n\n select * \n from `dbt-package-testing`.`asana_source_integration_source_stg_asana`.`stg_asana__project_task`\n\n),\n\nproject as (\n \n select * \n from `dbt-package-testing`.`asana_source_integration_source_stg_asana`.`stg_asana__project`\n),\n\ntask_section as (\n\n select * \n from `dbt-package-testing`.`asana_source_integration_source_stg_asana`.`stg_asana__task_section`\n\n),\n\nsection as (\n \n select * \n from `dbt-package-testing`.`asana_source_integration_source_stg_asana`.`stg_asana__section`\n\n),\n\ntask_project_section as (\n\n select \n task_project.task_id,\n project.project_name || (case when section.section_name = '(no section)' then ''\n else ': ' || section.section_name end) as project_section, \n project.project_id\n from\n task_project \n join project \n on project.project_id = task_project.project_id\n join task_section\n on task_section.task_id = task_project.task_id\n join section \n on section.section_id = task_section.section_id \n and section.project_id = project.project_id\n),\n\nagg_project_sections as (\n select \n task_id,\n \n string_agg(task_project_section.project_section, ', ')\n\n as projects_sections,\n count(project_id) as number_of_projects\n\n from task_project_section \n\n group by 1\n)\n\nselect * from agg_project_sections\n),dbt_test__target as (\n\n select task_id as unique_field\n from __dbt__cte__int_asana__task_projects\n where task_id is not null\n\n)\n\nselect\n unique_field,\n count(*) as n_records\n\nfrom dbt_test__target\ngroup by unique_field\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.asana.int_asana__task_projects", "sql": " __dbt__cte__int_asana__task_projects as (\nwith task_project as (\n\n select * \n from `dbt-package-testing`.`asana_source_integration_source_stg_asana`.`stg_asana__project_task`\n\n),\n\nproject as (\n \n select * \n from `dbt-package-testing`.`asana_source_integration_source_stg_asana`.`stg_asana__project`\n),\n\ntask_section as (\n\n select * \n from `dbt-package-testing`.`asana_source_integration_source_stg_asana`.`stg_asana__task_section`\n\n),\n\nsection as (\n \n select * \n from `dbt-package-testing`.`asana_source_integration_source_stg_asana`.`stg_asana__section`\n\n),\n\ntask_project_section as (\n\n select \n task_project.task_id,\n project.project_name || (case when section.section_name = '(no section)' then ''\n else ': ' || section.section_name end) as project_section, \n project.project_id\n from\n task_project \n join project \n on project.project_id = task_project.project_id\n join task_section\n on task_section.task_id = task_project.task_id\n join section \n on section.section_id = task_section.section_id \n and section.project_id = project.project_id\n),\n\nagg_project_sections as (\n select \n task_id,\n \n string_agg(task_project_section.project_section, ', ')\n\n as projects_sections,\n count(project_id) as number_of_projects\n\n from task_project_section \n\n group by 1\n)\n\nselect * from agg_project_sections\n)"}], "relation_name": null, "column_name": "task_id", "file_key_name": "models.int_asana__task_projects"}, "test.asana.not_null_int_asana__task_projects_task_id.322519ee10": {"raw_sql": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "task_id", "model": "{{ get_where_subquery(ref('int_asana__task_projects')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.asana.int_asana__task_projects"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "dbt-package-testing", "schema": "asana_source_integration_source_dbt_test__audit", "fqn": ["asana", "intermediate", "not_null_int_asana__task_projects_task_id"], "unique_id": "test.asana.not_null_int_asana__task_projects_task_id.322519ee10", "package_name": "asana", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/asana", "path": "not_null_int_asana__task_projects_task_id.sql", "original_file_path": "models/intermediate/intermediate_asana.yml", "name": "not_null_int_asana__task_projects_task_id", "alias": "not_null_int_asana__task_projects_task_id", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["int_asana__task_projects"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/asana/models/intermediate/intermediate_asana.yml/not_null_int_asana__task_projects_task_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1663600953.819979, "compiled_sql": "\n \n \n\n\n\nwith __dbt__cte__int_asana__task_projects as (\nwith task_project as (\n\n select * \n from `dbt-package-testing`.`asana_source_integration_source_stg_asana`.`stg_asana__project_task`\n\n),\n\nproject as (\n \n select * \n from `dbt-package-testing`.`asana_source_integration_source_stg_asana`.`stg_asana__project`\n),\n\ntask_section as (\n\n select * \n from `dbt-package-testing`.`asana_source_integration_source_stg_asana`.`stg_asana__task_section`\n\n),\n\nsection as (\n \n select * \n from `dbt-package-testing`.`asana_source_integration_source_stg_asana`.`stg_asana__section`\n\n),\n\ntask_project_section as (\n\n select \n task_project.task_id,\n project.project_name || (case when section.section_name = '(no section)' then ''\n else ': ' || section.section_name end) as project_section, \n project.project_id\n from\n task_project \n join project \n on project.project_id = task_project.project_id\n join task_section\n on task_section.task_id = task_project.task_id\n join section \n on section.section_id = task_section.section_id \n and section.project_id = project.project_id\n),\n\nagg_project_sections as (\n select \n task_id,\n \n string_agg(task_project_section.project_section, ', ')\n\n as projects_sections,\n count(project_id) as number_of_projects\n\n from task_project_section \n\n group by 1\n)\n\nselect * from agg_project_sections\n)select task_id\nfrom __dbt__cte__int_asana__task_projects\nwhere task_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.asana.int_asana__task_projects", "sql": " __dbt__cte__int_asana__task_projects as (\nwith task_project as (\n\n select * \n from `dbt-package-testing`.`asana_source_integration_source_stg_asana`.`stg_asana__project_task`\n\n),\n\nproject as (\n \n select * \n from `dbt-package-testing`.`asana_source_integration_source_stg_asana`.`stg_asana__project`\n),\n\ntask_section as (\n\n select * \n from `dbt-package-testing`.`asana_source_integration_source_stg_asana`.`stg_asana__task_section`\n\n),\n\nsection as (\n \n select * \n from `dbt-package-testing`.`asana_source_integration_source_stg_asana`.`stg_asana__section`\n\n),\n\ntask_project_section as (\n\n select \n task_project.task_id,\n project.project_name || (case when section.section_name = '(no section)' then ''\n else ': ' || section.section_name end) as project_section, \n project.project_id\n from\n task_project \n join project \n on project.project_id = task_project.project_id\n join task_section\n on task_section.task_id = task_project.task_id\n join section \n on section.section_id = task_section.section_id \n and section.project_id = project.project_id\n),\n\nagg_project_sections as (\n select \n task_id,\n \n string_agg(task_project_section.project_section, ', ')\n\n as projects_sections,\n count(project_id) as number_of_projects\n\n from task_project_section \n\n group by 1\n)\n\nselect * from agg_project_sections\n)"}], "relation_name": null, "column_name": "task_id", "file_key_name": "models.int_asana__task_projects"}, "test.asana.unique_int_asana__task_story_story_id.92d7adbcf6": {"raw_sql": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "test_metadata": {"name": "unique", "kwargs": {"column_name": "story_id", "model": "{{ get_where_subquery(ref('int_asana__task_story')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["model.asana.int_asana__task_story"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "dbt-package-testing", "schema": "asana_source_integration_source_dbt_test__audit", "fqn": ["asana", "intermediate", "unique_int_asana__task_story_story_id"], "unique_id": "test.asana.unique_int_asana__task_story_story_id.92d7adbcf6", "package_name": "asana", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/asana", "path": "unique_int_asana__task_story_story_id.sql", "original_file_path": "models/intermediate/intermediate_asana.yml", "name": "unique_int_asana__task_story_story_id", "alias": "unique_int_asana__task_story_story_id", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["int_asana__task_story"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/asana/models/intermediate/intermediate_asana.yml/unique_int_asana__task_story_story_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1663600953.820889, "compiled_sql": "\n \n \n\nwith __dbt__cte__int_asana__task_story as (\nwith story as (\n \n select * \n from `dbt-package-testing`.`asana_source_integration_source_stg_asana`.`stg_asana__story`\n\n),\n\nasana_user as (\n\n select * \n from `dbt-package-testing`.`asana_source_integration_source_stg_asana`.`stg_asana__user`\n),\n\nstory_user as (\n select \n story.*,\n asana_user.user_name as created_by_name\n from story\n join asana_user \n on story.created_by_user_id = asana_user.user_id\n),\n\nsplit_comments as (\n\n select\n story_id,\n created_at,\n created_by_user_id,\n created_by_name,\n target_task_id,\n \n case when event_type = 'comment' then story_content \n else null end as comment_content,\n\n case when event_type = 'system' then story_content \n else 'comment' end as action_description\n \n from story_user\n\n),\n\n\n-- the next CTE uses this dictionary to parse the type of action out of the event descfription\n\n\nparse_actions as (\n select\n story_id,\n target_task_id,\n created_at,\n created_by_user_id,\n created_by_name,\n comment_content,\n case \n when action_description like 'added the name%' then 'added name' \n when action_description like 'changed the name%' then 'changed name' \n when action_description like 'removed the name' then 'removed name' \n when action_description like 'added the description%' then 'added description' \n when action_description like 'changed the description%' then 'changed description' \n when action_description like 'removed the description' then 'removed description' \n when action_description like 'added to%' then 'added to project' \n when action_description like 'removed from%' then 'removed from project' \n when action_description like 'assigned%' then 'assigned' \n when action_description like 'unassigned%' then 'unassigned' \n when action_description like 'changed the due date%' then 'changed due date' \n when action_description like 'changed the start date%due date%' then 'changed due date' \n when action_description like 'changed the start date%' then 'changed start date' \n when action_description like 'removed the due date%' then 'removed due date' \n when action_description like 'removed the date range%' then 'removed due date' \n when action_description like 'removed the start date' then 'removed start date' \n when action_description like 'added subtask%' then 'added subtask' \n when action_description like 'added%collaborator%' then 'added collaborator' \n when action_description like 'moved%' then 'moved to section' \n when action_description like 'duplicated task from%' then 'duplicated this from other task' \n when action_description like 'marked%as a duplicate of this' then 'marked other task as duplicate of this' \n when action_description like 'marked this a duplicate of%' then 'marked as duplicate' \n when action_description like 'marked this task complete' then 'completed' \n when action_description like 'completed this task' then 'completed' \n when action_description like 'marked incomplete' then 'marked incomplete' \n when action_description like 'marked this task as a milestone' then 'marked as milestone' \n when action_description like 'unmarked this task as a milestone' then 'unmarked as milestone' \n when action_description like 'marked this milestone complete' then 'completed milestone' \n when action_description like 'completed this milestone' then 'completed milestone' \n when action_description like 'attached%' then 'attachment' \n when action_description like 'liked your comment' then 'liked comment' \n when action_description like 'liked this task' then 'liked task' \n when action_description like 'liked your attachment' then 'liked attachment' \n when action_description like 'liked that you completed this task' then 'liked completion' \n when action_description like 'completed the last task you were waiting on%' then 'completed dependency' \n when action_description like 'added feedback to%' then 'added feedback' \n when action_description like 'changed%to%' then 'changed tag' \n when action_description like 'cleared%' then 'cleared tag' \n when action_description like 'comment' then 'comment' \n when action_description like 'have a task due on%' then ''\n else action_description end as action_taken,\n action_description\n \n from split_comments\n\n),\n\n\nfinal as (\n \n select * \n from parse_actions\n\n -- remove actions you don't care about (set to null in the actions dictionary above)\n where action_taken is not null \n\n)\n\n\nselect * from final\n),dbt_test__target as (\n\n select story_id as unique_field\n from __dbt__cte__int_asana__task_story\n where story_id is not null\n\n)\n\nselect\n unique_field,\n count(*) as n_records\n\nfrom dbt_test__target\ngroup by unique_field\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.asana.int_asana__task_story", "sql": " __dbt__cte__int_asana__task_story as (\nwith story as (\n \n select * \n from `dbt-package-testing`.`asana_source_integration_source_stg_asana`.`stg_asana__story`\n\n),\n\nasana_user as (\n\n select * \n from `dbt-package-testing`.`asana_source_integration_source_stg_asana`.`stg_asana__user`\n),\n\nstory_user as (\n select \n story.*,\n asana_user.user_name as created_by_name\n from story\n join asana_user \n on story.created_by_user_id = asana_user.user_id\n),\n\nsplit_comments as (\n\n select\n story_id,\n created_at,\n created_by_user_id,\n created_by_name,\n target_task_id,\n \n case when event_type = 'comment' then story_content \n else null end as comment_content,\n\n case when event_type = 'system' then story_content \n else 'comment' end as action_description\n \n from story_user\n\n),\n\n\n-- the next CTE uses this dictionary to parse the type of action out of the event descfription\n\n\nparse_actions as (\n select\n story_id,\n target_task_id,\n created_at,\n created_by_user_id,\n created_by_name,\n comment_content,\n case \n when action_description like 'added the name%' then 'added name' \n when action_description like 'changed the name%' then 'changed name' \n when action_description like 'removed the name' then 'removed name' \n when action_description like 'added the description%' then 'added description' \n when action_description like 'changed the description%' then 'changed description' \n when action_description like 'removed the description' then 'removed description' \n when action_description like 'added to%' then 'added to project' \n when action_description like 'removed from%' then 'removed from project' \n when action_description like 'assigned%' then 'assigned' \n when action_description like 'unassigned%' then 'unassigned' \n when action_description like 'changed the due date%' then 'changed due date' \n when action_description like 'changed the start date%due date%' then 'changed due date' \n when action_description like 'changed the start date%' then 'changed start date' \n when action_description like 'removed the due date%' then 'removed due date' \n when action_description like 'removed the date range%' then 'removed due date' \n when action_description like 'removed the start date' then 'removed start date' \n when action_description like 'added subtask%' then 'added subtask' \n when action_description like 'added%collaborator%' then 'added collaborator' \n when action_description like 'moved%' then 'moved to section' \n when action_description like 'duplicated task from%' then 'duplicated this from other task' \n when action_description like 'marked%as a duplicate of this' then 'marked other task as duplicate of this' \n when action_description like 'marked this a duplicate of%' then 'marked as duplicate' \n when action_description like 'marked this task complete' then 'completed' \n when action_description like 'completed this task' then 'completed' \n when action_description like 'marked incomplete' then 'marked incomplete' \n when action_description like 'marked this task as a milestone' then 'marked as milestone' \n when action_description like 'unmarked this task as a milestone' then 'unmarked as milestone' \n when action_description like 'marked this milestone complete' then 'completed milestone' \n when action_description like 'completed this milestone' then 'completed milestone' \n when action_description like 'attached%' then 'attachment' \n when action_description like 'liked your comment' then 'liked comment' \n when action_description like 'liked this task' then 'liked task' \n when action_description like 'liked your attachment' then 'liked attachment' \n when action_description like 'liked that you completed this task' then 'liked completion' \n when action_description like 'completed the last task you were waiting on%' then 'completed dependency' \n when action_description like 'added feedback to%' then 'added feedback' \n when action_description like 'changed%to%' then 'changed tag' \n when action_description like 'cleared%' then 'cleared tag' \n when action_description like 'comment' then 'comment' \n when action_description like 'have a task due on%' then ''\n else action_description end as action_taken,\n action_description\n \n from split_comments\n\n),\n\n\nfinal as (\n \n select * \n from parse_actions\n\n -- remove actions you don't care about (set to null in the actions dictionary above)\n where action_taken is not null \n\n)\n\n\nselect * from final\n)"}], "relation_name": null, "column_name": "story_id", "file_key_name": "models.int_asana__task_story"}, "test.asana.not_null_int_asana__task_story_story_id.1ffdb99927": {"raw_sql": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "story_id", "model": "{{ get_where_subquery(ref('int_asana__task_story')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.asana.int_asana__task_story"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "dbt-package-testing", "schema": "asana_source_integration_source_dbt_test__audit", "fqn": ["asana", "intermediate", "not_null_int_asana__task_story_story_id"], "unique_id": "test.asana.not_null_int_asana__task_story_story_id.1ffdb99927", "package_name": "asana", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/asana", "path": "not_null_int_asana__task_story_story_id.sql", "original_file_path": "models/intermediate/intermediate_asana.yml", "name": "not_null_int_asana__task_story_story_id", "alias": "not_null_int_asana__task_story_story_id", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["int_asana__task_story"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/asana/models/intermediate/intermediate_asana.yml/not_null_int_asana__task_story_story_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1663600953.82193, "compiled_sql": "\n \n \n\n\n\nwith __dbt__cte__int_asana__task_story as (\nwith story as (\n \n select * \n from `dbt-package-testing`.`asana_source_integration_source_stg_asana`.`stg_asana__story`\n\n),\n\nasana_user as (\n\n select * \n from `dbt-package-testing`.`asana_source_integration_source_stg_asana`.`stg_asana__user`\n),\n\nstory_user as (\n select \n story.*,\n asana_user.user_name as created_by_name\n from story\n join asana_user \n on story.created_by_user_id = asana_user.user_id\n),\n\nsplit_comments as (\n\n select\n story_id,\n created_at,\n created_by_user_id,\n created_by_name,\n target_task_id,\n \n case when event_type = 'comment' then story_content \n else null end as comment_content,\n\n case when event_type = 'system' then story_content \n else 'comment' end as action_description\n \n from story_user\n\n),\n\n\n-- the next CTE uses this dictionary to parse the type of action out of the event descfription\n\n\nparse_actions as (\n select\n story_id,\n target_task_id,\n created_at,\n created_by_user_id,\n created_by_name,\n comment_content,\n case \n when action_description like 'added the name%' then 'added name' \n when action_description like 'changed the name%' then 'changed name' \n when action_description like 'removed the name' then 'removed name' \n when action_description like 'added the description%' then 'added description' \n when action_description like 'changed the description%' then 'changed description' \n when action_description like 'removed the description' then 'removed description' \n when action_description like 'added to%' then 'added to project' \n when action_description like 'removed from%' then 'removed from project' \n when action_description like 'assigned%' then 'assigned' \n when action_description like 'unassigned%' then 'unassigned' \n when action_description like 'changed the due date%' then 'changed due date' \n when action_description like 'changed the start date%due date%' then 'changed due date' \n when action_description like 'changed the start date%' then 'changed start date' \n when action_description like 'removed the due date%' then 'removed due date' \n when action_description like 'removed the date range%' then 'removed due date' \n when action_description like 'removed the start date' then 'removed start date' \n when action_description like 'added subtask%' then 'added subtask' \n when action_description like 'added%collaborator%' then 'added collaborator' \n when action_description like 'moved%' then 'moved to section' \n when action_description like 'duplicated task from%' then 'duplicated this from other task' \n when action_description like 'marked%as a duplicate of this' then 'marked other task as duplicate of this' \n when action_description like 'marked this a duplicate of%' then 'marked as duplicate' \n when action_description like 'marked this task complete' then 'completed' \n when action_description like 'completed this task' then 'completed' \n when action_description like 'marked incomplete' then 'marked incomplete' \n when action_description like 'marked this task as a milestone' then 'marked as milestone' \n when action_description like 'unmarked this task as a milestone' then 'unmarked as milestone' \n when action_description like 'marked this milestone complete' then 'completed milestone' \n when action_description like 'completed this milestone' then 'completed milestone' \n when action_description like 'attached%' then 'attachment' \n when action_description like 'liked your comment' then 'liked comment' \n when action_description like 'liked this task' then 'liked task' \n when action_description like 'liked your attachment' then 'liked attachment' \n when action_description like 'liked that you completed this task' then 'liked completion' \n when action_description like 'completed the last task you were waiting on%' then 'completed dependency' \n when action_description like 'added feedback to%' then 'added feedback' \n when action_description like 'changed%to%' then 'changed tag' \n when action_description like 'cleared%' then 'cleared tag' \n when action_description like 'comment' then 'comment' \n when action_description like 'have a task due on%' then ''\n else action_description end as action_taken,\n action_description\n \n from split_comments\n\n),\n\n\nfinal as (\n \n select * \n from parse_actions\n\n -- remove actions you don't care about (set to null in the actions dictionary above)\n where action_taken is not null \n\n)\n\n\nselect * from final\n)select story_id\nfrom __dbt__cte__int_asana__task_story\nwhere story_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.asana.int_asana__task_story", "sql": " __dbt__cte__int_asana__task_story as (\nwith story as (\n \n select * \n from `dbt-package-testing`.`asana_source_integration_source_stg_asana`.`stg_asana__story`\n\n),\n\nasana_user as (\n\n select * \n from `dbt-package-testing`.`asana_source_integration_source_stg_asana`.`stg_asana__user`\n),\n\nstory_user as (\n select \n story.*,\n asana_user.user_name as created_by_name\n from story\n join asana_user \n on story.created_by_user_id = asana_user.user_id\n),\n\nsplit_comments as (\n\n select\n story_id,\n created_at,\n created_by_user_id,\n created_by_name,\n target_task_id,\n \n case when event_type = 'comment' then story_content \n else null end as comment_content,\n\n case when event_type = 'system' then story_content \n else 'comment' end as action_description\n \n from story_user\n\n),\n\n\n-- the next CTE uses this dictionary to parse the type of action out of the event descfription\n\n\nparse_actions as (\n select\n story_id,\n target_task_id,\n created_at,\n created_by_user_id,\n created_by_name,\n comment_content,\n case \n when action_description like 'added the name%' then 'added name' \n when action_description like 'changed the name%' then 'changed name' \n when action_description like 'removed the name' then 'removed name' \n when action_description like 'added the description%' then 'added description' \n when action_description like 'changed the description%' then 'changed description' \n when action_description like 'removed the description' then 'removed description' \n when action_description like 'added to%' then 'added to project' \n when action_description like 'removed from%' then 'removed from project' \n when action_description like 'assigned%' then 'assigned' \n when action_description like 'unassigned%' then 'unassigned' \n when action_description like 'changed the due date%' then 'changed due date' \n when action_description like 'changed the start date%due date%' then 'changed due date' \n when action_description like 'changed the start date%' then 'changed start date' \n when action_description like 'removed the due date%' then 'removed due date' \n when action_description like 'removed the date range%' then 'removed due date' \n when action_description like 'removed the start date' then 'removed start date' \n when action_description like 'added subtask%' then 'added subtask' \n when action_description like 'added%collaborator%' then 'added collaborator' \n when action_description like 'moved%' then 'moved to section' \n when action_description like 'duplicated task from%' then 'duplicated this from other task' \n when action_description like 'marked%as a duplicate of this' then 'marked other task as duplicate of this' \n when action_description like 'marked this a duplicate of%' then 'marked as duplicate' \n when action_description like 'marked this task complete' then 'completed' \n when action_description like 'completed this task' then 'completed' \n when action_description like 'marked incomplete' then 'marked incomplete' \n when action_description like 'marked this task as a milestone' then 'marked as milestone' \n when action_description like 'unmarked this task as a milestone' then 'unmarked as milestone' \n when action_description like 'marked this milestone complete' then 'completed milestone' \n when action_description like 'completed this milestone' then 'completed milestone' \n when action_description like 'attached%' then 'attachment' \n when action_description like 'liked your comment' then 'liked comment' \n when action_description like 'liked this task' then 'liked task' \n when action_description like 'liked your attachment' then 'liked attachment' \n when action_description like 'liked that you completed this task' then 'liked completion' \n when action_description like 'completed the last task you were waiting on%' then 'completed dependency' \n when action_description like 'added feedback to%' then 'added feedback' \n when action_description like 'changed%to%' then 'changed tag' \n when action_description like 'cleared%' then 'cleared tag' \n when action_description like 'comment' then 'comment' \n when action_description like 'have a task due on%' then ''\n else action_description end as action_taken,\n action_description\n \n from split_comments\n\n),\n\n\nfinal as (\n \n select * \n from parse_actions\n\n -- remove actions you don't care about (set to null in the actions dictionary above)\n where action_taken is not null \n\n)\n\n\nselect * from final\n)"}], "relation_name": null, "column_name": "story_id", "file_key_name": "models.int_asana__task_story"}, "test.asana.unique_int_asana__task_tags_task_id.f28aff2685": {"raw_sql": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "test_metadata": {"name": "unique", "kwargs": {"column_name": "task_id", "model": "{{ get_where_subquery(ref('int_asana__task_tags')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["model.asana.int_asana__task_tags"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "dbt-package-testing", "schema": "asana_source_integration_source_dbt_test__audit", "fqn": ["asana", "intermediate", "unique_int_asana__task_tags_task_id"], "unique_id": "test.asana.unique_int_asana__task_tags_task_id.f28aff2685", "package_name": "asana", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/asana", "path": "unique_int_asana__task_tags_task_id.sql", "original_file_path": "models/intermediate/intermediate_asana.yml", "name": "unique_int_asana__task_tags_task_id", "alias": "unique_int_asana__task_tags_task_id", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["int_asana__task_tags"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/asana/models/intermediate/intermediate_asana.yml/unique_int_asana__task_tags_task_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1663600953.8228412, "compiled_sql": "\n \n \n\nwith __dbt__cte__int_asana__task_tags as (\nwith task_tag as (\n \n select *\n from `dbt-package-testing`.`asana_source_integration_source_stg_asana`.`stg_asana__task_tag`\n\n),\n\nasana_tag as (\n\n select * \n from `dbt-package-testing`.`asana_source_integration_source_stg_asana`.`stg_asana__tag`\n\n),\n\nagg_tags as (\n\n select\n task_tag.task_id,\n \n string_agg(asana_tag.tag_name, ', ')\n\n as tags,\n count(*) as number_of_tags\n from task_tag \n join asana_tag \n on asana_tag.tag_id = task_tag.tag_id\n group by 1\n \n)\n\nselect * from agg_tags\n),dbt_test__target as (\n\n select task_id as unique_field\n from __dbt__cte__int_asana__task_tags\n where task_id is not null\n\n)\n\nselect\n unique_field,\n count(*) as n_records\n\nfrom dbt_test__target\ngroup by unique_field\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.asana.int_asana__task_tags", "sql": " __dbt__cte__int_asana__task_tags as (\nwith task_tag as (\n \n select *\n from `dbt-package-testing`.`asana_source_integration_source_stg_asana`.`stg_asana__task_tag`\n\n),\n\nasana_tag as (\n\n select * \n from `dbt-package-testing`.`asana_source_integration_source_stg_asana`.`stg_asana__tag`\n\n),\n\nagg_tags as (\n\n select\n task_tag.task_id,\n \n string_agg(asana_tag.tag_name, ', ')\n\n as tags,\n count(*) as number_of_tags\n from task_tag \n join asana_tag \n on asana_tag.tag_id = task_tag.tag_id\n group by 1\n \n)\n\nselect * from agg_tags\n)"}], "relation_name": null, "column_name": "task_id", "file_key_name": "models.int_asana__task_tags"}, "test.asana.not_null_int_asana__task_tags_task_id.34eec2b834": {"raw_sql": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "task_id", "model": "{{ get_where_subquery(ref('int_asana__task_tags')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.asana.int_asana__task_tags"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "dbt-package-testing", "schema": "asana_source_integration_source_dbt_test__audit", "fqn": ["asana", "intermediate", "not_null_int_asana__task_tags_task_id"], "unique_id": "test.asana.not_null_int_asana__task_tags_task_id.34eec2b834", "package_name": "asana", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/asana", "path": "not_null_int_asana__task_tags_task_id.sql", "original_file_path": "models/intermediate/intermediate_asana.yml", "name": "not_null_int_asana__task_tags_task_id", "alias": "not_null_int_asana__task_tags_task_id", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["int_asana__task_tags"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/asana/models/intermediate/intermediate_asana.yml/not_null_int_asana__task_tags_task_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1663600953.823756, "compiled_sql": "\n \n \n\n\n\nwith __dbt__cte__int_asana__task_tags as (\nwith task_tag as (\n \n select *\n from `dbt-package-testing`.`asana_source_integration_source_stg_asana`.`stg_asana__task_tag`\n\n),\n\nasana_tag as (\n\n select * \n from `dbt-package-testing`.`asana_source_integration_source_stg_asana`.`stg_asana__tag`\n\n),\n\nagg_tags as (\n\n select\n task_tag.task_id,\n \n string_agg(asana_tag.tag_name, ', ')\n\n as tags,\n count(*) as number_of_tags\n from task_tag \n join asana_tag \n on asana_tag.tag_id = task_tag.tag_id\n group by 1\n \n)\n\nselect * from agg_tags\n)select task_id\nfrom __dbt__cte__int_asana__task_tags\nwhere task_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.asana.int_asana__task_tags", "sql": " __dbt__cte__int_asana__task_tags as (\nwith task_tag as (\n \n select *\n from `dbt-package-testing`.`asana_source_integration_source_stg_asana`.`stg_asana__task_tag`\n\n),\n\nasana_tag as (\n\n select * \n from `dbt-package-testing`.`asana_source_integration_source_stg_asana`.`stg_asana__tag`\n\n),\n\nagg_tags as (\n\n select\n task_tag.task_id,\n \n string_agg(asana_tag.tag_name, ', ')\n\n as tags,\n count(*) as number_of_tags\n from task_tag \n join asana_tag \n on asana_tag.tag_id = task_tag.tag_id\n group by 1\n \n)\n\nselect * from agg_tags\n)"}], "relation_name": null, "column_name": "task_id", "file_key_name": "models.int_asana__task_tags"}, "test.asana.unique_int_asana__user_task_metrics_user_id.06a6a270b8": {"raw_sql": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "test_metadata": {"name": "unique", "kwargs": {"column_name": "user_id", "model": "{{ get_where_subquery(ref('int_asana__user_task_metrics')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["model.asana.int_asana__user_task_metrics"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "dbt-package-testing", "schema": "asana_source_integration_source_dbt_test__audit", "fqn": ["asana", "intermediate", "unique_int_asana__user_task_metrics_user_id"], "unique_id": "test.asana.unique_int_asana__user_task_metrics_user_id.06a6a270b8", "package_name": "asana", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/asana", "path": "unique_int_asana__user_task_metrics_user_id.sql", "original_file_path": "models/intermediate/intermediate_asana.yml", "name": "unique_int_asana__user_task_metrics_user_id", "alias": "unique_int_asana__user_task_metrics_user_id", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["int_asana__user_task_metrics"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/asana/models/intermediate/intermediate_asana.yml/unique_int_asana__user_task_metrics_user_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1663600953.824804, "compiled_sql": "\n \n \n\nwith __dbt__cte__int_asana__user_task_metrics as (\nwith tasks as (\n\n select * \n from `dbt-package-testing`.`asana_source_integration_source_asana`.`asana__task`\n where assignee_user_id is not null\n\n), \n\nagg_user_tasks as (\n\n select \n assignee_user_id as user_id,\n sum(case when not is_completed then 1 else 0 end) as number_of_open_tasks,\n sum(case when is_completed then 1 else 0 end) as number_of_tasks_completed,\n sum(case when is_completed then days_since_last_assignment else 0 end) as days_assigned_this_user -- will divde later for avg\n\n from tasks\n\n group by 1\n\n),\n\nfinal as (\n select\n agg_user_tasks.user_id,\n agg_user_tasks.number_of_open_tasks,\n agg_user_tasks.number_of_tasks_completed,\n nullif(agg_user_tasks.days_assigned_this_user, 0) * 1.0 / nullif(agg_user_tasks.number_of_tasks_completed, 0) as avg_close_time_days\n\n from \n agg_user_tasks \n)\n\nselect * from final\n),dbt_test__target as (\n\n select user_id as unique_field\n from __dbt__cte__int_asana__user_task_metrics\n where user_id is not null\n\n)\n\nselect\n unique_field,\n count(*) as n_records\n\nfrom dbt_test__target\ngroup by unique_field\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.asana.int_asana__user_task_metrics", "sql": " __dbt__cte__int_asana__user_task_metrics as (\nwith tasks as (\n\n select * \n from `dbt-package-testing`.`asana_source_integration_source_asana`.`asana__task`\n where assignee_user_id is not null\n\n), \n\nagg_user_tasks as (\n\n select \n assignee_user_id as user_id,\n sum(case when not is_completed then 1 else 0 end) as number_of_open_tasks,\n sum(case when is_completed then 1 else 0 end) as number_of_tasks_completed,\n sum(case when is_completed then days_since_last_assignment else 0 end) as days_assigned_this_user -- will divde later for avg\n\n from tasks\n\n group by 1\n\n),\n\nfinal as (\n select\n agg_user_tasks.user_id,\n agg_user_tasks.number_of_open_tasks,\n agg_user_tasks.number_of_tasks_completed,\n nullif(agg_user_tasks.days_assigned_this_user, 0) * 1.0 / nullif(agg_user_tasks.number_of_tasks_completed, 0) as avg_close_time_days\n\n from \n agg_user_tasks \n)\n\nselect * from final\n)"}], "relation_name": null, "column_name": "user_id", "file_key_name": "models.int_asana__user_task_metrics"}, "test.asana.not_null_int_asana__user_task_metrics_user_id.54eae7d721": {"raw_sql": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "user_id", "model": "{{ get_where_subquery(ref('int_asana__user_task_metrics')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.asana.int_asana__user_task_metrics"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "dbt-package-testing", "schema": "asana_source_integration_source_dbt_test__audit", "fqn": ["asana", "intermediate", "not_null_int_asana__user_task_metrics_user_id"], "unique_id": "test.asana.not_null_int_asana__user_task_metrics_user_id.54eae7d721", "package_name": "asana", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/asana", "path": "not_null_int_asana__user_task_metrics_user_id.sql", "original_file_path": "models/intermediate/intermediate_asana.yml", "name": "not_null_int_asana__user_task_metrics_user_id", "alias": "not_null_int_asana__user_task_metrics_user_id", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["int_asana__user_task_metrics"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/asana/models/intermediate/intermediate_asana.yml/not_null_int_asana__user_task_metrics_user_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1663600953.825719, "compiled_sql": "\n \n \n\n\n\nwith __dbt__cte__int_asana__user_task_metrics as (\nwith tasks as (\n\n select * \n from `dbt-package-testing`.`asana_source_integration_source_asana`.`asana__task`\n where assignee_user_id is not null\n\n), \n\nagg_user_tasks as (\n\n select \n assignee_user_id as user_id,\n sum(case when not is_completed then 1 else 0 end) as number_of_open_tasks,\n sum(case when is_completed then 1 else 0 end) as number_of_tasks_completed,\n sum(case when is_completed then days_since_last_assignment else 0 end) as days_assigned_this_user -- will divde later for avg\n\n from tasks\n\n group by 1\n\n),\n\nfinal as (\n select\n agg_user_tasks.user_id,\n agg_user_tasks.number_of_open_tasks,\n agg_user_tasks.number_of_tasks_completed,\n nullif(agg_user_tasks.days_assigned_this_user, 0) * 1.0 / nullif(agg_user_tasks.number_of_tasks_completed, 0) as avg_close_time_days\n\n from \n agg_user_tasks \n)\n\nselect * from final\n)select user_id\nfrom __dbt__cte__int_asana__user_task_metrics\nwhere user_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.asana.int_asana__user_task_metrics", "sql": " __dbt__cte__int_asana__user_task_metrics as (\nwith tasks as (\n\n select * \n from `dbt-package-testing`.`asana_source_integration_source_asana`.`asana__task`\n where assignee_user_id is not null\n\n), \n\nagg_user_tasks as (\n\n select \n assignee_user_id as user_id,\n sum(case when not is_completed then 1 else 0 end) as number_of_open_tasks,\n sum(case when is_completed then 1 else 0 end) as number_of_tasks_completed,\n sum(case when is_completed then days_since_last_assignment else 0 end) as days_assigned_this_user -- will divde later for avg\n\n from tasks\n\n group by 1\n\n),\n\nfinal as (\n select\n agg_user_tasks.user_id,\n agg_user_tasks.number_of_open_tasks,\n agg_user_tasks.number_of_tasks_completed,\n nullif(agg_user_tasks.days_assigned_this_user, 0) * 1.0 / nullif(agg_user_tasks.number_of_tasks_completed, 0) as avg_close_time_days\n\n from \n agg_user_tasks \n)\n\nselect * from final\n)"}], "relation_name": null, "column_name": "user_id", "file_key_name": "models.int_asana__user_task_metrics"}}, "sources": {"source.asana_source.asana.user": {"fqn": ["asana_source", "asana", "user"], "database": "dbt-package-testing", "schema": "asana_integrations_tests", "unique_id": "source.asana_source.asana.user", "package_name": "asana_source", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/asana_source", "path": "models/src_asana.yml", "original_file_path": "models/src_asana.yml", "name": "user", "source_name": "asana", "source_description": "", "loader": "fivetran", "identifier": "user_data", "resource_type": "source", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "_fivetran_synced", "freshness": null, "external": null, "description": "Table of all accounts in the organization", "columns": {"id": {"name": "id", "description": "System generated unique ID for a user", "meta": {}, "data_type": null, "quote": null, "tags": []}, "email": {"name": "email", "description": "Email associated with the user", "meta": {}, "data_type": null, "quote": null, "tags": []}, "name": {"name": "name", "description": "Given name for the user as it appears in the UI", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true}, "patch_path": null, "unrendered_config": {}, "relation_name": "`dbt-package-testing`.`asana_integrations_tests`.`user_data`", "created_at": 1663600953.826405}, "source.asana_source.asana.task": {"fqn": ["asana_source", "asana", "task"], "database": "dbt-package-testing", "schema": "asana_integrations_tests", "unique_id": "source.asana_source.asana.task", "package_name": "asana_source", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/asana_source", "path": "models/src_asana.yml", "original_file_path": "models/src_asana.yml", "name": "task", "source_name": "asana", "source_description": "", "loader": "fivetran", "identifier": "task_data", "resource_type": "source", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "_fivetran_synced", "freshness": {"warn_after": {"count": 72, "period": "hour"}, "error_after": {"count": 96, "period": "hour"}, "filter": null}, "external": null, "description": "Table containing all created tasks", "columns": {"id": {"name": "id", "description": "System generated unique identifier for the task", "meta": {}, "data_type": null, "quote": null, "tags": []}, "assignee_id": {"name": "assignee_id", "description": "Foreign key referencing the USER assigned to this task (note that a task may not have an assignee)", "meta": {}, "data_type": null, "quote": null, "tags": []}, "completed": {"name": "completed", "description": "Boolean that's true if the task is *currently* marked completed. Note that a task can be unmarked complete", "meta": {}, "data_type": null, "quote": null, "tags": []}, "completed_at": {"name": "completed_at", "description": "Timestamp of when the task was completed, if still currently completed.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "completed_by_id": {"name": "completed_by_id", "description": "Foreign key that references the USER who completed the task, if currently completed.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "created_at": {"name": "created_at", "description": "Timestamp of when the task was first made", "meta": {}, "data_type": null, "quote": null, "tags": []}, "due_on": {"name": "due_on", "description": "The date on which the task is due. Note that not tasks may not have a due date", "meta": {}, "data_type": null, "quote": null, "tags": []}, "due_at": {"name": "due_at", "description": "The date and time at which the task is due, only if a specific time is given.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "modified_at": {"name": "modified_at", "description": "The last time the task was updated. Does not include comments nor changes in associations (ie their projects)", "meta": {}, "data_type": null, "quote": null, "tags": []}, "name": {"name": "name", "description": "The title of the task", "meta": {}, "data_type": null, "quote": null, "tags": []}, "notes": {"name": "notes", "description": "Free-form textual description of the task (as seen in the UI).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "liked": {"name": "liked", "description": "A boolean that's true if the task has been liked.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "num_likes": {"name": "num_likes", "description": "An integer indicating the number of likes on a task.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "parent_id": {"name": "parent_id", "description": "The ID of the parent of the task, if it is a subtask. Self-refers to TASK", "meta": {}, "data_type": null, "quote": null, "tags": []}, "start_on": {"name": "start_on", "description": "The start date of the task, if given with the due date", "meta": {}, "data_type": null, "quote": null, "tags": []}, "workspace_id": {"name": "workspace_id", "description": "The id of an organization's workspace in asana. Not necessary unless you have access to multiple organization's asanas.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true}, "patch_path": null, "unrendered_config": {}, "relation_name": "`dbt-package-testing`.`asana_integrations_tests`.`task_data`", "created_at": 1663600953.8265028}, "source.asana_source.asana.project": {"fqn": ["asana_source", "asana", "project"], "database": "dbt-package-testing", "schema": "asana_integrations_tests", "unique_id": "source.asana_source.asana.project", "package_name": "asana_source", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/asana_source", "path": "models/src_asana.yml", "original_file_path": "models/src_asana.yml", "name": "project", "source_name": "asana", "source_description": "", "loader": "fivetran", "identifier": "project_data", "resource_type": "source", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "_fivetran_synced", "freshness": null, "external": null, "description": "Table containing all projects", "columns": {"id": {"name": "id", "description": "System generated unique ID of the project.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "archived": {"name": "archived", "description": "Boolean representing whether the project has been archived (removed from asana UI).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "color": {"name": "color", "description": "Color of the project as seen in the UI.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "created_at": {"name": "created_at", "description": "Timestamp of when the story was made/the action was logged.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "current_status": {"name": "current_status", "description": "The most recent progress status update for the project. This is sent to all project followers.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "due_date": {"name": "due_date", "description": "The date the project is due.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "modified_at": {"name": "modified_at", "description": "The last time the project was updated. Does not include comments nor changes in associations (ie new tasks).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "name": {"name": "name", "description": "The given name of the project.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "notes": {"name": "notes", "description": "Free-form textual notes associated with the project.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "owner_id": {"name": "owner_id", "description": "Foreign key referencing the USER who owns the project.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "public": {"name": "public", "description": "Boolean that is true if the project is public to the whole organization, false if not.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "team_id": {"name": "team_id", "description": "Foreign key referencing the TEAM that the project is shared with.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "workspace_id": {"name": "workspace_id", "description": "The id of an organization's workspace in asana. Not necessary unless you have access to multiple asana workspaces.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true}, "patch_path": null, "unrendered_config": {}, "relation_name": "`dbt-package-testing`.`asana_integrations_tests`.`project_data`", "created_at": 1663600953.826577}, "source.asana_source.asana.story": {"fqn": ["asana_source", "asana", "story"], "database": "dbt-package-testing", "schema": "asana_integrations_tests", "unique_id": "source.asana_source.asana.story", "package_name": "asana_source", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/asana_source", "path": "models/src_asana.yml", "original_file_path": "models/src_asana.yml", "name": "story", "source_name": "asana", "source_description": "", "loader": "fivetran", "identifier": "story_data", "resource_type": "source", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "_fivetran_synced", "freshness": {"warn_after": {"count": 72, "period": "hour"}, "error_after": {"count": 96, "period": "hour"}, "filter": null}, "external": null, "description": "Table containing all stories -- stories are actions taken on tasks", "columns": {"id": {"name": "id", "description": "System generated unique ID of the story/action taken", "meta": {}, "data_type": null, "quote": null, "tags": []}, "created_at": {"name": "created_at", "description": "Timestamp of when the story was made/the action was logged", "meta": {}, "data_type": null, "quote": null, "tags": []}, "created_by_id": {"name": "created_by_id", "description": "Foreign key referencing the USER who created the story/took the action on the task (sometimes null)", "meta": {}, "data_type": null, "quote": null, "tags": []}, "target_id": {"name": "target_id", "description": "Foreign key referencing the TASK that the story is about.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "text": {"name": "text", "description": "Free-form text describing the action that was taken (if type = system), or the content of a comment (if type = comment)", "meta": {}, "data_type": null, "quote": null, "tags": []}, "type": {"name": "type", "description": "The origin type of the story - a comment or change to the backend/altering a task", "meta": {}, "data_type": null, "quote": null, "tags": []}, "source": {"name": "source", "description": "Where the story occurred (web, mobile, email, or api)", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true}, "patch_path": null, "unrendered_config": {}, "relation_name": "`dbt-package-testing`.`asana_integrations_tests`.`story_data`", "created_at": 1663600953.826643}, "source.asana_source.asana.team": {"fqn": ["asana_source", "asana", "team"], "database": "dbt-package-testing", "schema": "asana_integrations_tests", "unique_id": "source.asana_source.asana.team", "package_name": "asana_source", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/asana_source", "path": "models/src_asana.yml", "original_file_path": "models/src_asana.yml", "name": "team", "source_name": "asana", "source_description": "", "loader": "fivetran", "identifier": "team_data", "resource_type": "source", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "_fivetran_synced", "freshness": null, "external": null, "description": "Table of the teams within the organization", "columns": {"id": {"name": "id", "description": "System generated unique ID for each team", "meta": {}, "data_type": null, "quote": null, "tags": []}, "name": {"name": "name", "description": "Provided name for each team. There can be duplicates", "meta": {}, "data_type": null, "quote": null, "tags": []}, "organization_id": {"name": "organization_id", "description": "Equivalent to the workspace_id, as organizations are a kind of workspace. Probably not relevant unless working with multiple orgs.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true}, "patch_path": null, "unrendered_config": {}, "relation_name": "`dbt-package-testing`.`asana_integrations_tests`.`team_data`", "created_at": 1663600953.8267}, "source.asana_source.asana.tag": {"fqn": ["asana_source", "asana", "tag"], "database": "dbt-package-testing", "schema": "asana_integrations_tests", "unique_id": "source.asana_source.asana.tag", "package_name": "asana_source", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/asana_source", "path": "models/src_asana.yml", "original_file_path": "models/src_asana.yml", "name": "tag", "source_name": "asana", "source_description": "", "loader": "fivetran", "identifier": "tag_data", "resource_type": "source", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "_fivetran_synced", "freshness": null, "external": null, "description": "Table of the custom tags made in the organization", "columns": {"id": {"name": "id", "description": "System generated ID for each tag", "meta": {}, "data_type": null, "quote": null, "tags": []}, "name": {"name": "name", "description": "The name of the tag as it appears in the UI. There can be duplicates.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "created_at": {"name": "created_at", "description": "Timestamp of when the tag was created", "meta": {}, "data_type": null, "quote": null, "tags": []}, "color": {"name": "color", "description": "Chosen color of the tag as it appears in the UI", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true}, "patch_path": null, "unrendered_config": {}, "relation_name": "`dbt-package-testing`.`asana_integrations_tests`.`tag_data`", "created_at": 1663600953.826758}, "source.asana_source.asana.section": {"fqn": ["asana_source", "asana", "section"], "database": "dbt-package-testing", "schema": "asana_integrations_tests", "unique_id": "source.asana_source.asana.section", "package_name": "asana_source", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/asana_source", "path": "models/src_asana.yml", "original_file_path": "models/src_asana.yml", "name": "section", "source_name": "asana", "source_description": "", "loader": "fivetran", "identifier": "section_data", "resource_type": "source", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "_fivetran_synced", "freshness": null, "external": null, "description": "Table of all sections within projects. If tasks in a project are not in an explicit user-made section, a default section called \"(no section)\" is created here", "columns": {"id": {"name": "id", "description": "System generated unique ID for each section", "meta": {}, "data_type": null, "quote": null, "tags": []}, "created_at": {"name": "created_at", "description": "Timestamp of when the section was created by a user", "meta": {}, "data_type": null, "quote": null, "tags": []}, "name": {"name": "name", "description": "The given name of the section as it appears in the UI. Is stored as \"(no section)\" when this is the default bucket for tasks with a section in a project", "meta": {}, "data_type": null, "quote": null, "tags": []}, "project_id": {"name": "project_id", "description": "Foreign key referencing the PROJECT that the section lives in", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true}, "patch_path": null, "unrendered_config": {}, "relation_name": "`dbt-package-testing`.`asana_integrations_tests`.`section_data`", "created_at": 1663600953.826815}, "source.asana_source.asana.project_task": {"fqn": ["asana_source", "asana", "project_task"], "database": "dbt-package-testing", "schema": "asana_integrations_tests", "unique_id": "source.asana_source.asana.project_task", "package_name": "asana_source", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/asana_source", "path": "models/src_asana.yml", "original_file_path": "models/src_asana.yml", "name": "project_task", "source_name": "asana", "source_description": "", "loader": "fivetran", "identifier": "project_task_data", "resource_type": "source", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "_fivetran_synced", "freshness": null, "external": null, "description": "Table of tasks and the project(s) they each belong to. If a project doesn't have a task, it won't be in here (and vice versa)", "columns": {"project_id": {"name": "project_id", "description": "Foreign key referencing a PROJECT the task belongs to", "meta": {}, "data_type": null, "quote": null, "tags": []}, "task_id": {"name": "task_id", "description": "Foreign key referencing the TASK in the project", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true}, "patch_path": null, "unrendered_config": {}, "relation_name": "`dbt-package-testing`.`asana_integrations_tests`.`project_task_data`", "created_at": 1663600953.826869}, "source.asana_source.asana.task_follower": {"fqn": ["asana_source", "asana", "task_follower"], "database": "dbt-package-testing", "schema": "asana_integrations_tests", "unique_id": "source.asana_source.asana.task_follower", "package_name": "asana_source", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/asana_source", "path": "models/src_asana.yml", "original_file_path": "models/src_asana.yml", "name": "task_follower", "source_name": "asana", "source_description": "", "loader": "fivetran", "identifier": "task_follower_data", "resource_type": "source", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "_fivetran_synced", "freshness": null, "external": null, "description": "Table of tasks with the users that are following them. Tasks without users do not appear here.", "columns": {"task_id": {"name": "task_id", "description": "Foreign key referencing the TASK being followed", "meta": {}, "data_type": null, "quote": null, "tags": []}, "user_id": {"name": "user_id", "description": "Foreign key referencing the USER that is following the task", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true}, "patch_path": null, "unrendered_config": {}, "relation_name": "`dbt-package-testing`.`asana_integrations_tests`.`task_follower_data`", "created_at": 1663600953.826923}, "source.asana_source.asana.task_tag": {"fqn": ["asana_source", "asana", "task_tag"], "database": "dbt-package-testing", "schema": "asana_integrations_tests", "unique_id": "source.asana_source.asana.task_tag", "package_name": "asana_source", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/asana_source", "path": "models/src_asana.yml", "original_file_path": "models/src_asana.yml", "name": "task_tag", "source_name": "asana", "source_description": "", "loader": "fivetran", "identifier": "task_tag_data", "resource_type": "source", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "_fivetran_synced", "freshness": null, "external": null, "description": "Table of tasks with the tags attached to them. Tasks without tags (and vice versa) do not appear here.", "columns": {"task_id": {"name": "task_id", "description": "Foreign key referencing the TASK that is tagged", "meta": {}, "data_type": null, "quote": null, "tags": []}, "tag_id": {"name": "tag_id", "description": "Foreign key referencing the TAG that is applied to the task", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true}, "patch_path": null, "unrendered_config": {}, "relation_name": "`dbt-package-testing`.`asana_integrations_tests`.`task_tag_data`", "created_at": 1663600953.826978}, "source.asana_source.asana.task_section": {"fqn": ["asana_source", "asana", "task_section"], "database": "dbt-package-testing", "schema": "asana_integrations_tests", "unique_id": "source.asana_source.asana.task_section", "package_name": "asana_source", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/asana_source", "path": "models/src_asana.yml", "original_file_path": "models/src_asana.yml", "name": "task_section", "source_name": "asana", "source_description": "", "loader": "fivetran", "identifier": "task_section_data", "resource_type": "source", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "_fivetran_synced", "freshness": null, "external": null, "description": "Table of tasks and the section that they live under. Section-less tasks within projects appear here, but project-less tasks do not", "columns": {"section_id": {"name": "section_id", "description": "Foreign key referencing the SECTION that the task lives under.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "task_id": {"name": "task_id", "description": "Foreign key referencing the TASK that lives in a section.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true}, "patch_path": null, "unrendered_config": {}, "relation_name": "`dbt-package-testing`.`asana_integrations_tests`.`task_section_data`", "created_at": 1663600953.827032}}, "macros": {"macro.dbt_bigquery.date_sharded_table": {"unique_id": "macro.dbt_bigquery.date_sharded_table", "package_name": "dbt_bigquery", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.2.0/libexec/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/etc.sql", "original_file_path": "macros/etc.sql", "name": "date_sharded_table", "macro_sql": "{% macro date_sharded_table(base_name) %}\n {{ return(base_name ~ \"[DBT__PARTITION_DATE]\") }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600952.80355}, "macro.dbt_bigquery.grant_access_to": {"unique_id": "macro.dbt_bigquery.grant_access_to", "package_name": "dbt_bigquery", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.2.0/libexec/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/etc.sql", "original_file_path": "macros/etc.sql", "name": "grant_access_to", "macro_sql": "{% macro grant_access_to(entity, entity_type, role, grant_target_dict) -%}\n {% do adapter.grant_access_to(entity, entity_type, role, grant_target_dict) %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600952.8037791}, "macro.dbt_bigquery.get_partitions_metadata": {"unique_id": "macro.dbt_bigquery.get_partitions_metadata", "package_name": "dbt_bigquery", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.2.0/libexec/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/etc.sql", "original_file_path": "macros/etc.sql", "name": "get_partitions_metadata", "macro_sql": "\n\n{%- macro get_partitions_metadata(table) -%}\n {%- if execute -%}\n {%- set res = adapter.get_partitions_metadata(table) -%}\n {{- return(res) -}}\n {%- endif -%}\n {{- return(None) -}}\n{%- endmacro -%}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600952.804061}, "macro.dbt_bigquery.bigquery__get_catalog": {"unique_id": "macro.dbt_bigquery.bigquery__get_catalog", "package_name": "dbt_bigquery", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.2.0/libexec/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/catalog.sql", "original_file_path": "macros/catalog.sql", "name": "bigquery__get_catalog", "macro_sql": "{% macro bigquery__get_catalog(information_schema, schemas) -%}\n\n {%- if (schemas | length) == 0 -%}\n {# Hopefully nothing cares about the columns we return when there are no rows #}\n {%- set query = \"select 1 as id limit 0\" -%}\n {%- else -%}\n\n {%- set query -%}\n with tables as (\n select\n project_id as table_database,\n dataset_id as table_schema,\n table_id as original_table_name,\n\n concat(project_id, '.', dataset_id, '.', table_id) as relation_id,\n\n row_count,\n size_bytes as size_bytes,\n case\n when type = 1 then 'table'\n when type = 2 then 'view'\n else 'external'\n end as table_type,\n\n REGEXP_CONTAINS(table_id, '^.+[0-9]{8}$') and coalesce(type, 0) = 1 as is_date_shard,\n REGEXP_EXTRACT(table_id, '^(.+)[0-9]{8}$') as shard_base_name,\n REGEXP_EXTRACT(table_id, '^.+([0-9]{8})$') as shard_name\n\n from {{ information_schema.replace(information_schema_view='__TABLES__') }}\n where (\n {%- for schema in schemas -%}\n upper(dataset_id) = upper('{{ schema }}'){%- if not loop.last %} or {% endif -%}\n {%- endfor -%}\n )\n ),\n\n extracted as (\n\n select *,\n case\n when is_date_shard then shard_base_name\n else original_table_name\n end as table_name\n\n from tables\n\n ),\n\n unsharded_tables as (\n\n select\n table_database,\n table_schema,\n table_name,\n coalesce(table_type, 'external') as table_type,\n is_date_shard,\n\n struct(\n min(shard_name) as shard_min,\n max(shard_name) as shard_max,\n count(*) as shard_count\n ) as table_shards,\n\n sum(size_bytes) as size_bytes,\n sum(row_count) as row_count,\n\n max(relation_id) as relation_id\n\n from extracted\n group by 1,2,3,4,5\n\n ),\n\n info_schema_columns as (\n\n select\n concat(table_catalog, '.', table_schema, '.', table_name) as relation_id,\n table_catalog as table_database,\n table_schema,\n table_name,\n\n -- use the \"real\" column name from the paths query below\n column_name as base_column_name,\n ordinal_position as column_index,\n\n is_partitioning_column,\n clustering_ordinal_position\n\n from {{ information_schema.replace(information_schema_view='COLUMNS') }}\n where ordinal_position is not null\n\n ),\n\n info_schema_column_paths as (\n\n select\n concat(table_catalog, '.', table_schema, '.', table_name) as relation_id,\n field_path as column_name,\n data_type as column_type,\n column_name as base_column_name,\n description as column_comment\n\n from {{ information_schema.replace(information_schema_view='COLUMN_FIELD_PATHS') }}\n\n ),\n\n columns as (\n\n select * except (base_column_name)\n from info_schema_columns\n join info_schema_column_paths using (relation_id, base_column_name)\n\n ),\n\n column_stats as (\n\n select\n table_database,\n table_schema,\n table_name,\n max(relation_id) as relation_id,\n max(case when is_partitioning_column = 'YES' then 1 else 0 end) = 1 as is_partitioned,\n max(case when is_partitioning_column = 'YES' then column_name else null end) as partition_column,\n max(case when clustering_ordinal_position is not null then 1 else 0 end) = 1 as is_clustered,\n array_to_string(\n array_agg(\n case\n when clustering_ordinal_position is not null then column_name\n else null\n end ignore nulls\n order by clustering_ordinal_position\n ), ', '\n ) as clustering_columns\n\n from columns\n group by 1,2,3\n\n )\n\n select\n unsharded_tables.table_database,\n unsharded_tables.table_schema,\n case\n when is_date_shard then concat(unsharded_tables.table_name, '*')\n else unsharded_tables.table_name\n end as table_name,\n unsharded_tables.table_type,\n\n -- coalesce name and type for External tables - these columns are not\n -- present in the COLUMN_FIELD_PATHS resultset\n coalesce(columns.column_name, '') as column_name,\n -- invent a row number to account for nested fields -- BQ does\n -- not treat these nested properties as independent fields\n row_number() over (\n partition by relation_id\n order by columns.column_index, columns.column_name\n ) as column_index,\n coalesce(columns.column_type, '') as column_type,\n columns.column_comment,\n\n 'Shard count' as `stats__date_shards__label`,\n table_shards.shard_count as `stats__date_shards__value`,\n 'The number of date shards in this table' as `stats__date_shards__description`,\n is_date_shard as `stats__date_shards__include`,\n\n 'Shard (min)' as `stats__date_shard_min__label`,\n table_shards.shard_min as `stats__date_shard_min__value`,\n 'The first date shard in this table' as `stats__date_shard_min__description`,\n is_date_shard as `stats__date_shard_min__include`,\n\n 'Shard (max)' as `stats__date_shard_max__label`,\n table_shards.shard_max as `stats__date_shard_max__value`,\n 'The last date shard in this table' as `stats__date_shard_max__description`,\n is_date_shard as `stats__date_shard_max__include`,\n\n '# Rows' as `stats__num_rows__label`,\n row_count as `stats__num_rows__value`,\n 'Approximate count of rows in this table' as `stats__num_rows__description`,\n (unsharded_tables.table_type = 'table') as `stats__num_rows__include`,\n\n 'Approximate Size' as `stats__num_bytes__label`,\n size_bytes as `stats__num_bytes__value`,\n 'Approximate size of table as reported by BigQuery' as `stats__num_bytes__description`,\n (unsharded_tables.table_type = 'table') as `stats__num_bytes__include`,\n\n 'Partitioned By' as `stats__partitioning_type__label`,\n partition_column as `stats__partitioning_type__value`,\n 'The partitioning column for this table' as `stats__partitioning_type__description`,\n is_partitioned as `stats__partitioning_type__include`,\n\n 'Clustered By' as `stats__clustering_fields__label`,\n clustering_columns as `stats__clustering_fields__value`,\n 'The clustering columns for this table' as `stats__clustering_fields__description`,\n is_clustered as `stats__clustering_fields__include`\n\n -- join using relation_id (an actual relation, not a shard prefix) to make\n -- sure that column metadata is picked up through the join. This will only\n -- return the column information for the \"max\" table in a date-sharded table set\n from unsharded_tables\n left join columns using (relation_id)\n left join column_stats using (relation_id)\n {%- endset -%}\n\n {%- endif -%}\n\n {{ return(run_query(query)) }}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.replace", "macro.dbt.run_query"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600952.807279}, "macro.dbt_bigquery.partition_by": {"unique_id": "macro.dbt_bigquery.partition_by", "package_name": "dbt_bigquery", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.2.0/libexec/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "name": "partition_by", "macro_sql": "{% macro partition_by(partition_config) -%}\n {%- if partition_config is none -%}\n {% do return('') %}\n {%- elif partition_config.data_type | lower in ('date','timestamp','datetime') -%}\n partition by {{ partition_config.render() }}\n {%- elif partition_config.data_type | lower in ('int64') -%}\n {%- set range = partition_config.range -%}\n partition by range_bucket(\n {{ partition_config.field }},\n generate_array({{ range.start}}, {{ range.end }}, {{ range.interval }})\n )\n {%- endif -%}\n{%- endmacro -%}\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600952.81248}, "macro.dbt_bigquery.cluster_by": {"unique_id": "macro.dbt_bigquery.cluster_by", "package_name": "dbt_bigquery", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.2.0/libexec/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "name": "cluster_by", "macro_sql": "{% macro cluster_by(raw_cluster_by) %}\n {%- if raw_cluster_by is not none -%}\n cluster by {% if raw_cluster_by is string -%}\n {% set raw_cluster_by = [raw_cluster_by] %}\n {%- endif -%}\n {%- for cluster in raw_cluster_by -%}\n {{ cluster }}\n {%- if not loop.last -%}, {% endif -%}\n {%- endfor -%}\n\n {% endif %}\n\n{%- endmacro -%}\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600952.8128488}, "macro.dbt_bigquery.bigquery_options": {"unique_id": "macro.dbt_bigquery.bigquery_options", "package_name": "dbt_bigquery", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.2.0/libexec/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "name": "bigquery_options", "macro_sql": "{% macro bigquery_options(opts) %}\n {% set options -%}\n OPTIONS({% for opt_key, opt_val in opts.items() %}\n {{ opt_key }}={{ opt_val }}{{ \",\" if not loop.last }}\n {% endfor %})\n {%- endset %}\n {%- do return(options) -%}\n{%- endmacro -%}\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600952.8131998}, "macro.dbt_bigquery.bigquery_table_options": {"unique_id": "macro.dbt_bigquery.bigquery_table_options", "package_name": "dbt_bigquery", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.2.0/libexec/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "name": "bigquery_table_options", "macro_sql": "{% macro bigquery_table_options(config, node, temporary) %}\n {% set opts = adapter.get_table_options(config, node, temporary) %}\n {%- do return(bigquery_options(opts)) -%}\n{%- endmacro -%}\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery_options"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600952.813455}, "macro.dbt_bigquery.bigquery__create_table_as": {"unique_id": "macro.dbt_bigquery.bigquery__create_table_as", "package_name": "dbt_bigquery", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.2.0/libexec/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "name": "bigquery__create_table_as", "macro_sql": "{% macro bigquery__create_table_as(temporary, relation, sql) -%}\n {%- set raw_partition_by = config.get('partition_by', none) -%}\n {%- set raw_cluster_by = config.get('cluster_by', none) -%}\n {%- set sql_header = config.get('sql_header', none) -%}\n\n {%- set partition_config = adapter.parse_partition_by(raw_partition_by) -%}\n\n {{ sql_header if sql_header is not none }}\n\n create or replace table {{ relation }}\n {{ partition_by(partition_config) }}\n {{ cluster_by(raw_cluster_by) }}\n {{ bigquery_table_options(config, model, temporary) }}\n as (\n {{ sql }}\n );\n\n{%- endmacro -%}\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.partition_by", "macro.dbt_bigquery.cluster_by", "macro.dbt_bigquery.bigquery_table_options"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600952.8140821}, "macro.dbt_bigquery.bigquery_view_options": {"unique_id": "macro.dbt_bigquery.bigquery_view_options", "package_name": "dbt_bigquery", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.2.0/libexec/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "name": "bigquery_view_options", "macro_sql": "{% macro bigquery_view_options(config, node) %}\n {% set opts = adapter.get_view_options(config, node) %}\n {%- do return(bigquery_options(opts)) -%}\n{%- endmacro -%}\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery_options"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600952.814314}, "macro.dbt_bigquery.bigquery__create_view_as": {"unique_id": "macro.dbt_bigquery.bigquery__create_view_as", "package_name": "dbt_bigquery", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.2.0/libexec/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "name": "bigquery__create_view_as", "macro_sql": "{% macro bigquery__create_view_as(relation, sql) -%}\n {%- set sql_header = config.get('sql_header', none) -%}\n\n {{ sql_header if sql_header is not none }}\n\n create or replace view {{ relation }}\n {{ bigquery_view_options(config, model) }}\n as {{ sql }};\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery_view_options"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600952.814629}, "macro.dbt_bigquery.bigquery__create_schema": {"unique_id": "macro.dbt_bigquery.bigquery__create_schema", "package_name": "dbt_bigquery", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.2.0/libexec/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "name": "bigquery__create_schema", "macro_sql": "{% macro bigquery__create_schema(relation) -%}\n {{ adapter.create_schema(relation) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600952.814757}, "macro.dbt_bigquery.bigquery__drop_schema": {"unique_id": "macro.dbt_bigquery.bigquery__drop_schema", "package_name": "dbt_bigquery", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.2.0/libexec/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "name": "bigquery__drop_schema", "macro_sql": "{% macro bigquery__drop_schema(relation) -%}\n {{ adapter.drop_schema(relation) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600952.81488}, "macro.dbt_bigquery.bigquery__drop_relation": {"unique_id": "macro.dbt_bigquery.bigquery__drop_relation", "package_name": "dbt_bigquery", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.2.0/libexec/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "name": "bigquery__drop_relation", "macro_sql": "{% macro bigquery__drop_relation(relation) -%}\n {% call statement('drop_relation') -%}\n drop {{ relation.type }} if exists {{ relation }}\n {%- endcall %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600952.815063}, "macro.dbt_bigquery.bigquery__get_columns_in_relation": {"unique_id": "macro.dbt_bigquery.bigquery__get_columns_in_relation", "package_name": "dbt_bigquery", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.2.0/libexec/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "name": "bigquery__get_columns_in_relation", "macro_sql": "{% macro bigquery__get_columns_in_relation(relation) -%}\n {{ return(adapter.get_columns_in_relation(relation)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600952.815208}, "macro.dbt_bigquery.bigquery__list_relations_without_caching": {"unique_id": "macro.dbt_bigquery.bigquery__list_relations_without_caching", "package_name": "dbt_bigquery", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.2.0/libexec/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "name": "bigquery__list_relations_without_caching", "macro_sql": "{% macro bigquery__list_relations_without_caching(schema_relation) -%}\n {{ return(adapter.list_relations_without_caching(schema_relation)) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600952.81535}, "macro.dbt_bigquery.bigquery__current_timestamp": {"unique_id": "macro.dbt_bigquery.bigquery__current_timestamp", "package_name": "dbt_bigquery", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.2.0/libexec/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "name": "bigquery__current_timestamp", "macro_sql": "{% macro bigquery__current_timestamp() -%}\n CURRENT_TIMESTAMP()\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600952.815423}, "macro.dbt_bigquery.bigquery__snapshot_string_as_time": {"unique_id": "macro.dbt_bigquery.bigquery__snapshot_string_as_time", "package_name": "dbt_bigquery", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.2.0/libexec/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "name": "bigquery__snapshot_string_as_time", "macro_sql": "{% macro bigquery__snapshot_string_as_time(timestamp) -%}\n {%- set result = 'TIMESTAMP(\"' ~ timestamp ~ '\")' -%}\n {{ return(result) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600952.8155909}, "macro.dbt_bigquery.bigquery__list_schemas": {"unique_id": "macro.dbt_bigquery.bigquery__list_schemas", "package_name": "dbt_bigquery", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.2.0/libexec/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "name": "bigquery__list_schemas", "macro_sql": "{% macro bigquery__list_schemas(database) -%}\n {{ return(adapter.list_schemas(database)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600952.8158}, "macro.dbt_bigquery.bigquery__check_schema_exists": {"unique_id": "macro.dbt_bigquery.bigquery__check_schema_exists", "package_name": "dbt_bigquery", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.2.0/libexec/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "name": "bigquery__check_schema_exists", "macro_sql": "{% macro bigquery__check_schema_exists(information_schema, schema) %}\n {{ return(adapter.check_schema_exists(information_schema.database, schema)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600952.81598}, "macro.dbt_bigquery.bigquery__persist_docs": {"unique_id": "macro.dbt_bigquery.bigquery__persist_docs", "package_name": "dbt_bigquery", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.2.0/libexec/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "name": "bigquery__persist_docs", "macro_sql": "{% macro bigquery__persist_docs(relation, model, for_relation, for_columns) -%}\n {% if for_columns and config.persist_column_docs() and model.columns %}\n {% do alter_column_comment(relation, model.columns) %}\n {% endif %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.alter_column_comment"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600952.816252}, "macro.dbt_bigquery.bigquery__alter_column_comment": {"unique_id": "macro.dbt_bigquery.bigquery__alter_column_comment", "package_name": "dbt_bigquery", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.2.0/libexec/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "name": "bigquery__alter_column_comment", "macro_sql": "{% macro bigquery__alter_column_comment(relation, column_dict) -%}\n {% do adapter.update_columns(relation, column_dict) %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600952.816406}, "macro.dbt_bigquery.bigquery__rename_relation": {"unique_id": "macro.dbt_bigquery.bigquery__rename_relation", "package_name": "dbt_bigquery", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.2.0/libexec/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "name": "bigquery__rename_relation", "macro_sql": "{% macro bigquery__rename_relation(from_relation, to_relation) -%}\n {% do adapter.rename_relation(from_relation, to_relation) %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600952.816554}, "macro.dbt_bigquery.bigquery__alter_relation_add_columns": {"unique_id": "macro.dbt_bigquery.bigquery__alter_relation_add_columns", "package_name": "dbt_bigquery", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.2.0/libexec/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "name": "bigquery__alter_relation_add_columns", "macro_sql": "{% macro bigquery__alter_relation_add_columns(relation, add_columns) %}\n\n {% set sql -%}\n\n alter {{ relation.type }} {{ relation }}\n {% for column in add_columns %}\n add column {{ column.name }} {{ column.data_type }}{{ ',' if not loop.last }}\n {% endfor %}\n\n {%- endset -%}\n\n {{ return(run_query(sql)) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.run_query"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600952.816938}, "macro.dbt_bigquery.bigquery__alter_relation_drop_columns": {"unique_id": "macro.dbt_bigquery.bigquery__alter_relation_drop_columns", "package_name": "dbt_bigquery", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.2.0/libexec/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "name": "bigquery__alter_relation_drop_columns", "macro_sql": "{% macro bigquery__alter_relation_drop_columns(relation, drop_columns) %}\n\n {% set sql -%}\n\n alter {{ relation.type }} {{ relation }}\n\n {% for column in drop_columns %}\n drop column {{ column.name }}{{ ',' if not loop.last }}\n {% endfor %}\n\n {%- endset -%}\n\n {{ return(run_query(sql)) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.run_query"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600952.817307}, "macro.dbt_bigquery.bigquery__alter_column_type": {"unique_id": "macro.dbt_bigquery.bigquery__alter_column_type", "package_name": "dbt_bigquery", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.2.0/libexec/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "name": "bigquery__alter_column_type", "macro_sql": "{% macro bigquery__alter_column_type(relation, column_name, new_column_type) -%}\n {#-- Changing a column's data type using a query requires you to scan the entire table.\n The query charges can be significant if the table is very large.\n\n https://cloud.google.com/bigquery/docs/manually-changing-schemas#changing_a_columns_data_type\n #}\n {% set relation_columns = get_columns_in_relation(relation) %}\n\n {% set sql %}\n select\n {%- for col in relation_columns -%}\n {% if col.column == column_name %}\n CAST({{ col.quoted }} AS {{ new_column_type }}) AS {{ col.quoted }}\n {%- else %}\n {{ col.quoted }}\n {%- endif %}\n {%- if not loop.last %},{% endif -%}\n {%- endfor %}\n from {{ relation }}\n {% endset %}\n\n {% call statement('alter_column_type') %}\n {{ create_table_as(False, relation, sql)}}\n {%- endcall %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.get_columns_in_relation", "macro.dbt.statement", "macro.dbt.create_table_as"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600952.81795}, "macro.dbt_bigquery.bigquery__test_unique": {"unique_id": "macro.dbt_bigquery.bigquery__test_unique", "package_name": "dbt_bigquery", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.2.0/libexec/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "name": "bigquery__test_unique", "macro_sql": "{% macro bigquery__test_unique(model, column_name) %}\n\nwith dbt_test__target as (\n\n select {{ column_name }} as unique_field\n from {{ model }}\n where {{ column_name }} is not null\n\n)\n\nselect\n unique_field,\n count(*) as n_records\n\nfrom dbt_test__target\ngroup by unique_field\nhaving count(*) > 1\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600952.818114}, "macro.dbt_bigquery.bigquery__upload_file": {"unique_id": "macro.dbt_bigquery.bigquery__upload_file", "package_name": "dbt_bigquery", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.2.0/libexec/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "name": "bigquery__upload_file", "macro_sql": "{% macro bigquery__upload_file(local_file_path, database, table_schema, table_name) %}\n\n {{ log(\"kwargs: \" ~ kwargs) }}\n\n {% do adapter.upload_file(local_file_path, database, table_schema, table_name, kwargs=kwargs) %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600952.818385}, "macro.dbt_bigquery.bigquery__create_csv_table": {"unique_id": "macro.dbt_bigquery.bigquery__create_csv_table", "package_name": "dbt_bigquery", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.2.0/libexec/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/materializations/seed.sql", "original_file_path": "macros/materializations/seed.sql", "name": "bigquery__create_csv_table", "macro_sql": "{% macro bigquery__create_csv_table(model, agate_table) %}\n -- no-op\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600952.818757}, "macro.dbt_bigquery.bigquery__reset_csv_table": {"unique_id": "macro.dbt_bigquery.bigquery__reset_csv_table", "package_name": "dbt_bigquery", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.2.0/libexec/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/materializations/seed.sql", "original_file_path": "macros/materializations/seed.sql", "name": "bigquery__reset_csv_table", "macro_sql": "{% macro bigquery__reset_csv_table(model, full_refresh, old_relation, agate_table) %}\n {{ adapter.drop_relation(old_relation) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600952.81891}, "macro.dbt_bigquery.bigquery__load_csv_rows": {"unique_id": "macro.dbt_bigquery.bigquery__load_csv_rows", "package_name": "dbt_bigquery", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.2.0/libexec/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/materializations/seed.sql", "original_file_path": "macros/materializations/seed.sql", "name": "bigquery__load_csv_rows", "macro_sql": "{% macro bigquery__load_csv_rows(model, agate_table) %}\n\n {%- set column_override = model['config'].get('column_types', {}) -%}\n {{ adapter.load_dataframe(model['database'], model['schema'], model['alias'],\n \t\t\t\t\t\t\tagate_table, column_override) }}\n {% if config.persist_relation_docs() and 'description' in model %}\n\n \t{{ adapter.update_table_description(model['database'], model['schema'], model['alias'], model['description']) }}\n {% endif %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600952.8195121}, "macro.dbt_bigquery.bigquery__handle_existing_table": {"unique_id": "macro.dbt_bigquery.bigquery__handle_existing_table", "package_name": "dbt_bigquery", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.2.0/libexec/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/materializations/view.sql", "original_file_path": "macros/materializations/view.sql", "name": "bigquery__handle_existing_table", "macro_sql": "{% macro bigquery__handle_existing_table(full_refresh, old_relation) %}\n {%- if full_refresh -%}\n {{ adapter.drop_relation(old_relation) }}\n {%- else -%}\n {{ exceptions.relation_wrong_type(old_relation, 'view') }}\n {%- endif -%}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600952.820108}, "macro.dbt_bigquery.materialization_view_bigquery": {"unique_id": "macro.dbt_bigquery.materialization_view_bigquery", "package_name": "dbt_bigquery", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.2.0/libexec/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/materializations/view.sql", "original_file_path": "macros/materializations/view.sql", "name": "materialization_view_bigquery", "macro_sql": "{% materialization view, adapter='bigquery' -%}\n -- grab current tables grants config for comparision later on\n {% set grant_config = config.get('grants') %}\n\n {% set to_return = create_or_replace_view() %}\n\n {% set target_relation = this.incorporate(type='view') %}\n\n {% do persist_docs(target_relation, model) %}\n\n {% if config.get('grant_access_to') %}\n {% for grant_target_dict in config.get('grant_access_to') %}\n {% do adapter.grant_access_to(this, 'view', None, grant_target_dict) %}\n {% endfor %}\n {% endif %}\n\n {% do return(to_return) %}\n\n{%- endmaterialization %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.create_or_replace_view", "macro.dbt.persist_docs"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600952.820747}, "macro.dbt_bigquery.materialization_table_bigquery": {"unique_id": "macro.dbt_bigquery.materialization_table_bigquery", "package_name": "dbt_bigquery", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.2.0/libexec/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/materializations/table.sql", "original_file_path": "macros/materializations/table.sql", "name": "materialization_table_bigquery", "macro_sql": "{% materialization table, adapter='bigquery' -%}\n\n {%- set identifier = model['alias'] -%}\n {%- set old_relation = adapter.get_relation(database=database, schema=schema, identifier=identifier) -%}\n {%- set exists_not_as_table = (old_relation is not none and not old_relation.is_table) -%}\n {%- set target_relation = api.Relation.create(database=database, schema=schema, identifier=identifier, type='table') -%}\n\n -- grab current tables grants config for comparision later on\n {%- set grant_config = config.get('grants') -%}\n\n {{ run_hooks(pre_hooks) }}\n\n {#\n We only need to drop this thing if it is not a table.\n If it _is_ already a table, then we can overwrite it without downtime\n Unlike table -> view, no need for `--full-refresh`: dropping a view is no big deal\n #}\n {%- if exists_not_as_table -%}\n {{ adapter.drop_relation(old_relation) }}\n {%- endif -%}\n\n -- build model\n {%- set raw_partition_by = config.get('partition_by', none) -%}\n {%- set partition_by = adapter.parse_partition_by(raw_partition_by) -%}\n {%- set cluster_by = config.get('cluster_by', none) -%}\n {% if not adapter.is_replaceable(old_relation, partition_by, cluster_by) %}\n {% do log(\"Hard refreshing \" ~ old_relation ~ \" because it is not replaceable\") %}\n {% do adapter.drop_relation(old_relation) %}\n {% endif %}\n {% call statement('main') -%}\n {{ create_table_as(False, target_relation, sql) }}\n {% endcall -%}\n\n {{ run_hooks(post_hooks) }}\n\n {% set should_revoke = should_revoke(old_relation, full_refresh_mode=True) %}\n {% do apply_grants(target_relation, grant_config, should_revoke) %}\n\n {% do persist_docs(target_relation, model) %}\n\n {{ return({'relations': [target_relation]}) }}\n\n{% endmaterialization %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.run_hooks", "macro.dbt.statement", "macro.dbt.create_table_as", "macro.dbt.should_revoke", "macro.dbt.apply_grants", "macro.dbt.persist_docs"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600952.822846}, "macro.dbt_bigquery.materialization_copy_bigquery": {"unique_id": "macro.dbt_bigquery.materialization_copy_bigquery", "package_name": "dbt_bigquery", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.2.0/libexec/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/materializations/copy.sql", "original_file_path": "macros/materializations/copy.sql", "name": "materialization_copy_bigquery", "macro_sql": "{% materialization copy, adapter='bigquery' -%}\n\n {# Setup #}\n {{ run_hooks(pre_hooks) }}\n\n {% set destination = this.incorporate(type='table') %}\n\n {# there can be several ref() or source() according to BQ copy API docs #}\n {# cycle over ref() and source() to create source tables array #}\n {% set source_array = [] %}\n {% for ref_table in model.refs %}\n {{ source_array.append(ref(*ref_table)) }}\n {% endfor %}\n\n {% for src_table in model.sources %}\n {{ source_array.append(source(*src_table)) }}\n {% endfor %}\n\n {# Call adapter copy_table function #}\n {%- set result_str = adapter.copy_table(\n source_array,\n destination,\n config.get('copy_materialization', default = 'table')) -%}\n\n {{ store_result('main', response=result_str) }}\n\n {# Clean up #}\n {{ run_hooks(post_hooks) }}\n {%- do apply_grants(target_relation, grant_config) -%}\n {{ adapter.commit() }}\n\n {{ return({'relations': [destination]}) }}\n{%- endmaterialization %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.run_hooks", "macro.dbt.apply_grants"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600952.824051}, "macro.dbt_bigquery.declare_dbt_max_partition": {"unique_id": "macro.dbt_bigquery.declare_dbt_max_partition", "package_name": "dbt_bigquery", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.2.0/libexec/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/materializations/incremental.sql", "original_file_path": "macros/materializations/incremental.sql", "name": "declare_dbt_max_partition", "macro_sql": "{% macro declare_dbt_max_partition(relation, partition_by, sql) %}\n\n {% if '_dbt_max_partition' in sql %}\n\n declare _dbt_max_partition {{ partition_by.data_type }} default (\n select max({{ partition_by.field }}) from {{ this }}\n where {{ partition_by.field }} is not null\n );\n\n {% endif %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600952.8259299}, "macro.dbt_bigquery.dbt_bigquery_validate_get_incremental_strategy": {"unique_id": "macro.dbt_bigquery.dbt_bigquery_validate_get_incremental_strategy", "package_name": "dbt_bigquery", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.2.0/libexec/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/materializations/incremental.sql", "original_file_path": "macros/materializations/incremental.sql", "name": "dbt_bigquery_validate_get_incremental_strategy", "macro_sql": "{% macro dbt_bigquery_validate_get_incremental_strategy(config) %}\n {#-- Find and validate the incremental strategy #}\n {%- set strategy = config.get(\"incremental_strategy\", default=\"merge\") -%}\n\n {% set invalid_strategy_msg -%}\n Invalid incremental strategy provided: {{ strategy }}\n Expected one of: 'merge', 'insert_overwrite'\n {%- endset %}\n {% if strategy not in ['merge', 'insert_overwrite'] %}\n {% do exceptions.raise_compiler_error(invalid_strategy_msg) %}\n {% endif %}\n\n {% do return(strategy) %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600952.826359}, "macro.dbt_bigquery.bq_insert_overwrite": {"unique_id": "macro.dbt_bigquery.bq_insert_overwrite", "package_name": "dbt_bigquery", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.2.0/libexec/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/materializations/incremental.sql", "original_file_path": "macros/materializations/incremental.sql", "name": "bq_insert_overwrite", "macro_sql": "{% macro bq_insert_overwrite(\n tmp_relation, target_relation, sql, unique_key, partition_by, partitions, dest_columns, tmp_relation_exists\n) %}\n\n {% if partitions is not none and partitions != [] %} {# static #}\n\n {% set predicate -%}\n {{ partition_by.render(alias='DBT_INTERNAL_DEST') }} in (\n {{ partitions | join (', ') }}\n )\n {%- endset %}\n\n {%- set source_sql -%}\n (\n {{sql}}\n )\n {%- endset -%}\n\n {{ get_insert_overwrite_merge_sql(target_relation, source_sql, dest_columns, [predicate], include_sql_header=true) }}\n\n {% else %} {# dynamic #}\n\n {% set predicate -%}\n {{ partition_by.render(alias='DBT_INTERNAL_DEST') }} in unnest(dbt_partitions_for_replacement)\n {%- endset %}\n\n {%- set source_sql -%}\n (\n select * from {{ tmp_relation }}\n )\n {%- endset -%}\n\n -- generated script to merge partitions into {{ target_relation }}\n declare dbt_partitions_for_replacement array<{{ partition_by.data_type }}>;\n\n {# have we already created the temp table to check for schema changes? #}\n {% if not tmp_relation_exists %}\n {{ declare_dbt_max_partition(this, partition_by, sql) }}\n\n -- 1. create a temp table\n {{ create_table_as(True, tmp_relation, sql) }}\n {% else %}\n -- 1. temp table already exists, we used it to check for schema changes\n {% endif %}\n\n -- 2. define partitions to update\n set (dbt_partitions_for_replacement) = (\n select as struct\n array_agg(distinct {{ partition_by.render() }})\n from {{ tmp_relation }}\n );\n\n {#\n TODO: include_sql_header is a hack; consider a better approach that includes\n the sql_header at the materialization-level instead\n #}\n -- 3. run the merge statement\n {{ get_insert_overwrite_merge_sql(target_relation, source_sql, dest_columns, [predicate], include_sql_header=false) }};\n\n -- 4. clean up the temp table\n drop table if exists {{ tmp_relation }}\n\n {% endif %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.get_insert_overwrite_merge_sql", "macro.dbt_bigquery.declare_dbt_max_partition", "macro.dbt.create_table_as"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600952.8275552}, "macro.dbt_bigquery.bq_generate_incremental_build_sql": {"unique_id": "macro.dbt_bigquery.bq_generate_incremental_build_sql", "package_name": "dbt_bigquery", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.2.0/libexec/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/materializations/incremental.sql", "original_file_path": "macros/materializations/incremental.sql", "name": "bq_generate_incremental_build_sql", "macro_sql": "{% macro bq_generate_incremental_build_sql(\n strategy, tmp_relation, target_relation, sql, unique_key, partition_by, partitions, dest_columns, tmp_relation_exists\n) %}\n {#-- if partitioned, use BQ scripting to get the range of partition values to be updated --#}\n {% if strategy == 'insert_overwrite' %}\n\n {% set missing_partition_msg -%}\n The 'insert_overwrite' strategy requires the `partition_by` config.\n {%- endset %}\n {% if partition_by is none %}\n {% do exceptions.raise_compiler_error(missing_partition_msg) %}\n {% endif %}\n\n {% set build_sql = bq_insert_overwrite(\n tmp_relation, target_relation, sql, unique_key, partition_by, partitions, dest_columns, tmp_relation_exists\n ) %}\n\n {% else %} {# strategy == 'merge' #}\n {%- set source_sql -%}\n {%- if tmp_relation_exists -%}\n (\n select * from {{ tmp_relation }}\n )\n {%- else -%} {#-- wrap sql in parens to make it a subquery --#}\n (\n {{sql}}\n )\n {%- endif -%}\n {%- endset -%}\n\n {% set build_sql = get_merge_sql(target_relation, source_sql, unique_key, dest_columns) %}\n\n {% endif %}\n\n {{ return(build_sql) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bq_insert_overwrite", "macro.dbt.get_merge_sql"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600952.8283892}, "macro.dbt_bigquery.materialization_incremental_bigquery": {"unique_id": "macro.dbt_bigquery.materialization_incremental_bigquery", "package_name": "dbt_bigquery", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.2.0/libexec/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/materializations/incremental.sql", "original_file_path": "macros/materializations/incremental.sql", "name": "materialization_incremental_bigquery", "macro_sql": "{% materialization incremental, adapter='bigquery' -%}\n\n {%- set unique_key = config.get('unique_key') -%}\n {%- set full_refresh_mode = (should_full_refresh()) -%}\n\n {%- set target_relation = this %}\n {%- set existing_relation = load_relation(this) %}\n {%- set tmp_relation = make_temp_relation(this) %}\n\n {#-- Validate early so we don't run SQL if the strategy is invalid --#}\n {% set strategy = dbt_bigquery_validate_get_incremental_strategy(config) -%}\n\n {%- set raw_partition_by = config.get('partition_by', none) -%}\n {%- set partition_by = adapter.parse_partition_by(raw_partition_by) -%}\n {%- set partitions = config.get('partitions', none) -%}\n {%- set cluster_by = config.get('cluster_by', none) -%}\n\n {% set on_schema_change = incremental_validate_on_schema_change(config.get('on_schema_change'), default='ignore') %}\n\n -- grab current tables grants config for comparision later on\n {% set grant_config = config.get('grants') %}\n\n {{ run_hooks(pre_hooks) }}\n\n {% if existing_relation is none %}\n {% set build_sql = create_table_as(False, target_relation, sql) %}\n\n {% elif existing_relation.is_view %}\n {#-- There's no way to atomically replace a view with a table on BQ --#}\n {{ adapter.drop_relation(existing_relation) }}\n {% set build_sql = create_table_as(False, target_relation, sql) %}\n\n {% elif full_refresh_mode %}\n {#-- If the partition/cluster config has changed, then we must drop and recreate --#}\n {% if not adapter.is_replaceable(existing_relation, partition_by, cluster_by) %}\n {% do log(\"Hard refreshing \" ~ existing_relation ~ \" because it is not replaceable\") %}\n {{ adapter.drop_relation(existing_relation) }}\n {% endif %}\n {% set build_sql = create_table_as(False, target_relation, sql) %}\n\n {% else %}\n {% set tmp_relation_exists = false %}\n {% if on_schema_change != 'ignore' %} {# Check first, since otherwise we may not build a temp table #}\n {% do run_query(\n declare_dbt_max_partition(this, partition_by, sql) + create_table_as(True, tmp_relation, sql)\n ) %}\n {% set tmp_relation_exists = true %}\n {#-- Process schema changes. Returns dict of changes if successful. Use source columns for upserting/merging --#}\n {% set dest_columns = process_schema_changes(on_schema_change, tmp_relation, existing_relation) %}\n {% endif %}\n {% if not dest_columns %}\n {% set dest_columns = adapter.get_columns_in_relation(existing_relation) %}\n {% endif %}\n {% set build_sql = bq_generate_incremental_build_sql(\n strategy, tmp_relation, target_relation, sql, unique_key, partition_by, partitions, dest_columns, tmp_relation_exists\n ) %}\n\n {% endif %}\n\n {%- call statement('main') -%}\n {{ build_sql }}\n {% endcall %}\n\n {{ run_hooks(post_hooks) }}\n\n {% set target_relation = this.incorporate(type='table') %}\n\n {% set should_revoke = should_revoke(existing_relation, full_refresh_mode) %}\n {% do apply_grants(target_relation, grant_config, should_revoke) %}\n\n {% do persist_docs(target_relation, model) %}\n\n {{ return({'relations': [target_relation]}) }}\n\n{%- endmaterialization %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.should_full_refresh", "macro.dbt.load_relation", "macro.dbt.make_temp_relation", "macro.dbt_bigquery.dbt_bigquery_validate_get_incremental_strategy", "macro.dbt.incremental_validate_on_schema_change", "macro.dbt.run_hooks", "macro.dbt.create_table_as", "macro.dbt.run_query", "macro.dbt_bigquery.declare_dbt_max_partition", "macro.dbt.process_schema_changes", "macro.dbt_bigquery.bq_generate_incremental_build_sql", "macro.dbt.statement", "macro.dbt.should_revoke", "macro.dbt.apply_grants", "macro.dbt.persist_docs"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600952.8311439}, "macro.dbt_bigquery.bigquery__snapshot_hash_arguments": {"unique_id": "macro.dbt_bigquery.bigquery__snapshot_hash_arguments", "package_name": "dbt_bigquery", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.2.0/libexec/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/materializations/snapshot.sql", "original_file_path": "macros/materializations/snapshot.sql", "name": "bigquery__snapshot_hash_arguments", "macro_sql": "{% macro bigquery__snapshot_hash_arguments(args) -%}\n to_hex(md5(concat({%- for arg in args -%}\n coalesce(cast({{ arg }} as string), ''){% if not loop.last %}, '|',{% endif -%}\n {%- endfor -%}\n )))\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600952.8316128}, "macro.dbt_bigquery.bigquery__create_columns": {"unique_id": "macro.dbt_bigquery.bigquery__create_columns", "package_name": "dbt_bigquery", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.2.0/libexec/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/materializations/snapshot.sql", "original_file_path": "macros/materializations/snapshot.sql", "name": "bigquery__create_columns", "macro_sql": "{% macro bigquery__create_columns(relation, columns) %}\n {{ adapter.alter_table_add_columns(relation, columns) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600952.831767}, "macro.dbt_bigquery.bigquery__post_snapshot": {"unique_id": "macro.dbt_bigquery.bigquery__post_snapshot", "package_name": "dbt_bigquery", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.2.0/libexec/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/materializations/snapshot.sql", "original_file_path": "macros/materializations/snapshot.sql", "name": "bigquery__post_snapshot", "macro_sql": "{% macro bigquery__post_snapshot(staging_relation) %}\n -- Clean up the snapshot temp table\n {% do drop_relation(staging_relation) %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.drop_relation"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600952.831896}, "macro.dbt_bigquery.bigquery__except": {"unique_id": "macro.dbt_bigquery.bigquery__except", "package_name": "dbt_bigquery", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.2.0/libexec/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/utils/except.sql", "original_file_path": "macros/utils/except.sql", "name": "bigquery__except", "macro_sql": "{% macro bigquery__except() %}\n\n except distinct\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600952.832076}, "macro.dbt_bigquery.bigquery__dateadd": {"unique_id": "macro.dbt_bigquery.bigquery__dateadd", "package_name": "dbt_bigquery", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.2.0/libexec/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/utils/dateadd.sql", "original_file_path": "macros/utils/dateadd.sql", "name": "bigquery__dateadd", "macro_sql": "{% macro bigquery__dateadd(datepart, interval, from_date_or_timestamp) %}\n\n datetime_add(\n cast( {{ from_date_or_timestamp }} as datetime),\n interval {{ interval }} {{ datepart }}\n )\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600952.832355}, "macro.dbt_bigquery.bigquery__intersect": {"unique_id": "macro.dbt_bigquery.bigquery__intersect", "package_name": "dbt_bigquery", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.2.0/libexec/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/utils/intersect.sql", "original_file_path": "macros/utils/intersect.sql", "name": "bigquery__intersect", "macro_sql": "{% macro bigquery__intersect() %}\n\n intersect distinct\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600952.832515}, "macro.dbt_bigquery.bigquery__escape_single_quotes": {"unique_id": "macro.dbt_bigquery.bigquery__escape_single_quotes", "package_name": "dbt_bigquery", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.2.0/libexec/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/utils/escape_single_quotes.sql", "original_file_path": "macros/utils/escape_single_quotes.sql", "name": "bigquery__escape_single_quotes", "macro_sql": "{% macro bigquery__escape_single_quotes(expression) -%}\n{{ expression | replace(\"'\", \"\\\\'\") }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600952.832766}, "macro.dbt_bigquery.bigquery__right": {"unique_id": "macro.dbt_bigquery.bigquery__right", "package_name": "dbt_bigquery", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.2.0/libexec/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/utils/right.sql", "original_file_path": "macros/utils/right.sql", "name": "bigquery__right", "macro_sql": "{% macro bigquery__right(string_text, length_expression) %}\n\n case when {{ length_expression }} = 0\n then ''\n else\n substr(\n {{ string_text }},\n -1 * ({{ length_expression }})\n )\n end\n\n{%- endmacro -%}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600952.833057}, "macro.dbt_bigquery.bigquery__listagg": {"unique_id": "macro.dbt_bigquery.bigquery__listagg", "package_name": "dbt_bigquery", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.2.0/libexec/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/utils/listagg.sql", "original_file_path": "macros/utils/listagg.sql", "name": "bigquery__listagg", "macro_sql": "{% macro bigquery__listagg(measure, delimiter_text, order_by_clause, limit_num) -%}\n\n string_agg(\n {{ measure }},\n {{ delimiter_text }}\n {% if order_by_clause -%}\n {{ order_by_clause }}\n {%- endif %}\n {% if limit_num -%}\n limit {{ limit_num }}\n {%- endif %}\n )\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600952.833498}, "macro.dbt_bigquery.bigquery__datediff": {"unique_id": "macro.dbt_bigquery.bigquery__datediff", "package_name": "dbt_bigquery", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.2.0/libexec/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/utils/datediff.sql", "original_file_path": "macros/utils/datediff.sql", "name": "bigquery__datediff", "macro_sql": "{% macro bigquery__datediff(first_date, second_date, datepart) -%}\n\n {% if dbt_version[0] == 1 and dbt_version[2] >= 2 %}\n {{ return(dbt.datediff(first_date, second_date, datepart)) }}\n {% else %}\n\n datetime_diff(\n cast({{second_date}} as datetime),\n cast({{first_date}} as datetime),\n {{datepart}}\n )\n\n {% endif %}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.datediff"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600952.834039}, "macro.dbt_bigquery.bigquery__safe_cast": {"unique_id": "macro.dbt_bigquery.bigquery__safe_cast", "package_name": "dbt_bigquery", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.2.0/libexec/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/utils/safe_cast.sql", "original_file_path": "macros/utils/safe_cast.sql", "name": "bigquery__safe_cast", "macro_sql": "{% macro bigquery__safe_cast(field, type) %}\n safe_cast({{field}} as {{type}})\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600952.834261}, "macro.dbt_bigquery.bigquery__hash": {"unique_id": "macro.dbt_bigquery.bigquery__hash", "package_name": "dbt_bigquery", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.2.0/libexec/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/utils/hash.sql", "original_file_path": "macros/utils/hash.sql", "name": "bigquery__hash", "macro_sql": "{% macro bigquery__hash(field) -%}\n to_hex({{dbt.default__hash(field)}})\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__hash"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600952.834482}, "macro.dbt_bigquery.bigquery__position": {"unique_id": "macro.dbt_bigquery.bigquery__position", "package_name": "dbt_bigquery", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.2.0/libexec/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/utils/position.sql", "original_file_path": "macros/utils/position.sql", "name": "bigquery__position", "macro_sql": "{% macro bigquery__position(substring_text, string_text) %}\n\n strpos(\n {{ string_text }},\n {{ substring_text }}\n\n )\n\n{%- endmacro -%}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600952.834713}, "macro.dbt_bigquery.bigquery__bool_or": {"unique_id": "macro.dbt_bigquery.bigquery__bool_or", "package_name": "dbt_bigquery", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.2.0/libexec/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/utils/bool_or.sql", "original_file_path": "macros/utils/bool_or.sql", "name": "bigquery__bool_or", "macro_sql": "{% macro bigquery__bool_or(expression) -%}\n\n logical_or({{ expression }})\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600952.834906}, "macro.dbt_bigquery.bigquery__split_part": {"unique_id": "macro.dbt_bigquery.bigquery__split_part", "package_name": "dbt_bigquery", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.2.0/libexec/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/utils/split_part.sql", "original_file_path": "macros/utils/split_part.sql", "name": "bigquery__split_part", "macro_sql": "{% macro bigquery__split_part(string_text, delimiter_text, part_number) %}\n\n {% if part_number >= 0 %}\n split(\n {{ string_text }},\n {{ delimiter_text }}\n )[safe_offset({{ part_number - 1 }})]\n {% else %}\n split(\n {{ string_text }},\n {{ delimiter_text }}\n )[safe_offset(\n length({{ string_text }})\n - length(\n replace({{ string_text }}, {{ delimiter_text }}, '')\n ) + 1\n )]\n {% endif %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600952.8355148}, "macro.dbt_bigquery.bigquery__date_trunc": {"unique_id": "macro.dbt_bigquery.bigquery__date_trunc", "package_name": "dbt_bigquery", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.2.0/libexec/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/utils/date_trunc.sql", "original_file_path": "macros/utils/date_trunc.sql", "name": "bigquery__date_trunc", "macro_sql": "{% macro bigquery__date_trunc(datepart, date) -%}\n timestamp_trunc(\n cast({{date}} as timestamp),\n {{datepart}}\n )\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600952.835747}, "macro.dbt_bigquery.bigquery__get_show_grant_sql": {"unique_id": "macro.dbt_bigquery.bigquery__get_show_grant_sql", "package_name": "dbt_bigquery", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.2.0/libexec/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "name": "bigquery__get_show_grant_sql", "macro_sql": "{% macro bigquery__get_show_grant_sql(relation) %}\n {% set location = adapter.get_dataset_location(relation) %}\n {% set relation = relation.incorporate(location=location) %}\n\n select privilege_type, grantee\n from {{ relation.information_schema(\"OBJECT_PRIVILEGES\") }}\n where object_schema = \"{{ relation.dataset }}\"\n and object_name = \"{{ relation.identifier }}\"\n -- filter out current user\n and split(grantee, ':')[offset(1)] != session_user()\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600952.836412}, "macro.dbt_bigquery.bigquery__get_grant_sql": {"unique_id": "macro.dbt_bigquery.bigquery__get_grant_sql", "package_name": "dbt_bigquery", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.2.0/libexec/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "name": "bigquery__get_grant_sql", "macro_sql": "\n\n\n{%- macro bigquery__get_grant_sql(relation, privilege, grantee) -%}\n grant `{{ privilege }}` on {{ relation.type }} {{ relation }} to {{ '\\\"' + grantee|join('\\\", \\\"') + '\\\"' }}\n{%- endmacro -%}\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600952.836711}, "macro.dbt_bigquery.bigquery__get_revoke_sql": {"unique_id": "macro.dbt_bigquery.bigquery__get_revoke_sql", "package_name": "dbt_bigquery", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.2.0/libexec/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "name": "bigquery__get_revoke_sql", "macro_sql": "{%- macro bigquery__get_revoke_sql(relation, privilege, grantee) -%}\n revoke `{{ privilege }}` on {{ relation.type }} {{ relation }} from {{ '\\\"' + grantee|join('\\\", \\\"') + '\\\"' }}\n{%- endmacro -%}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600952.836946}, "macro.dbt.run_hooks": {"unique_id": "macro.dbt.run_hooks", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.2.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/hooks.sql", "original_file_path": "macros/materializations/hooks.sql", "name": "run_hooks", "macro_sql": "{% macro run_hooks(hooks, inside_transaction=True) %}\n {% for hook in hooks | selectattr('transaction', 'equalto', inside_transaction) %}\n {% if not inside_transaction and loop.first %}\n {% call statement(auto_begin=inside_transaction) %}\n commit;\n {% endcall %}\n {% endif %}\n {% set rendered = render(hook.get('sql')) | trim %}\n {% if (rendered | length) > 0 %}\n {% call statement(auto_begin=inside_transaction) %}\n {{ rendered }}\n {% endcall %}\n {% endif %}\n {% endfor %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600952.838031}, "macro.dbt.make_hook_config": {"unique_id": "macro.dbt.make_hook_config", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.2.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/hooks.sql", "original_file_path": "macros/materializations/hooks.sql", "name": "make_hook_config", "macro_sql": "{% macro make_hook_config(sql, inside_transaction) %}\n {{ tojson({\"sql\": sql, \"transaction\": inside_transaction}) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600952.838225}, "macro.dbt.before_begin": {"unique_id": "macro.dbt.before_begin", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.2.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/hooks.sql", "original_file_path": "macros/materializations/hooks.sql", "name": "before_begin", "macro_sql": "{% macro before_begin(sql) %}\n {{ make_hook_config(sql, inside_transaction=False) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.make_hook_config"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600952.838363}, "macro.dbt.in_transaction": {"unique_id": "macro.dbt.in_transaction", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.2.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/hooks.sql", "original_file_path": "macros/materializations/hooks.sql", "name": "in_transaction", "macro_sql": "{% macro in_transaction(sql) %}\n {{ make_hook_config(sql, inside_transaction=True) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.make_hook_config"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600952.8385}, "macro.dbt.after_commit": {"unique_id": "macro.dbt.after_commit", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.2.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/hooks.sql", "original_file_path": "macros/materializations/hooks.sql", "name": "after_commit", "macro_sql": "{% macro after_commit(sql) %}\n {{ make_hook_config(sql, inside_transaction=False) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.make_hook_config"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600952.838638}, "macro.dbt.set_sql_header": {"unique_id": "macro.dbt.set_sql_header", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.2.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/configs.sql", "original_file_path": "macros/materializations/configs.sql", "name": "set_sql_header", "macro_sql": "{% macro set_sql_header(config) -%}\n {{ config.set('sql_header', caller()) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600952.839063}, "macro.dbt.should_full_refresh": {"unique_id": "macro.dbt.should_full_refresh", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.2.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/configs.sql", "original_file_path": "macros/materializations/configs.sql", "name": "should_full_refresh", "macro_sql": "{% macro should_full_refresh() %}\n {% set config_full_refresh = config.get('full_refresh') %}\n {% if config_full_refresh is none %}\n {% set config_full_refresh = flags.FULL_REFRESH %}\n {% endif %}\n {% do return(config_full_refresh) %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600952.839356}, "macro.dbt.should_store_failures": {"unique_id": "macro.dbt.should_store_failures", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.2.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/configs.sql", "original_file_path": "macros/materializations/configs.sql", "name": "should_store_failures", "macro_sql": "{% macro should_store_failures() %}\n {% set config_store_failures = config.get('store_failures') %}\n {% if config_store_failures is none %}\n {% set config_store_failures = flags.STORE_FAILURES %}\n {% endif %}\n {% do return(config_store_failures) %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600952.839654}, "macro.dbt.snapshot_merge_sql": {"unique_id": "macro.dbt.snapshot_merge_sql", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.2.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshots/snapshot_merge.sql", "original_file_path": "macros/materializations/snapshots/snapshot_merge.sql", "name": "snapshot_merge_sql", "macro_sql": "{% macro snapshot_merge_sql(target, source, insert_cols) -%}\n {{ adapter.dispatch('snapshot_merge_sql', 'dbt')(target, source, insert_cols) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__snapshot_merge_sql"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600952.840126}, "macro.dbt.default__snapshot_merge_sql": {"unique_id": "macro.dbt.default__snapshot_merge_sql", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.2.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshots/snapshot_merge.sql", "original_file_path": "macros/materializations/snapshots/snapshot_merge.sql", "name": "default__snapshot_merge_sql", "macro_sql": "{% macro default__snapshot_merge_sql(target, source, insert_cols) -%}\n {%- set insert_cols_csv = insert_cols | join(', ') -%}\n\n merge into {{ target }} as DBT_INTERNAL_DEST\n using {{ source }} as DBT_INTERNAL_SOURCE\n on DBT_INTERNAL_SOURCE.dbt_scd_id = DBT_INTERNAL_DEST.dbt_scd_id\n\n when matched\n and DBT_INTERNAL_DEST.dbt_valid_to is null\n and DBT_INTERNAL_SOURCE.dbt_change_type in ('update', 'delete')\n then update\n set dbt_valid_to = DBT_INTERNAL_SOURCE.dbt_valid_to\n\n when not matched\n and DBT_INTERNAL_SOURCE.dbt_change_type = 'insert'\n then insert ({{ insert_cols_csv }})\n values ({{ insert_cols_csv }})\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600952.840387}, "macro.dbt.strategy_dispatch": {"unique_id": "macro.dbt.strategy_dispatch", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.2.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshots/strategies.sql", "original_file_path": "macros/materializations/snapshots/strategies.sql", "name": "strategy_dispatch", "macro_sql": "{% macro strategy_dispatch(name) -%}\n{% set original_name = name %}\n {% if '.' in name %}\n {% set package_name, name = name.split(\".\", 1) %}\n {% else %}\n {% set package_name = none %}\n {% endif %}\n\n {% if package_name is none %}\n {% set package_context = context %}\n {% elif package_name in context %}\n {% set package_context = context[package_name] %}\n {% else %}\n {% set error_msg %}\n Could not find package '{{package_name}}', called with '{{original_name}}'\n {% endset %}\n {{ exceptions.raise_compiler_error(error_msg | trim) }}\n {% endif %}\n\n {%- set search_name = 'snapshot_' ~ name ~ '_strategy' -%}\n\n {% if search_name not in package_context %}\n {% set error_msg %}\n The specified strategy macro '{{name}}' was not found in package '{{ package_name }}'\n {% endset %}\n {{ exceptions.raise_compiler_error(error_msg | trim) }}\n {% endif %}\n {{ return(package_context[search_name]) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600952.843665}, "macro.dbt.snapshot_hash_arguments": {"unique_id": "macro.dbt.snapshot_hash_arguments", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.2.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshots/strategies.sql", "original_file_path": "macros/materializations/snapshots/strategies.sql", "name": "snapshot_hash_arguments", "macro_sql": "{% macro snapshot_hash_arguments(args) -%}\n {{ adapter.dispatch('snapshot_hash_arguments', 'dbt')(args) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__snapshot_hash_arguments"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600952.84383}, "macro.dbt.default__snapshot_hash_arguments": {"unique_id": "macro.dbt.default__snapshot_hash_arguments", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.2.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshots/strategies.sql", "original_file_path": "macros/materializations/snapshots/strategies.sql", "name": "default__snapshot_hash_arguments", "macro_sql": "{% macro default__snapshot_hash_arguments(args) -%}\n md5({%- for arg in args -%}\n coalesce(cast({{ arg }} as varchar ), '')\n {% if not loop.last %} || '|' || {% endif %}\n {%- endfor -%})\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600952.8440452}, "macro.dbt.snapshot_get_time": {"unique_id": "macro.dbt.snapshot_get_time", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.2.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshots/strategies.sql", "original_file_path": "macros/materializations/snapshots/strategies.sql", "name": "snapshot_get_time", "macro_sql": "{% macro snapshot_get_time() -%}\n {{ adapter.dispatch('snapshot_get_time', 'dbt')() }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__snapshot_get_time"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600952.844186}, "macro.dbt.default__snapshot_get_time": {"unique_id": "macro.dbt.default__snapshot_get_time", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.2.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshots/strategies.sql", "original_file_path": "macros/materializations/snapshots/strategies.sql", "name": "default__snapshot_get_time", "macro_sql": "{% macro default__snapshot_get_time() -%}\n {{ current_timestamp() }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.current_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600952.84428}, "macro.dbt.snapshot_timestamp_strategy": {"unique_id": "macro.dbt.snapshot_timestamp_strategy", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.2.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshots/strategies.sql", "original_file_path": "macros/materializations/snapshots/strategies.sql", "name": "snapshot_timestamp_strategy", "macro_sql": "{% macro snapshot_timestamp_strategy(node, snapshotted_rel, current_rel, config, target_exists) %}\n {% set primary_key = config['unique_key'] %}\n {% set updated_at = config['updated_at'] %}\n {% set invalidate_hard_deletes = config.get('invalidate_hard_deletes', false) %}\n\n {#/*\n The snapshot relation might not have an {{ updated_at }} value if the\n snapshot strategy is changed from `check` to `timestamp`. We\n should use a dbt-created column for the comparison in the snapshot\n table instead of assuming that the user-supplied {{ updated_at }}\n will be present in the historical data.\n\n See https://github.com/dbt-labs/dbt-core/issues/2350\n */ #}\n {% set row_changed_expr -%}\n ({{ snapshotted_rel }}.dbt_valid_from < {{ current_rel }}.{{ updated_at }})\n {%- endset %}\n\n {% set scd_id_expr = snapshot_hash_arguments([primary_key, updated_at]) %}\n\n {% do return({\n \"unique_key\": primary_key,\n \"updated_at\": updated_at,\n \"row_changed\": row_changed_expr,\n \"scd_id\": scd_id_expr,\n \"invalidate_hard_deletes\": invalidate_hard_deletes\n }) %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.snapshot_hash_arguments"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600952.845043}, "macro.dbt.snapshot_string_as_time": {"unique_id": "macro.dbt.snapshot_string_as_time", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.2.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshots/strategies.sql", "original_file_path": "macros/materializations/snapshots/strategies.sql", "name": "snapshot_string_as_time", "macro_sql": "{% macro snapshot_string_as_time(timestamp) -%}\n {{ adapter.dispatch('snapshot_string_as_time', 'dbt')(timestamp) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__snapshot_string_as_time"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600952.845205}, "macro.dbt.default__snapshot_string_as_time": {"unique_id": "macro.dbt.default__snapshot_string_as_time", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.2.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshots/strategies.sql", "original_file_path": "macros/materializations/snapshots/strategies.sql", "name": "default__snapshot_string_as_time", "macro_sql": "{% macro default__snapshot_string_as_time(timestamp) %}\n {% do exceptions.raise_not_implemented(\n 'snapshot_string_as_time macro not implemented for adapter '+adapter.type()\n ) %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600952.845372}, "macro.dbt.snapshot_check_all_get_existing_columns": {"unique_id": "macro.dbt.snapshot_check_all_get_existing_columns", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.2.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshots/strategies.sql", "original_file_path": "macros/materializations/snapshots/strategies.sql", "name": "snapshot_check_all_get_existing_columns", "macro_sql": "{% macro snapshot_check_all_get_existing_columns(node, target_exists, check_cols_config) -%}\n {%- if not target_exists -%}\n {#-- no table yet -> return whatever the query does --#}\n {{ return((false, query_columns)) }}\n {%- endif -%}\n\n {#-- handle any schema changes --#}\n {%- set target_relation = adapter.get_relation(database=node.database, schema=node.schema, identifier=node.alias) -%}\n\n {% if check_cols_config == 'all' %}\n {%- set query_columns = get_columns_in_query(node['compiled_sql']) -%}\n\n {% elif check_cols_config is iterable and (check_cols_config | length) > 0 %}\n {#-- query for proper casing/quoting, to support comparison below --#}\n {%- set select_check_cols_from_target -%}\n select {{ check_cols_config | join(', ') }} from ({{ node['compiled_sql'] }}) subq\n {%- endset -%}\n {% set query_columns = get_columns_in_query(select_check_cols_from_target) %}\n\n {% else %}\n {% do exceptions.raise_compiler_error(\"Invalid value for 'check_cols': \" ~ check_cols_config) %}\n {% endif %}\n\n {%- set existing_cols = adapter.get_columns_in_relation(target_relation) | map(attribute = 'name') | list -%}\n {%- set ns = namespace() -%} {#-- handle for-loop scoping with a namespace --#}\n {%- set ns.column_added = false -%}\n\n {%- set intersection = [] -%}\n {%- for col in query_columns -%}\n {%- if col in existing_cols -%}\n {%- do intersection.append(adapter.quote(col)) -%}\n {%- else -%}\n {% set ns.column_added = true %}\n {%- endif -%}\n {%- endfor -%}\n {{ return((ns.column_added, intersection)) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.get_columns_in_query"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600952.846727}, "macro.dbt.snapshot_check_strategy": {"unique_id": "macro.dbt.snapshot_check_strategy", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.2.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshots/strategies.sql", "original_file_path": "macros/materializations/snapshots/strategies.sql", "name": "snapshot_check_strategy", "macro_sql": "{% macro snapshot_check_strategy(node, snapshotted_rel, current_rel, config, target_exists) %}\n {% set check_cols_config = config['check_cols'] %}\n {% set primary_key = config['unique_key'] %}\n {% set invalidate_hard_deletes = config.get('invalidate_hard_deletes', false) %}\n {% set updated_at = config.get('updated_at', snapshot_get_time()) %}\n\n {% set column_added = false %}\n\n {% set column_added, check_cols = snapshot_check_all_get_existing_columns(node, target_exists, check_cols_config) %}\n\n {%- set row_changed_expr -%}\n (\n {%- if column_added -%}\n {{ get_true_sql() }}\n {%- else -%}\n {%- for col in check_cols -%}\n {{ snapshotted_rel }}.{{ col }} != {{ current_rel }}.{{ col }}\n or\n (\n (({{ snapshotted_rel }}.{{ col }} is null) and not ({{ current_rel }}.{{ col }} is null))\n or\n ((not {{ snapshotted_rel }}.{{ col }} is null) and ({{ current_rel }}.{{ col }} is null))\n )\n {%- if not loop.last %} or {% endif -%}\n {%- endfor -%}\n {%- endif -%}\n )\n {%- endset %}\n\n {% set scd_id_expr = snapshot_hash_arguments([primary_key, updated_at]) %}\n\n {% do return({\n \"unique_key\": primary_key,\n \"updated_at\": updated_at,\n \"row_changed\": row_changed_expr,\n \"scd_id\": scd_id_expr,\n \"invalidate_hard_deletes\": invalidate_hard_deletes\n }) %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.snapshot_get_time", "macro.dbt.snapshot_check_all_get_existing_columns", "macro.dbt.get_true_sql", "macro.dbt.snapshot_hash_arguments"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600952.8479989}, "macro.dbt.create_columns": {"unique_id": "macro.dbt.create_columns", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.2.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshots/helpers.sql", "original_file_path": "macros/materializations/snapshots/helpers.sql", "name": "create_columns", "macro_sql": "{% macro create_columns(relation, columns) %}\n {{ adapter.dispatch('create_columns', 'dbt')(relation, columns) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__create_columns"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600952.851597}, "macro.dbt.default__create_columns": {"unique_id": "macro.dbt.default__create_columns", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.2.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshots/helpers.sql", "original_file_path": "macros/materializations/snapshots/helpers.sql", "name": "default__create_columns", "macro_sql": "{% macro default__create_columns(relation, columns) %}\n {% for column in columns %}\n {% call statement() %}\n alter table {{ relation }} add column \"{{ column.name }}\" {{ column.data_type }};\n {% endcall %}\n {% endfor %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600952.85187}, "macro.dbt.post_snapshot": {"unique_id": "macro.dbt.post_snapshot", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.2.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshots/helpers.sql", "original_file_path": "macros/materializations/snapshots/helpers.sql", "name": "post_snapshot", "macro_sql": "{% macro post_snapshot(staging_relation) %}\n {{ adapter.dispatch('post_snapshot', 'dbt')(staging_relation) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__post_snapshot"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600952.852035}, "macro.dbt.default__post_snapshot": {"unique_id": "macro.dbt.default__post_snapshot", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.2.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshots/helpers.sql", "original_file_path": "macros/materializations/snapshots/helpers.sql", "name": "default__post_snapshot", "macro_sql": "{% macro default__post_snapshot(staging_relation) %}\n {# no-op #}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600952.852118}, "macro.dbt.get_true_sql": {"unique_id": "macro.dbt.get_true_sql", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.2.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshots/helpers.sql", "original_file_path": "macros/materializations/snapshots/helpers.sql", "name": "get_true_sql", "macro_sql": "{% macro get_true_sql() %}\n {{ adapter.dispatch('get_true_sql', 'dbt')() }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__get_true_sql"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600952.852261}, "macro.dbt.default__get_true_sql": {"unique_id": "macro.dbt.default__get_true_sql", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.2.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshots/helpers.sql", "original_file_path": "macros/materializations/snapshots/helpers.sql", "name": "default__get_true_sql", "macro_sql": "{% macro default__get_true_sql() %}\n {{ return('TRUE') }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600952.852371}, "macro.dbt.snapshot_staging_table": {"unique_id": "macro.dbt.snapshot_staging_table", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.2.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshots/helpers.sql", "original_file_path": "macros/materializations/snapshots/helpers.sql", "name": "snapshot_staging_table", "macro_sql": "{% macro snapshot_staging_table(strategy, source_sql, target_relation) -%}\n {{ adapter.dispatch('snapshot_staging_table', 'dbt')(strategy, source_sql, target_relation) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__snapshot_staging_table"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600952.8525708}, "macro.dbt.default__snapshot_staging_table": {"unique_id": "macro.dbt.default__snapshot_staging_table", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.2.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshots/helpers.sql", "original_file_path": "macros/materializations/snapshots/helpers.sql", "name": "default__snapshot_staging_table", "macro_sql": "{% macro default__snapshot_staging_table(strategy, source_sql, target_relation) -%}\n\n with snapshot_query as (\n\n {{ source_sql }}\n\n ),\n\n snapshotted_data as (\n\n select *,\n {{ strategy.unique_key }} as dbt_unique_key\n\n from {{ target_relation }}\n where dbt_valid_to is null\n\n ),\n\n insertions_source_data as (\n\n select\n *,\n {{ strategy.unique_key }} as dbt_unique_key,\n {{ strategy.updated_at }} as dbt_updated_at,\n {{ strategy.updated_at }} as dbt_valid_from,\n nullif({{ strategy.updated_at }}, {{ strategy.updated_at }}) as dbt_valid_to,\n {{ strategy.scd_id }} as dbt_scd_id\n\n from snapshot_query\n ),\n\n updates_source_data as (\n\n select\n *,\n {{ strategy.unique_key }} as dbt_unique_key,\n {{ strategy.updated_at }} as dbt_updated_at,\n {{ strategy.updated_at }} as dbt_valid_from,\n {{ strategy.updated_at }} as dbt_valid_to\n\n from snapshot_query\n ),\n\n {%- if strategy.invalidate_hard_deletes %}\n\n deletes_source_data as (\n\n select\n *,\n {{ strategy.unique_key }} as dbt_unique_key\n from snapshot_query\n ),\n {% endif %}\n\n insertions as (\n\n select\n 'insert' as dbt_change_type,\n source_data.*\n\n from insertions_source_data as source_data\n left outer join snapshotted_data on snapshotted_data.dbt_unique_key = source_data.dbt_unique_key\n where snapshotted_data.dbt_unique_key is null\n or (\n snapshotted_data.dbt_unique_key is not null\n and (\n {{ strategy.row_changed }}\n )\n )\n\n ),\n\n updates as (\n\n select\n 'update' as dbt_change_type,\n source_data.*,\n snapshotted_data.dbt_scd_id\n\n from updates_source_data as source_data\n join snapshotted_data on snapshotted_data.dbt_unique_key = source_data.dbt_unique_key\n where (\n {{ strategy.row_changed }}\n )\n )\n\n {%- if strategy.invalidate_hard_deletes -%}\n ,\n\n deletes as (\n\n select\n 'delete' as dbt_change_type,\n source_data.*,\n {{ snapshot_get_time() }} as dbt_valid_from,\n {{ snapshot_get_time() }} as dbt_updated_at,\n {{ snapshot_get_time() }} as dbt_valid_to,\n snapshotted_data.dbt_scd_id\n\n from snapshotted_data\n left join deletes_source_data as source_data on snapshotted_data.dbt_unique_key = source_data.dbt_unique_key\n where source_data.dbt_unique_key is null\n )\n {%- endif %}\n\n select * from insertions\n union all\n select * from updates\n {%- if strategy.invalidate_hard_deletes %}\n union all\n select * from deletes\n {%- endif %}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.snapshot_get_time"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600952.8534122}, "macro.dbt.build_snapshot_table": {"unique_id": "macro.dbt.build_snapshot_table", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.2.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshots/helpers.sql", "original_file_path": "macros/materializations/snapshots/helpers.sql", "name": "build_snapshot_table", "macro_sql": "{% macro build_snapshot_table(strategy, sql) -%}\n {{ adapter.dispatch('build_snapshot_table', 'dbt')(strategy, sql) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__build_snapshot_table"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600952.853597}, "macro.dbt.default__build_snapshot_table": {"unique_id": "macro.dbt.default__build_snapshot_table", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.2.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshots/helpers.sql", "original_file_path": "macros/materializations/snapshots/helpers.sql", "name": "default__build_snapshot_table", "macro_sql": "{% macro default__build_snapshot_table(strategy, sql) %}\n\n select *,\n {{ strategy.scd_id }} as dbt_scd_id,\n {{ strategy.updated_at }} as dbt_updated_at,\n {{ strategy.updated_at }} as dbt_valid_from,\n nullif({{ strategy.updated_at }}, {{ strategy.updated_at }}) as dbt_valid_to\n from (\n {{ sql }}\n ) sbq\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600952.853843}, "macro.dbt.build_snapshot_staging_table": {"unique_id": "macro.dbt.build_snapshot_staging_table", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.2.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshots/helpers.sql", "original_file_path": "macros/materializations/snapshots/helpers.sql", "name": "build_snapshot_staging_table", "macro_sql": "{% macro build_snapshot_staging_table(strategy, sql, target_relation) %}\n {% set temp_relation = make_temp_relation(target_relation) %}\n\n {% set select = snapshot_staging_table(strategy, sql, target_relation) %}\n\n {% call statement('build_snapshot_staging_relation') %}\n {{ create_table_as(True, temp_relation, select) }}\n {% endcall %}\n\n {% do return(temp_relation) %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.make_temp_relation", "macro.dbt.snapshot_staging_table", "macro.dbt.statement", "macro.dbt.create_table_as"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600952.854264}, "macro.dbt.materialization_snapshot_default": {"unique_id": "macro.dbt.materialization_snapshot_default", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.2.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshots/snapshot.sql", "original_file_path": "macros/materializations/snapshots/snapshot.sql", "name": "materialization_snapshot_default", "macro_sql": "{% materialization snapshot, default %}\n {%- set config = model['config'] -%}\n\n {%- set target_table = model.get('alias', model.get('name')) -%}\n\n {%- set strategy_name = config.get('strategy') -%}\n {%- set unique_key = config.get('unique_key') %}\n -- grab current tables grants config for comparision later on\n {%- set grant_config = config.get('grants') -%}\n\n {% set target_relation_exists, target_relation = get_or_create_relation(\n database=model.database,\n schema=model.schema,\n identifier=target_table,\n type='table') -%}\n\n {%- if not target_relation.is_table -%}\n {% do exceptions.relation_wrong_type(target_relation, 'table') %}\n {%- endif -%}\n\n\n {{ run_hooks(pre_hooks, inside_transaction=False) }}\n\n {{ run_hooks(pre_hooks, inside_transaction=True) }}\n\n {% set strategy_macro = strategy_dispatch(strategy_name) %}\n {% set strategy = strategy_macro(model, \"snapshotted_data\", \"source_data\", config, target_relation_exists) %}\n\n {% if not target_relation_exists %}\n\n {% set build_sql = build_snapshot_table(strategy, model['compiled_sql']) %}\n {% set final_sql = create_table_as(False, target_relation, build_sql) %}\n\n {% else %}\n\n {{ adapter.valid_snapshot_target(target_relation) }}\n\n {% set staging_table = build_snapshot_staging_table(strategy, sql, target_relation) %}\n\n -- this may no-op if the database does not require column expansion\n {% do adapter.expand_target_column_types(from_relation=staging_table,\n to_relation=target_relation) %}\n\n {% set missing_columns = adapter.get_missing_columns(staging_table, target_relation)\n | rejectattr('name', 'equalto', 'dbt_change_type')\n | rejectattr('name', 'equalto', 'DBT_CHANGE_TYPE')\n | rejectattr('name', 'equalto', 'dbt_unique_key')\n | rejectattr('name', 'equalto', 'DBT_UNIQUE_KEY')\n | list %}\n\n {% do create_columns(target_relation, missing_columns) %}\n\n {% set source_columns = adapter.get_columns_in_relation(staging_table)\n | rejectattr('name', 'equalto', 'dbt_change_type')\n | rejectattr('name', 'equalto', 'DBT_CHANGE_TYPE')\n | rejectattr('name', 'equalto', 'dbt_unique_key')\n | rejectattr('name', 'equalto', 'DBT_UNIQUE_KEY')\n | list %}\n\n {% set quoted_source_columns = [] %}\n {% for column in source_columns %}\n {% do quoted_source_columns.append(adapter.quote(column.name)) %}\n {% endfor %}\n\n {% set final_sql = snapshot_merge_sql(\n target = target_relation,\n source = staging_table,\n insert_cols = quoted_source_columns\n )\n %}\n\n {% endif %}\n\n {% call statement('main') %}\n {{ final_sql }}\n {% endcall %}\n\n {% set should_revoke = should_revoke(target_relation_exists, full_refresh_mode=False) %}\n {% do apply_grants(target_relation, grant_config, should_revoke=should_revoke) %}\n\n {% do persist_docs(target_relation, model) %}\n\n {% if not target_relation_exists %}\n {% do create_indexes(target_relation) %}\n {% endif %}\n\n {{ run_hooks(post_hooks, inside_transaction=True) }}\n\n {{ adapter.commit() }}\n\n {% if staging_table is defined %}\n {% do post_snapshot(staging_table) %}\n {% endif %}\n\n {{ run_hooks(post_hooks, inside_transaction=False) }}\n\n {{ return({'relations': [target_relation]}) }}\n\n{% endmaterialization %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.get_or_create_relation", "macro.dbt.run_hooks", "macro.dbt.strategy_dispatch", "macro.dbt.build_snapshot_table", "macro.dbt.create_table_as", "macro.dbt.build_snapshot_staging_table", "macro.dbt.create_columns", "macro.dbt.snapshot_merge_sql", "macro.dbt.statement", "macro.dbt.should_revoke", "macro.dbt.apply_grants", "macro.dbt.persist_docs", "macro.dbt.create_indexes", "macro.dbt.post_snapshot"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600952.860033}, "macro.dbt.materialization_test_default": {"unique_id": "macro.dbt.materialization_test_default", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.2.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/tests/test.sql", "original_file_path": "macros/materializations/tests/test.sql", "name": "materialization_test_default", "macro_sql": "{%- materialization test, default -%}\n\n {% set relations = [] %}\n\n {% if should_store_failures() %}\n\n {% set identifier = model['alias'] %}\n {% set old_relation = adapter.get_relation(database=database, schema=schema, identifier=identifier) %}\n {% set target_relation = api.Relation.create(\n identifier=identifier, schema=schema, database=database, type='table') -%} %}\n\n {% if old_relation %}\n {% do adapter.drop_relation(old_relation) %}\n {% endif %}\n\n {% call statement(auto_begin=True) %}\n {{ create_table_as(False, target_relation, sql) }}\n {% endcall %}\n\n {% do relations.append(target_relation) %}\n\n {% set main_sql %}\n select *\n from {{ target_relation }}\n {% endset %}\n\n {{ adapter.commit() }}\n\n {% else %}\n\n {% set main_sql = sql %}\n\n {% endif %}\n\n {% set limit = config.get('limit') %}\n {% set fail_calc = config.get('fail_calc') %}\n {% set warn_if = config.get('warn_if') %}\n {% set error_if = config.get('error_if') %}\n\n {% call statement('main', fetch_result=True) -%}\n\n {{ get_test_sql(main_sql, fail_calc, warn_if, error_if, limit)}}\n\n {%- endcall %}\n\n {{ return({'relations': relations}) }}\n\n{%- endmaterialization -%}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.should_store_failures", "macro.dbt.statement", "macro.dbt.create_table_as", "macro.dbt.get_test_sql"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600952.86203}, "macro.dbt.get_test_sql": {"unique_id": "macro.dbt.get_test_sql", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.2.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/tests/helpers.sql", "original_file_path": "macros/materializations/tests/helpers.sql", "name": "get_test_sql", "macro_sql": "{% macro get_test_sql(main_sql, fail_calc, warn_if, error_if, limit) -%}\n {{ adapter.dispatch('get_test_sql', 'dbt')(main_sql, fail_calc, warn_if, error_if, limit) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__get_test_sql"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600952.862518}, "macro.dbt.default__get_test_sql": {"unique_id": "macro.dbt.default__get_test_sql", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.2.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/tests/helpers.sql", "original_file_path": "macros/materializations/tests/helpers.sql", "name": "default__get_test_sql", "macro_sql": "{% macro default__get_test_sql(main_sql, fail_calc, warn_if, error_if, limit) -%}\n select\n {{ fail_calc }} as failures,\n {{ fail_calc }} {{ warn_if }} as should_warn,\n {{ fail_calc }} {{ error_if }} as should_error\n from (\n {{ main_sql }}\n {{ \"limit \" ~ limit if limit != none }}\n ) dbt_internal_test\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600952.862816}, "macro.dbt.get_where_subquery": {"unique_id": "macro.dbt.get_where_subquery", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.2.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/tests/where_subquery.sql", "original_file_path": "macros/materializations/tests/where_subquery.sql", "name": "get_where_subquery", "macro_sql": "{% macro get_where_subquery(relation) -%}\n {% do return(adapter.dispatch('get_where_subquery', 'dbt')(relation)) %}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__get_where_subquery"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600952.8632262}, "macro.dbt.default__get_where_subquery": {"unique_id": "macro.dbt.default__get_where_subquery", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.2.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/tests/where_subquery.sql", "original_file_path": "macros/materializations/tests/where_subquery.sql", "name": "default__get_where_subquery", "macro_sql": "{% macro default__get_where_subquery(relation) -%}\n {% set where = config.get('where', '') %}\n {% if where %}\n {%- set filtered -%}\n (select * from {{ relation }} where {{ where }}) dbt_subquery\n {%- endset -%}\n {% do return(filtered) %}\n {%- else -%}\n {% do return(relation) %}\n {%- endif -%}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600952.863596}, "macro.dbt.get_quoted_csv": {"unique_id": "macro.dbt.get_quoted_csv", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.2.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/incremental/column_helpers.sql", "original_file_path": "macros/materializations/models/incremental/column_helpers.sql", "name": "get_quoted_csv", "macro_sql": "{% macro get_quoted_csv(column_names) %}\n\n {% set quoted = [] %}\n {% for col in column_names -%}\n {%- do quoted.append(adapter.quote(col)) -%}\n {%- endfor %}\n\n {%- set dest_cols_csv = quoted | join(', ') -%}\n {{ return(dest_cols_csv) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600952.864408}, "macro.dbt.diff_columns": {"unique_id": "macro.dbt.diff_columns", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.2.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/incremental/column_helpers.sql", "original_file_path": "macros/materializations/models/incremental/column_helpers.sql", "name": "diff_columns", "macro_sql": "{% macro diff_columns(source_columns, target_columns) %}\n\n {% set result = [] %}\n {% set source_names = source_columns | map(attribute = 'column') | list %}\n {% set target_names = target_columns | map(attribute = 'column') | list %}\n\n {# --check whether the name attribute exists in the target - this does not perform a data type check #}\n {% for sc in source_columns %}\n {% if sc.name not in target_names %}\n {{ result.append(sc) }}\n {% endif %}\n {% endfor %}\n\n {{ return(result) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600952.864939}, "macro.dbt.diff_column_data_types": {"unique_id": "macro.dbt.diff_column_data_types", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.2.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/incremental/column_helpers.sql", "original_file_path": "macros/materializations/models/incremental/column_helpers.sql", "name": "diff_column_data_types", "macro_sql": "{% macro diff_column_data_types(source_columns, target_columns) %}\n\n {% set result = [] %}\n {% for sc in source_columns %}\n {% set tc = target_columns | selectattr(\"name\", \"equalto\", sc.name) | list | first %}\n {% if tc %}\n {% if sc.data_type != tc.data_type %}\n {{ result.append( { 'column_name': tc.name, 'new_type': sc.data_type } ) }}\n {% endif %}\n {% endif %}\n {% endfor %}\n\n {{ return(result) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600952.865534}, "macro.dbt.get_merge_sql": {"unique_id": "macro.dbt.get_merge_sql", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.2.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/incremental/merge.sql", "original_file_path": "macros/materializations/models/incremental/merge.sql", "name": "get_merge_sql", "macro_sql": "{% macro get_merge_sql(target, source, unique_key, dest_columns, predicates=none) -%}\n {{ adapter.dispatch('get_merge_sql', 'dbt')(target, source, unique_key, dest_columns, predicates) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__get_merge_sql"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600952.870236}, "macro.dbt.default__get_merge_sql": {"unique_id": "macro.dbt.default__get_merge_sql", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.2.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/incremental/merge.sql", "original_file_path": "macros/materializations/models/incremental/merge.sql", "name": "default__get_merge_sql", "macro_sql": "{% macro default__get_merge_sql(target, source, unique_key, dest_columns, predicates) -%}\n {%- set predicates = [] if predicates is none else [] + predicates -%}\n {%- set dest_cols_csv = get_quoted_csv(dest_columns | map(attribute=\"name\")) -%}\n {%- set update_columns = config.get('merge_update_columns', default = dest_columns | map(attribute=\"quoted\") | list) -%}\n {%- set sql_header = config.get('sql_header', none) -%}\n\n {% if unique_key %}\n {% if unique_key is sequence and unique_key is not mapping and unique_key is not string %}\n {% for key in unique_key %}\n {% set this_key_match %}\n DBT_INTERNAL_SOURCE.{{ key }} = DBT_INTERNAL_DEST.{{ key }}\n {% endset %}\n {% do predicates.append(this_key_match) %}\n {% endfor %}\n {% else %}\n {% set unique_key_match %}\n DBT_INTERNAL_SOURCE.{{ unique_key }} = DBT_INTERNAL_DEST.{{ unique_key }}\n {% endset %}\n {% do predicates.append(unique_key_match) %}\n {% endif %}\n {% else %}\n {% do predicates.append('FALSE') %}\n {% endif %}\n\n {{ sql_header if sql_header is not none }}\n\n merge into {{ target }} as DBT_INTERNAL_DEST\n using {{ source }} as DBT_INTERNAL_SOURCE\n on {{ predicates | join(' and ') }}\n\n {% if unique_key %}\n when matched then update set\n {% for column_name in update_columns -%}\n {{ column_name }} = DBT_INTERNAL_SOURCE.{{ column_name }}\n {%- if not loop.last %}, {%- endif %}\n {%- endfor %}\n {% endif %}\n\n when not matched then insert\n ({{ dest_cols_csv }})\n values\n ({{ dest_cols_csv }})\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.get_quoted_csv"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600952.871674}, "macro.dbt.get_delete_insert_merge_sql": {"unique_id": "macro.dbt.get_delete_insert_merge_sql", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.2.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/incremental/merge.sql", "original_file_path": "macros/materializations/models/incremental/merge.sql", "name": "get_delete_insert_merge_sql", "macro_sql": "{% macro get_delete_insert_merge_sql(target, source, unique_key, dest_columns) -%}\n {{ adapter.dispatch('get_delete_insert_merge_sql', 'dbt')(target, source, unique_key, dest_columns) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__get_delete_insert_merge_sql"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600952.871965}, "macro.dbt.default__get_delete_insert_merge_sql": {"unique_id": "macro.dbt.default__get_delete_insert_merge_sql", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.2.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/incremental/merge.sql", "original_file_path": "macros/materializations/models/incremental/merge.sql", "name": "default__get_delete_insert_merge_sql", "macro_sql": "{% macro default__get_delete_insert_merge_sql(target, source, unique_key, dest_columns) -%}\n\n {%- set dest_cols_csv = get_quoted_csv(dest_columns | map(attribute=\"name\")) -%}\n\n {% if unique_key %}\n {% if unique_key is sequence and unique_key is not string %}\n delete from {{target }}\n using {{ source }}\n where (\n {% for key in unique_key %}\n {{ source }}.{{ key }} = {{ target }}.{{ key }}\n {{ \"and \" if not loop.last }}\n {% endfor %}\n );\n {% else %}\n delete from {{ target }}\n where (\n {{ unique_key }}) in (\n select ({{ unique_key }})\n from {{ source }}\n );\n\n {% endif %}\n {% endif %}\n\n insert into {{ target }} ({{ dest_cols_csv }})\n (\n select {{ dest_cols_csv }}\n from {{ source }}\n )\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.get_quoted_csv"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600952.87269}, "macro.dbt.get_insert_overwrite_merge_sql": {"unique_id": "macro.dbt.get_insert_overwrite_merge_sql", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.2.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/incremental/merge.sql", "original_file_path": "macros/materializations/models/incremental/merge.sql", "name": "get_insert_overwrite_merge_sql", "macro_sql": "{% macro get_insert_overwrite_merge_sql(target, source, dest_columns, predicates, include_sql_header=false) -%}\n {{ adapter.dispatch('get_insert_overwrite_merge_sql', 'dbt')(target, source, dest_columns, predicates, include_sql_header) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__get_insert_overwrite_merge_sql"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600952.87295}, "macro.dbt.default__get_insert_overwrite_merge_sql": {"unique_id": "macro.dbt.default__get_insert_overwrite_merge_sql", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.2.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/incremental/merge.sql", "original_file_path": "macros/materializations/models/incremental/merge.sql", "name": "default__get_insert_overwrite_merge_sql", "macro_sql": "{% macro default__get_insert_overwrite_merge_sql(target, source, dest_columns, predicates, include_sql_header) -%}\n {%- set predicates = [] if predicates is none else [] + predicates -%}\n {%- set dest_cols_csv = get_quoted_csv(dest_columns | map(attribute=\"name\")) -%}\n {%- set sql_header = config.get('sql_header', none) -%}\n\n {{ sql_header if sql_header is not none and include_sql_header }}\n\n merge into {{ target }} as DBT_INTERNAL_DEST\n using {{ source }} as DBT_INTERNAL_SOURCE\n on FALSE\n\n when not matched by source\n {% if predicates %} and {{ predicates | join(' and ') }} {% endif %}\n then delete\n\n when not matched then insert\n ({{ dest_cols_csv }})\n values\n ({{ dest_cols_csv }})\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.get_quoted_csv"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600952.873557}, "macro.dbt.is_incremental": {"unique_id": "macro.dbt.is_incremental", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.2.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/incremental/is_incremental.sql", "original_file_path": "macros/materializations/models/incremental/is_incremental.sql", "name": "is_incremental", "macro_sql": "{% macro is_incremental() %}\n {#-- do not run introspective queries in parsing #}\n {% if not execute %}\n {{ return(False) }}\n {% else %}\n {% set relation = adapter.get_relation(this.database, this.schema, this.table) %}\n {{ return(relation is not none\n and relation.type == 'table'\n and model.config.materialized == 'incremental'\n and not should_full_refresh()) }}\n {% endif %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.should_full_refresh"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600952.8742359}, "macro.dbt.materialization_incremental_default": {"unique_id": "macro.dbt.materialization_incremental_default", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.2.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/incremental/incremental.sql", "original_file_path": "macros/materializations/models/incremental/incremental.sql", "name": "materialization_incremental_default", "macro_sql": "{% materialization incremental, default -%}\n\n -- relations\n {%- set existing_relation = load_cached_relation(this) -%}\n {%- set target_relation = this.incorporate(type='table') -%}\n {%- set temp_relation = make_temp_relation(target_relation)-%}\n {%- set intermediate_relation = make_intermediate_relation(target_relation)-%}\n {%- set backup_relation_type = 'table' if existing_relation is none else existing_relation.type -%}\n {%- set backup_relation = make_backup_relation(target_relation, backup_relation_type) -%}\n\n -- configs\n {%- set unique_key = config.get('unique_key') -%}\n {%- set full_refresh_mode = (should_full_refresh() or existing_relation.is_view) -%}\n {%- set on_schema_change = incremental_validate_on_schema_change(config.get('on_schema_change'), default='ignore') -%}\n\n -- the temp_ and backup_ relations should not already exist in the database; get_relation\n -- will return None in that case. Otherwise, we get a relation that we can drop\n -- later, before we try to use this name for the current operation. This has to happen before\n -- BEGIN, in a separate transaction\n {%- set preexisting_intermediate_relation = load_cached_relation(intermediate_relation)-%}\n {%- set preexisting_backup_relation = load_cached_relation(backup_relation) -%}\n -- grab current tables grants config for comparision later on\n {% set grant_config = config.get('grants') %}\n {{ drop_relation_if_exists(preexisting_intermediate_relation) }}\n {{ drop_relation_if_exists(preexisting_backup_relation) }}\n\n {{ run_hooks(pre_hooks, inside_transaction=False) }}\n\n -- `BEGIN` happens here:\n {{ run_hooks(pre_hooks, inside_transaction=True) }}\n\n {% set to_drop = [] %}\n\n {% if existing_relation is none %}\n {% set build_sql = get_create_table_as_sql(False, target_relation, sql) %}\n {% elif full_refresh_mode %}\n {% set build_sql = get_create_table_as_sql(False, intermediate_relation, sql) %}\n {% set need_swap = true %}\n {% else %}\n {% do run_query(get_create_table_as_sql(True, temp_relation, sql)) %}\n {% do adapter.expand_target_column_types(\n from_relation=temp_relation,\n to_relation=target_relation) %}\n {#-- Process schema changes. Returns dict of changes if successful. Use source columns for upserting/merging --#}\n {% set dest_columns = process_schema_changes(on_schema_change, temp_relation, existing_relation) %}\n {% if not dest_columns %}\n {% set dest_columns = adapter.get_columns_in_relation(existing_relation) %}\n {% endif %}\n {% set build_sql = get_delete_insert_merge_sql(target_relation, temp_relation, unique_key, dest_columns) %}\n\n {% endif %}\n\n {% call statement(\"main\") %}\n {{ build_sql }}\n {% endcall %}\n\n {% if need_swap %}\n {% do adapter.rename_relation(target_relation, backup_relation) %}\n {% do adapter.rename_relation(intermediate_relation, target_relation) %}\n {% do to_drop.append(backup_relation) %}\n {% endif %}\n\n {% set should_revoke = should_revoke(existing_relation, full_refresh_mode) %}\n {% do apply_grants(target_relation, grant_config, should_revoke=should_revoke) %}\n\n {% do persist_docs(target_relation, model) %}\n\n {% if existing_relation is none or existing_relation.is_view or should_full_refresh() %}\n {% do create_indexes(target_relation) %}\n {% endif %}\n\n {{ run_hooks(post_hooks, inside_transaction=True) }}\n\n -- `COMMIT` happens here\n {% do adapter.commit() %}\n\n {% for rel in to_drop %}\n {% do adapter.drop_relation(rel) %}\n {% endfor %}\n\n {{ run_hooks(post_hooks, inside_transaction=False) }}\n\n {{ return({'relations': [target_relation]}) }}\n\n{%- endmaterialization %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.load_cached_relation", "macro.dbt.make_temp_relation", "macro.dbt.make_intermediate_relation", "macro.dbt.make_backup_relation", "macro.dbt.should_full_refresh", "macro.dbt.incremental_validate_on_schema_change", "macro.dbt.drop_relation_if_exists", "macro.dbt.run_hooks", "macro.dbt.get_create_table_as_sql", "macro.dbt.run_query", "macro.dbt.process_schema_changes", "macro.dbt.get_delete_insert_merge_sql", "macro.dbt.statement", "macro.dbt.should_revoke", "macro.dbt.apply_grants", "macro.dbt.persist_docs", "macro.dbt.create_indexes"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600952.878502}, "macro.dbt.incremental_validate_on_schema_change": {"unique_id": "macro.dbt.incremental_validate_on_schema_change", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.2.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/incremental/on_schema_change.sql", "original_file_path": "macros/materializations/models/incremental/on_schema_change.sql", "name": "incremental_validate_on_schema_change", "macro_sql": "{% macro incremental_validate_on_schema_change(on_schema_change, default='ignore') %}\n\n {% if on_schema_change not in ['sync_all_columns', 'append_new_columns', 'fail', 'ignore'] %}\n\n {% set log_message = 'Invalid value for on_schema_change (%s) specified. Setting default value of %s.' % (on_schema_change, default) %}\n {% do log(log_message) %}\n\n {{ return(default) }}\n\n {% else %}\n\n {{ return(on_schema_change) }}\n\n {% endif %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600952.882785}, "macro.dbt.check_for_schema_changes": {"unique_id": "macro.dbt.check_for_schema_changes", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.2.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/incremental/on_schema_change.sql", "original_file_path": "macros/materializations/models/incremental/on_schema_change.sql", "name": "check_for_schema_changes", "macro_sql": "{% macro check_for_schema_changes(source_relation, target_relation) %}\n\n {% set schema_changed = False %}\n\n {%- set source_columns = adapter.get_columns_in_relation(source_relation) -%}\n {%- set target_columns = adapter.get_columns_in_relation(target_relation) -%}\n {%- set source_not_in_target = diff_columns(source_columns, target_columns) -%}\n {%- set target_not_in_source = diff_columns(target_columns, source_columns) -%}\n\n {% set new_target_types = diff_column_data_types(source_columns, target_columns) %}\n\n {% if source_not_in_target != [] %}\n {% set schema_changed = True %}\n {% elif target_not_in_source != [] or new_target_types != [] %}\n {% set schema_changed = True %}\n {% elif new_target_types != [] %}\n {% set schema_changed = True %}\n {% endif %}\n\n {% set changes_dict = {\n 'schema_changed': schema_changed,\n 'source_not_in_target': source_not_in_target,\n 'target_not_in_source': target_not_in_source,\n 'source_columns': source_columns,\n 'target_columns': target_columns,\n 'new_target_types': new_target_types\n } %}\n\n {% set msg %}\n In {{ target_relation }}:\n Schema changed: {{ schema_changed }}\n Source columns not in target: {{ source_not_in_target }}\n Target columns not in source: {{ target_not_in_source }}\n New column types: {{ new_target_types }}\n {% endset %}\n\n {% do log(msg) %}\n\n {{ return(changes_dict) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.diff_columns", "macro.dbt.diff_column_data_types"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600952.883968}, "macro.dbt.sync_column_schemas": {"unique_id": "macro.dbt.sync_column_schemas", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.2.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/incremental/on_schema_change.sql", "original_file_path": "macros/materializations/models/incremental/on_schema_change.sql", "name": "sync_column_schemas", "macro_sql": "{% macro sync_column_schemas(on_schema_change, target_relation, schema_changes_dict) %}\n\n {%- set add_to_target_arr = schema_changes_dict['source_not_in_target'] -%}\n\n {%- if on_schema_change == 'append_new_columns'-%}\n {%- if add_to_target_arr | length > 0 -%}\n {%- do alter_relation_add_remove_columns(target_relation, add_to_target_arr, none) -%}\n {%- endif -%}\n\n {% elif on_schema_change == 'sync_all_columns' %}\n {%- set remove_from_target_arr = schema_changes_dict['target_not_in_source'] -%}\n {%- set new_target_types = schema_changes_dict['new_target_types'] -%}\n\n {% if add_to_target_arr | length > 0 or remove_from_target_arr | length > 0 %}\n {%- do alter_relation_add_remove_columns(target_relation, add_to_target_arr, remove_from_target_arr) -%}\n {% endif %}\n\n {% if new_target_types != [] %}\n {% for ntt in new_target_types %}\n {% set column_name = ntt['column_name'] %}\n {% set new_type = ntt['new_type'] %}\n {% do alter_column_type(target_relation, column_name, new_type) %}\n {% endfor %}\n {% endif %}\n\n {% endif %}\n\n {% set schema_change_message %}\n In {{ target_relation }}:\n Schema change approach: {{ on_schema_change }}\n Columns added: {{ add_to_target_arr }}\n Columns removed: {{ remove_from_target_arr }}\n Data types changed: {{ new_target_types }}\n {% endset %}\n\n {% do log(schema_change_message) %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.alter_relation_add_remove_columns", "macro.dbt.alter_column_type"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600952.885122}, "macro.dbt.process_schema_changes": {"unique_id": "macro.dbt.process_schema_changes", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.2.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/incremental/on_schema_change.sql", "original_file_path": "macros/materializations/models/incremental/on_schema_change.sql", "name": "process_schema_changes", "macro_sql": "{% macro process_schema_changes(on_schema_change, source_relation, target_relation) %}\n\n {% if on_schema_change == 'ignore' %}\n\n {{ return({}) }}\n\n {% else %}\n\n {% set schema_changes_dict = check_for_schema_changes(source_relation, target_relation) %}\n\n {% if schema_changes_dict['schema_changed'] %}\n\n {% if on_schema_change == 'fail' %}\n\n {% set fail_msg %}\n The source and target schemas on this incremental model are out of sync!\n They can be reconciled in several ways:\n - set the `on_schema_change` config to either append_new_columns or sync_all_columns, depending on your situation.\n - Re-run the incremental model with `full_refresh: True` to update the target schema.\n - update the schema manually and re-run the process.\n {% endset %}\n\n {% do exceptions.raise_compiler_error(fail_msg) %}\n\n {# -- unless we ignore, run the sync operation per the config #}\n {% else %}\n\n {% do sync_column_schemas(on_schema_change, target_relation, schema_changes_dict) %}\n\n {% endif %}\n\n {% endif %}\n\n {{ return(schema_changes_dict['source_columns']) }}\n\n {% endif %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.check_for_schema_changes", "macro.dbt.sync_column_schemas"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600952.8858209}, "macro.dbt.materialization_table_default": {"unique_id": "macro.dbt.materialization_table_default", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.2.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/table/table.sql", "original_file_path": "macros/materializations/models/table/table.sql", "name": "materialization_table_default", "macro_sql": "{% materialization table, default %}\n\n {%- set existing_relation = load_cached_relation(this) -%}\n {%- set target_relation = this.incorporate(type='table') %}\n {%- set intermediate_relation = make_intermediate_relation(target_relation) -%}\n -- the intermediate_relation should not already exist in the database; get_relation\n -- will return None in that case. Otherwise, we get a relation that we can drop\n -- later, before we try to use this name for the current operation\n {%- set preexisting_intermediate_relation = load_cached_relation(intermediate_relation) -%}\n /*\n See ../view/view.sql for more information about this relation.\n */\n {%- set backup_relation_type = 'table' if existing_relation is none else existing_relation.type -%}\n {%- set backup_relation = make_backup_relation(target_relation, backup_relation_type) -%}\n -- as above, the backup_relation should not already exist\n {%- set preexisting_backup_relation = load_cached_relation(backup_relation) -%}\n -- grab current tables grants config for comparision later on\n {% set grant_config = config.get('grants') %}\n\n -- drop the temp relations if they exist already in the database\n {{ drop_relation_if_exists(preexisting_intermediate_relation) }}\n {{ drop_relation_if_exists(preexisting_backup_relation) }}\n\n {{ run_hooks(pre_hooks, inside_transaction=False) }}\n\n -- `BEGIN` happens here:\n {{ run_hooks(pre_hooks, inside_transaction=True) }}\n\n -- build model\n {% call statement('main') -%}\n {{ get_create_table_as_sql(False, intermediate_relation, sql) }}\n {%- endcall %}\n\n -- cleanup\n {% if existing_relation is not none %}\n {{ adapter.rename_relation(existing_relation, backup_relation) }}\n {% endif %}\n\n {{ adapter.rename_relation(intermediate_relation, target_relation) }}\n\n {% do create_indexes(target_relation) %}\n\n {{ run_hooks(post_hooks, inside_transaction=True) }}\n\n {% set should_revoke = should_revoke(existing_relation, full_refresh_mode=True) %}\n {% do apply_grants(target_relation, grant_config, should_revoke=should_revoke) %}\n\n {% do persist_docs(target_relation, model) %}\n\n -- `COMMIT` happens here\n {{ adapter.commit() }}\n\n -- finally, drop the existing/backup relation after the commit\n {{ drop_relation_if_exists(backup_relation) }}\n\n {{ run_hooks(post_hooks, inside_transaction=False) }}\n\n {{ return({'relations': [target_relation]}) }}\n{% endmaterialization %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.load_cached_relation", "macro.dbt.make_intermediate_relation", "macro.dbt.make_backup_relation", "macro.dbt.drop_relation_if_exists", "macro.dbt.run_hooks", "macro.dbt.statement", "macro.dbt.get_create_table_as_sql", "macro.dbt.create_indexes", "macro.dbt.should_revoke", "macro.dbt.apply_grants", "macro.dbt.persist_docs"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600952.8882828}, "macro.dbt.get_create_table_as_sql": {"unique_id": "macro.dbt.get_create_table_as_sql", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.2.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/table/create_table_as.sql", "original_file_path": "macros/materializations/models/table/create_table_as.sql", "name": "get_create_table_as_sql", "macro_sql": "{% macro get_create_table_as_sql(temporary, relation, sql) -%}\n {{ adapter.dispatch('get_create_table_as_sql', 'dbt')(temporary, relation, sql) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__get_create_table_as_sql"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600952.888764}, "macro.dbt.default__get_create_table_as_sql": {"unique_id": "macro.dbt.default__get_create_table_as_sql", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.2.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/table/create_table_as.sql", "original_file_path": "macros/materializations/models/table/create_table_as.sql", "name": "default__get_create_table_as_sql", "macro_sql": "{% macro default__get_create_table_as_sql(temporary, relation, sql) -%}\n {{ return(create_table_as(temporary, relation, sql)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.create_table_as"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600952.8889441}, "macro.dbt.create_table_as": {"unique_id": "macro.dbt.create_table_as", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.2.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/table/create_table_as.sql", "original_file_path": "macros/materializations/models/table/create_table_as.sql", "name": "create_table_as", "macro_sql": "{% macro create_table_as(temporary, relation, sql) -%}\n {{ adapter.dispatch('create_table_as', 'dbt')(temporary, relation, sql) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__create_table_as"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600952.889139}, "macro.dbt.default__create_table_as": {"unique_id": "macro.dbt.default__create_table_as", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.2.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/table/create_table_as.sql", "original_file_path": "macros/materializations/models/table/create_table_as.sql", "name": "default__create_table_as", "macro_sql": "{% macro default__create_table_as(temporary, relation, sql) -%}\n {%- set sql_header = config.get('sql_header', none) -%}\n\n {{ sql_header if sql_header is not none }}\n\n create {% if temporary: -%}temporary{%- endif %} table\n {{ relation.include(database=(not temporary), schema=(not temporary)) }}\n as (\n {{ sql }}\n );\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600952.889534}, "macro.dbt.materialization_view_default": {"unique_id": "macro.dbt.materialization_view_default", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.2.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/view/view.sql", "original_file_path": "macros/materializations/models/view/view.sql", "name": "materialization_view_default", "macro_sql": "{%- materialization view, default -%}\n\n {%- set existing_relation = load_cached_relation(this) -%}\n {%- set target_relation = this.incorporate(type='view') -%}\n {%- set intermediate_relation = make_intermediate_relation(target_relation) -%}\n\n -- the intermediate_relation should not already exist in the database; get_relation\n -- will return None in that case. Otherwise, we get a relation that we can drop\n -- later, before we try to use this name for the current operation\n {%- set preexisting_intermediate_relation = load_cached_relation(intermediate_relation) -%}\n /*\n This relation (probably) doesn't exist yet. If it does exist, it's a leftover from\n a previous run, and we're going to try to drop it immediately. At the end of this\n materialization, we're going to rename the \"existing_relation\" to this identifier,\n and then we're going to drop it. In order to make sure we run the correct one of:\n - drop view ...\n - drop table ...\n\n We need to set the type of this relation to be the type of the existing_relation, if it exists,\n or else \"view\" as a sane default if it does not. Note that if the existing_relation does not\n exist, then there is nothing to move out of the way and subsequentally drop. In that case,\n this relation will be effectively unused.\n */\n {%- set backup_relation_type = 'view' if existing_relation is none else existing_relation.type -%}\n {%- set backup_relation = make_backup_relation(target_relation, backup_relation_type) -%}\n -- as above, the backup_relation should not already exist\n {%- set preexisting_backup_relation = load_cached_relation(backup_relation) -%}\n -- grab current tables grants config for comparision later on\n {% set grant_config = config.get('grants') %}\n\n {{ run_hooks(pre_hooks, inside_transaction=False) }}\n\n -- drop the temp relations if they exist already in the database\n {{ drop_relation_if_exists(preexisting_intermediate_relation) }}\n {{ drop_relation_if_exists(preexisting_backup_relation) }}\n\n -- `BEGIN` happens here:\n {{ run_hooks(pre_hooks, inside_transaction=True) }}\n\n -- build model\n {% call statement('main') -%}\n {{ get_create_view_as_sql(intermediate_relation, sql) }}\n {%- endcall %}\n\n -- cleanup\n -- move the existing view out of the way\n {% if existing_relation is not none %}\n {{ adapter.rename_relation(existing_relation, backup_relation) }}\n {% endif %}\n {{ adapter.rename_relation(intermediate_relation, target_relation) }}\n\n {% set should_revoke = should_revoke(existing_relation, full_refresh_mode=True) %}\n {% do apply_grants(target_relation, grant_config, should_revoke=should_revoke) %}\n\n {% do persist_docs(target_relation, model) %}\n\n {{ run_hooks(post_hooks, inside_transaction=True) }}\n\n {{ adapter.commit() }}\n\n {{ drop_relation_if_exists(backup_relation) }}\n\n {{ run_hooks(post_hooks, inside_transaction=False) }}\n\n {{ return({'relations': [target_relation]}) }}\n\n{%- endmaterialization -%}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.load_cached_relation", "macro.dbt.make_intermediate_relation", "macro.dbt.make_backup_relation", "macro.dbt.run_hooks", "macro.dbt.drop_relation_if_exists", "macro.dbt.statement", "macro.dbt.get_create_view_as_sql", "macro.dbt.should_revoke", "macro.dbt.apply_grants", "macro.dbt.persist_docs"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600952.8919868}, "macro.dbt.handle_existing_table": {"unique_id": "macro.dbt.handle_existing_table", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.2.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/view/helpers.sql", "original_file_path": "macros/materializations/models/view/helpers.sql", "name": "handle_existing_table", "macro_sql": "{% macro handle_existing_table(full_refresh, old_relation) %}\n {{ adapter.dispatch('handle_existing_table', 'dbt')(full_refresh, old_relation) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__handle_existing_table"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600952.892334}, "macro.dbt.default__handle_existing_table": {"unique_id": "macro.dbt.default__handle_existing_table", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.2.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/view/helpers.sql", "original_file_path": "macros/materializations/models/view/helpers.sql", "name": "default__handle_existing_table", "macro_sql": "{% macro default__handle_existing_table(full_refresh, old_relation) %}\n {{ log(\"Dropping relation \" ~ old_relation ~ \" because it is of type \" ~ old_relation.type) }}\n {{ adapter.drop_relation(old_relation) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600952.892549}, "macro.dbt.create_or_replace_view": {"unique_id": "macro.dbt.create_or_replace_view", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.2.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/view/create_or_replace_view.sql", "original_file_path": "macros/materializations/models/view/create_or_replace_view.sql", "name": "create_or_replace_view", "macro_sql": "{% macro create_or_replace_view() %}\n {%- set identifier = model['alias'] -%}\n\n {%- set old_relation = adapter.get_relation(database=database, schema=schema, identifier=identifier) -%}\n {%- set exists_as_view = (old_relation is not none and old_relation.is_view) -%}\n\n {%- set target_relation = api.Relation.create(\n identifier=identifier, schema=schema, database=database,\n type='view') -%}\n {% set grant_config = config.get('grants') %}\n\n {{ run_hooks(pre_hooks) }}\n\n -- If there's a table with the same name and we weren't told to full refresh,\n -- that's an error. If we were told to full refresh, drop it. This behavior differs\n -- for Snowflake and BigQuery, so multiple dispatch is used.\n {%- if old_relation is not none and old_relation.is_table -%}\n {{ handle_existing_table(should_full_refresh(), old_relation) }}\n {%- endif -%}\n\n -- build model\n {% call statement('main') -%}\n {{ get_create_view_as_sql(target_relation, sql) }}\n {%- endcall %}\n\n {% set should_revoke = should_revoke(exists_as_view, full_refresh_mode=True) %}\n {% do apply_grants(target_relation, grant_config, should_revoke=True) %}\n\n {{ run_hooks(post_hooks) }}\n\n {{ return({'relations': [target_relation]}) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.run_hooks", "macro.dbt.handle_existing_table", "macro.dbt.should_full_refresh", "macro.dbt.statement", "macro.dbt.get_create_view_as_sql", "macro.dbt.should_revoke", "macro.dbt.apply_grants"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600952.894033}, "macro.dbt.get_create_view_as_sql": {"unique_id": "macro.dbt.get_create_view_as_sql", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.2.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/view/create_view_as.sql", "original_file_path": "macros/materializations/models/view/create_view_as.sql", "name": "get_create_view_as_sql", "macro_sql": "{% macro get_create_view_as_sql(relation, sql) -%}\n {{ adapter.dispatch('get_create_view_as_sql', 'dbt')(relation, sql) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__get_create_view_as_sql"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600952.894437}, "macro.dbt.default__get_create_view_as_sql": {"unique_id": "macro.dbt.default__get_create_view_as_sql", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.2.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/view/create_view_as.sql", "original_file_path": "macros/materializations/models/view/create_view_as.sql", "name": "default__get_create_view_as_sql", "macro_sql": "{% macro default__get_create_view_as_sql(relation, sql) -%}\n {{ return(create_view_as(relation, sql)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.create_view_as"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600952.894594}, "macro.dbt.create_view_as": {"unique_id": "macro.dbt.create_view_as", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.2.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/view/create_view_as.sql", "original_file_path": "macros/materializations/models/view/create_view_as.sql", "name": "create_view_as", "macro_sql": "{% macro create_view_as(relation, sql) -%}\n {{ adapter.dispatch('create_view_as', 'dbt')(relation, sql) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__create_view_as"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600952.89477}, "macro.dbt.default__create_view_as": {"unique_id": "macro.dbt.default__create_view_as", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.2.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/view/create_view_as.sql", "original_file_path": "macros/materializations/models/view/create_view_as.sql", "name": "default__create_view_as", "macro_sql": "{% macro default__create_view_as(relation, sql) -%}\n {%- set sql_header = config.get('sql_header', none) -%}\n\n {{ sql_header if sql_header is not none }}\n create view {{ relation }} as (\n {{ sql }}\n );\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600952.895021}, "macro.dbt.materialization_seed_default": {"unique_id": "macro.dbt.materialization_seed_default", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.2.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/seeds/seed.sql", "original_file_path": "macros/materializations/seeds/seed.sql", "name": "materialization_seed_default", "macro_sql": "{% materialization seed, default %}\n\n {%- set identifier = model['alias'] -%}\n {%- set full_refresh_mode = (should_full_refresh()) -%}\n\n {%- set old_relation = adapter.get_relation(database=database, schema=schema, identifier=identifier) -%}\n\n {%- set exists_as_table = (old_relation is not none and old_relation.is_table) -%}\n {%- set exists_as_view = (old_relation is not none and old_relation.is_view) -%}\n\n {%- set grant_config = config.get('grants') -%}\n {%- set agate_table = load_agate_table() -%}\n -- grab current tables grants config for comparision later on\n\n {%- do store_result('agate_table', response='OK', agate_table=agate_table) -%}\n\n {{ run_hooks(pre_hooks, inside_transaction=False) }}\n\n -- `BEGIN` happens here:\n {{ run_hooks(pre_hooks, inside_transaction=True) }}\n\n -- build model\n {% set create_table_sql = \"\" %}\n {% if exists_as_view %}\n {{ exceptions.raise_compiler_error(\"Cannot seed to '{}', it is a view\".format(old_relation)) }}\n {% elif exists_as_table %}\n {% set create_table_sql = reset_csv_table(model, full_refresh_mode, old_relation, agate_table) %}\n {% else %}\n {% set create_table_sql = create_csv_table(model, agate_table) %}\n {% endif %}\n\n {% set code = 'CREATE' if full_refresh_mode else 'INSERT' %}\n {% set rows_affected = (agate_table.rows | length) %}\n {% set sql = load_csv_rows(model, agate_table) %}\n\n {% call noop_statement('main', code ~ ' ' ~ rows_affected, code, rows_affected) %}\n {{ get_csv_sql(create_table_sql, sql) }};\n {% endcall %}\n\n {% set target_relation = this.incorporate(type='table') %}\n\n {% set should_revoke = should_revoke(old_relation, full_refresh_mode) %}\n {% do apply_grants(target_relation, grant_config, should_revoke=should_revoke) %}\n\n {% do persist_docs(target_relation, model) %}\n\n {% if full_refresh_mode or not exists_as_table %}\n {% do create_indexes(target_relation) %}\n {% endif %}\n\n {{ run_hooks(post_hooks, inside_transaction=True) }}\n\n -- `COMMIT` happens here\n {{ adapter.commit() }}\n\n {{ run_hooks(post_hooks, inside_transaction=False) }}\n\n {{ return({'relations': [target_relation]}) }}\n\n{% endmaterialization %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.should_full_refresh", "macro.dbt.run_hooks", "macro.dbt.reset_csv_table", "macro.dbt.create_csv_table", "macro.dbt.load_csv_rows", "macro.dbt.noop_statement", "macro.dbt.get_csv_sql", "macro.dbt.should_revoke", "macro.dbt.apply_grants", "macro.dbt.persist_docs", "macro.dbt.create_indexes"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600952.898175}, "macro.dbt.create_csv_table": {"unique_id": "macro.dbt.create_csv_table", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.2.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/seeds/helpers.sql", "original_file_path": "macros/materializations/seeds/helpers.sql", "name": "create_csv_table", "macro_sql": "{% macro create_csv_table(model, agate_table) -%}\n {{ adapter.dispatch('create_csv_table', 'dbt')(model, agate_table) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__create_csv_table"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600952.902514}, "macro.dbt.default__create_csv_table": {"unique_id": "macro.dbt.default__create_csv_table", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.2.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/seeds/helpers.sql", "original_file_path": "macros/materializations/seeds/helpers.sql", "name": "default__create_csv_table", "macro_sql": "{% macro default__create_csv_table(model, agate_table) %}\n {%- set column_override = model['config'].get('column_types', {}) -%}\n {%- set quote_seed_column = model['config'].get('quote_columns', None) -%}\n\n {% set sql %}\n create table {{ this.render() }} (\n {%- for col_name in agate_table.column_names -%}\n {%- set inferred_type = adapter.convert_type(agate_table, loop.index0) -%}\n {%- set type = column_override.get(col_name, inferred_type) -%}\n {%- set column_name = (col_name | string) -%}\n {{ adapter.quote_seed_column(column_name, quote_seed_column) }} {{ type }} {%- if not loop.last -%}, {%- endif -%}\n {%- endfor -%}\n )\n {% endset %}\n\n {% call statement('_') -%}\n {{ sql }}\n {%- endcall %}\n\n {{ return(sql) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600952.9033852}, "macro.dbt.reset_csv_table": {"unique_id": "macro.dbt.reset_csv_table", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.2.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/seeds/helpers.sql", "original_file_path": "macros/materializations/seeds/helpers.sql", "name": "reset_csv_table", "macro_sql": "{% macro reset_csv_table(model, full_refresh, old_relation, agate_table) -%}\n {{ adapter.dispatch('reset_csv_table', 'dbt')(model, full_refresh, old_relation, agate_table) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__reset_csv_table"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600952.903612}, "macro.dbt.default__reset_csv_table": {"unique_id": "macro.dbt.default__reset_csv_table", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.2.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/seeds/helpers.sql", "original_file_path": "macros/materializations/seeds/helpers.sql", "name": "default__reset_csv_table", "macro_sql": "{% macro default__reset_csv_table(model, full_refresh, old_relation, agate_table) %}\n {% set sql = \"\" %}\n {% if full_refresh %}\n {{ adapter.drop_relation(old_relation) }}\n {% set sql = create_csv_table(model, agate_table) %}\n {% else %}\n {{ adapter.truncate_relation(old_relation) }}\n {% set sql = \"truncate table \" ~ old_relation %}\n {% endif %}\n\n {{ return(sql) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.create_csv_table"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600952.904077}, "macro.dbt.get_csv_sql": {"unique_id": "macro.dbt.get_csv_sql", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.2.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/seeds/helpers.sql", "original_file_path": "macros/materializations/seeds/helpers.sql", "name": "get_csv_sql", "macro_sql": "{% macro get_csv_sql(create_or_truncate_sql, insert_sql) %}\n {{ adapter.dispatch('get_csv_sql', 'dbt')(create_or_truncate_sql, insert_sql) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__get_csv_sql"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600952.9042618}, "macro.dbt.default__get_csv_sql": {"unique_id": "macro.dbt.default__get_csv_sql", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.2.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/seeds/helpers.sql", "original_file_path": "macros/materializations/seeds/helpers.sql", "name": "default__get_csv_sql", "macro_sql": "{% macro default__get_csv_sql(create_or_truncate_sql, insert_sql) %}\n {{ create_or_truncate_sql }};\n -- dbt seed --\n {{ insert_sql }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600952.9043891}, "macro.dbt.get_binding_char": {"unique_id": "macro.dbt.get_binding_char", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.2.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/seeds/helpers.sql", "original_file_path": "macros/materializations/seeds/helpers.sql", "name": "get_binding_char", "macro_sql": "{% macro get_binding_char() -%}\n {{ adapter.dispatch('get_binding_char', 'dbt')() }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__get_binding_char"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600952.904521}, "macro.dbt.default__get_binding_char": {"unique_id": "macro.dbt.default__get_binding_char", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.2.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/seeds/helpers.sql", "original_file_path": "macros/materializations/seeds/helpers.sql", "name": "default__get_binding_char", "macro_sql": "{% macro default__get_binding_char() %}\n {{ return('%s') }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600952.904633}, "macro.dbt.get_batch_size": {"unique_id": "macro.dbt.get_batch_size", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.2.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/seeds/helpers.sql", "original_file_path": "macros/materializations/seeds/helpers.sql", "name": "get_batch_size", "macro_sql": "{% macro get_batch_size() -%}\n {{ return(adapter.dispatch('get_batch_size', 'dbt')()) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__get_batch_size"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600952.90479}, "macro.dbt.default__get_batch_size": {"unique_id": "macro.dbt.default__get_batch_size", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.2.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/seeds/helpers.sql", "original_file_path": "macros/materializations/seeds/helpers.sql", "name": "default__get_batch_size", "macro_sql": "{% macro default__get_batch_size() %}\n {{ return(10000) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600952.9048991}, "macro.dbt.get_seed_column_quoted_csv": {"unique_id": "macro.dbt.get_seed_column_quoted_csv", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.2.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/seeds/helpers.sql", "original_file_path": "macros/materializations/seeds/helpers.sql", "name": "get_seed_column_quoted_csv", "macro_sql": "{% macro get_seed_column_quoted_csv(model, column_names) %}\n {%- set quote_seed_column = model['config'].get('quote_columns', None) -%}\n {% set quoted = [] %}\n {% for col in column_names -%}\n {%- do quoted.append(adapter.quote_seed_column(col, quote_seed_column)) -%}\n {%- endfor %}\n\n {%- set dest_cols_csv = quoted | join(', ') -%}\n {{ return(dest_cols_csv) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600952.9053571}, "macro.dbt.load_csv_rows": {"unique_id": "macro.dbt.load_csv_rows", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.2.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/seeds/helpers.sql", "original_file_path": "macros/materializations/seeds/helpers.sql", "name": "load_csv_rows", "macro_sql": "{% macro load_csv_rows(model, agate_table) -%}\n {{ adapter.dispatch('load_csv_rows', 'dbt')(model, agate_table) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__load_csv_rows"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600952.905531}, "macro.dbt.default__load_csv_rows": {"unique_id": "macro.dbt.default__load_csv_rows", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.2.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/seeds/helpers.sql", "original_file_path": "macros/materializations/seeds/helpers.sql", "name": "default__load_csv_rows", "macro_sql": "{% macro default__load_csv_rows(model, agate_table) %}\n\n {% set batch_size = get_batch_size() %}\n\n {% set cols_sql = get_seed_column_quoted_csv(model, agate_table.column_names) %}\n {% set bindings = [] %}\n\n {% set statements = [] %}\n\n {% for chunk in agate_table.rows | batch(batch_size) %}\n {% set bindings = [] %}\n\n {% for row in chunk %}\n {% do bindings.extend(row) %}\n {% endfor %}\n\n {% set sql %}\n insert into {{ this.render() }} ({{ cols_sql }}) values\n {% for row in chunk -%}\n ({%- for column in agate_table.column_names -%}\n {{ get_binding_char() }}\n {%- if not loop.last%},{%- endif %}\n {%- endfor -%})\n {%- if not loop.last%},{%- endif %}\n {%- endfor %}\n {% endset %}\n\n {% do adapter.add_query(sql, bindings=bindings, abridge_sql_log=True) %}\n\n {% if loop.index0 == 0 %}\n {% do statements.append(sql) %}\n {% endif %}\n {% endfor %}\n\n {# Return SQL so we can render it out into the compiled files #}\n {{ return(statements[0]) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.get_batch_size", "macro.dbt.get_seed_column_quoted_csv", "macro.dbt.get_binding_char"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600952.9067562}, "macro.dbt.generate_alias_name": {"unique_id": "macro.dbt.generate_alias_name", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.2.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/get_custom_name/get_custom_alias.sql", "original_file_path": "macros/get_custom_name/get_custom_alias.sql", "name": "generate_alias_name", "macro_sql": "{% macro generate_alias_name(custom_alias_name=none, node=none) -%}\n {% do return(adapter.dispatch('generate_alias_name', 'dbt')(custom_alias_name, node)) %}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__generate_alias_name"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600952.907199}, "macro.dbt.default__generate_alias_name": {"unique_id": "macro.dbt.default__generate_alias_name", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.2.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/get_custom_name/get_custom_alias.sql", "original_file_path": "macros/get_custom_name/get_custom_alias.sql", "name": "default__generate_alias_name", "macro_sql": "{% macro default__generate_alias_name(custom_alias_name=none, node=none) -%}\n\n {%- if custom_alias_name is none -%}\n\n {{ node.name }}\n\n {%- else -%}\n\n {{ custom_alias_name | trim }}\n\n {%- endif -%}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600952.9074209}, "macro.dbt.generate_schema_name": {"unique_id": "macro.dbt.generate_schema_name", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.2.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/get_custom_name/get_custom_schema.sql", "original_file_path": "macros/get_custom_name/get_custom_schema.sql", "name": "generate_schema_name", "macro_sql": "{% macro generate_schema_name(custom_schema_name=none, node=none) -%}\n {{ return(adapter.dispatch('generate_schema_name', 'dbt')(custom_schema_name, node)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__generate_schema_name"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600952.907972}, "macro.dbt.default__generate_schema_name": {"unique_id": "macro.dbt.default__generate_schema_name", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.2.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/get_custom_name/get_custom_schema.sql", "original_file_path": "macros/get_custom_name/get_custom_schema.sql", "name": "default__generate_schema_name", "macro_sql": "{% macro default__generate_schema_name(custom_schema_name, node) -%}\n\n {%- set default_schema = target.schema -%}\n {%- if custom_schema_name is none -%}\n\n {{ default_schema }}\n\n {%- else -%}\n\n {{ default_schema }}_{{ custom_schema_name | trim }}\n\n {%- endif -%}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600952.908224}, "macro.dbt.generate_schema_name_for_env": {"unique_id": "macro.dbt.generate_schema_name_for_env", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.2.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/get_custom_name/get_custom_schema.sql", "original_file_path": "macros/get_custom_name/get_custom_schema.sql", "name": "generate_schema_name_for_env", "macro_sql": "{% macro generate_schema_name_for_env(custom_schema_name, node) -%}\n\n {%- set default_schema = target.schema -%}\n {%- if target.name == 'prod' and custom_schema_name is not none -%}\n\n {{ custom_schema_name | trim }}\n\n {%- else -%}\n\n {{ default_schema }}\n\n {%- endif -%}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600952.9084969}, "macro.dbt.generate_database_name": {"unique_id": "macro.dbt.generate_database_name", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.2.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/get_custom_name/get_custom_database.sql", "original_file_path": "macros/get_custom_name/get_custom_database.sql", "name": "generate_database_name", "macro_sql": "{% macro generate_database_name(custom_database_name=none, node=none) -%}\n {% do return(adapter.dispatch('generate_database_name', 'dbt')(custom_database_name, node)) %}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__generate_database_name"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600952.9089339}, "macro.dbt.default__generate_database_name": {"unique_id": "macro.dbt.default__generate_database_name", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.2.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/get_custom_name/get_custom_database.sql", "original_file_path": "macros/get_custom_name/get_custom_database.sql", "name": "default__generate_database_name", "macro_sql": "{% macro default__generate_database_name(custom_database_name=none, node=none) -%}\n {%- set default_database = target.database -%}\n {%- if custom_database_name is none -%}\n\n {{ default_database }}\n\n {%- else -%}\n\n {{ custom_database_name }}\n\n {%- endif -%}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600952.909179}, "macro.dbt.default__test_relationships": {"unique_id": "macro.dbt.default__test_relationships", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.2.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/generic_test_sql/relationships.sql", "original_file_path": "macros/generic_test_sql/relationships.sql", "name": "default__test_relationships", "macro_sql": "{% macro default__test_relationships(model, column_name, to, field) %}\n\nwith child as (\n select {{ column_name }} as from_field\n from {{ model }}\n where {{ column_name }} is not null\n),\n\nparent as (\n select {{ field }} as to_field\n from {{ to }}\n)\n\nselect\n from_field\n\nfrom child\nleft join parent\n on child.from_field = parent.to_field\n\nwhere parent.to_field is null\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600952.909569}, "macro.dbt.default__test_not_null": {"unique_id": "macro.dbt.default__test_not_null", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.2.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/generic_test_sql/not_null.sql", "original_file_path": "macros/generic_test_sql/not_null.sql", "name": "default__test_not_null", "macro_sql": "{% macro default__test_not_null(model, column_name) %}\n\n{% set column_list = '*' if should_store_failures() else column_name %}\n\nselect {{ column_list }}\nfrom {{ model }}\nwhere {{ column_name }} is null\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.should_store_failures"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600952.909919}, "macro.dbt.default__test_unique": {"unique_id": "macro.dbt.default__test_unique", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.2.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/generic_test_sql/unique.sql", "original_file_path": "macros/generic_test_sql/unique.sql", "name": "default__test_unique", "macro_sql": "{% macro default__test_unique(model, column_name) %}\n\nselect\n {{ column_name }} as unique_field,\n count(*) as n_records\n\nfrom {{ model }}\nwhere {{ column_name }} is not null\ngroup by {{ column_name }}\nhaving count(*) > 1\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600952.910232}, "macro.dbt.default__test_accepted_values": {"unique_id": "macro.dbt.default__test_accepted_values", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.2.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/generic_test_sql/accepted_values.sql", "original_file_path": "macros/generic_test_sql/accepted_values.sql", "name": "default__test_accepted_values", "macro_sql": "{% macro default__test_accepted_values(model, column_name, values, quote=True) %}\n\nwith all_values as (\n\n select\n {{ column_name }} as value_field,\n count(*) as n_records\n\n from {{ model }}\n group by {{ column_name }}\n\n)\n\nselect *\nfrom all_values\nwhere value_field not in (\n {% for value in values -%}\n {% if quote -%}\n '{{ value }}'\n {%- else -%}\n {{ value }}\n {%- endif -%}\n {%- if not loop.last -%},{%- endif %}\n {%- endfor %}\n)\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600952.910829}, "macro.dbt.statement": {"unique_id": "macro.dbt.statement", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.2.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/etc/statement.sql", "original_file_path": "macros/etc/statement.sql", "name": "statement", "macro_sql": "{% macro statement(name=None, fetch_result=False, auto_begin=True) -%}\n {%- if execute: -%}\n {%- set sql = caller() -%}\n\n {%- if name == 'main' -%}\n {{ log('Writing runtime SQL for node \"{}\"'.format(model['unique_id'])) }}\n {{ write(sql) }}\n {%- endif -%}\n\n {%- set res, table = adapter.execute(sql, auto_begin=auto_begin, fetch=fetch_result) -%}\n {%- if name is not none -%}\n {{ store_result(name, response=res, agate_table=table) }}\n {%- endif -%}\n\n {%- endif -%}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600952.91193}, "macro.dbt.noop_statement": {"unique_id": "macro.dbt.noop_statement", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.2.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/etc/statement.sql", "original_file_path": "macros/etc/statement.sql", "name": "noop_statement", "macro_sql": "{% macro noop_statement(name=None, message=None, code=None, rows_affected=None, res=None) -%}\n {%- set sql = caller() -%}\n\n {%- if name == 'main' -%}\n {{ log('Writing runtime SQL for node \"{}\"'.format(model['unique_id'])) }}\n {{ write(sql) }}\n {%- endif -%}\n\n {%- if name is not none -%}\n {{ store_raw_result(name, message=message, code=code, rows_affected=rows_affected, agate_table=res) }}\n {%- endif -%}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600952.912482}, "macro.dbt.run_query": {"unique_id": "macro.dbt.run_query", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.2.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/etc/statement.sql", "original_file_path": "macros/etc/statement.sql", "name": "run_query", "macro_sql": "{% macro run_query(sql) %}\n {% call statement(\"run_query_statement\", fetch_result=true, auto_begin=false) %}\n {{ sql }}\n {% endcall %}\n\n {% do return(load_result(\"run_query_statement\").table) %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600952.912767}, "macro.dbt.convert_datetime": {"unique_id": "macro.dbt.convert_datetime", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.2.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/etc/datetime.sql", "original_file_path": "macros/etc/datetime.sql", "name": "convert_datetime", "macro_sql": "{% macro convert_datetime(date_str, date_fmt) %}\n\n {% set error_msg -%}\n The provided partition date '{{ date_str }}' does not match the expected format '{{ date_fmt }}'\n {%- endset %}\n\n {% set res = try_or_compiler_error(error_msg, modules.datetime.datetime.strptime, date_str.strip(), date_fmt) %}\n {{ return(res) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600952.914465}, "macro.dbt.dates_in_range": {"unique_id": "macro.dbt.dates_in_range", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.2.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/etc/datetime.sql", "original_file_path": "macros/etc/datetime.sql", "name": "dates_in_range", "macro_sql": "{% macro dates_in_range(start_date_str, end_date_str=none, in_fmt=\"%Y%m%d\", out_fmt=\"%Y%m%d\") %}\n {% set end_date_str = start_date_str if end_date_str is none else end_date_str %}\n\n {% set start_date = convert_datetime(start_date_str, in_fmt) %}\n {% set end_date = convert_datetime(end_date_str, in_fmt) %}\n\n {% set day_count = (end_date - start_date).days %}\n {% if day_count < 0 %}\n {% set msg -%}\n Partiton start date is after the end date ({{ start_date }}, {{ end_date }})\n {%- endset %}\n\n {{ exceptions.raise_compiler_error(msg, model) }}\n {% endif %}\n\n {% set date_list = [] %}\n {% for i in range(0, day_count + 1) %}\n {% set the_date = (modules.datetime.timedelta(days=i) + start_date) %}\n {% if not out_fmt %}\n {% set _ = date_list.append(the_date) %}\n {% else %}\n {% set _ = date_list.append(the_date.strftime(out_fmt)) %}\n {% endif %}\n {% endfor %}\n\n {{ return(date_list) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.convert_datetime"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600952.915682}, "macro.dbt.partition_range": {"unique_id": "macro.dbt.partition_range", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.2.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/etc/datetime.sql", "original_file_path": "macros/etc/datetime.sql", "name": "partition_range", "macro_sql": "{% macro partition_range(raw_partition_date, date_fmt='%Y%m%d') %}\n {% set partition_range = (raw_partition_date | string).split(\",\") %}\n\n {% if (partition_range | length) == 1 %}\n {% set start_date = partition_range[0] %}\n {% set end_date = none %}\n {% elif (partition_range | length) == 2 %}\n {% set start_date = partition_range[0] %}\n {% set end_date = partition_range[1] %}\n {% else %}\n {{ exceptions.raise_compiler_error(\"Invalid partition time. Expected format: {Start Date}[,{End Date}]. Got: \" ~ raw_partition_date) }}\n {% endif %}\n\n {{ return(dates_in_range(start_date, end_date, in_fmt=date_fmt)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.dates_in_range"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600952.9164019}, "macro.dbt.py_current_timestring": {"unique_id": "macro.dbt.py_current_timestring", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.2.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/etc/datetime.sql", "original_file_path": "macros/etc/datetime.sql", "name": "py_current_timestring", "macro_sql": "{% macro py_current_timestring() %}\n {% set dt = modules.datetime.datetime.now() %}\n {% do return(dt.strftime(\"%Y%m%d%H%M%S%f\")) %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600952.916629}, "macro.dbt.except": {"unique_id": "macro.dbt.except", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.2.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/except.sql", "original_file_path": "macros/utils/except.sql", "name": "except", "macro_sql": "{% macro except() %}\n {{ return(adapter.dispatch('except', 'dbt')()) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.bigquery__except"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600952.9169128}, "macro.dbt.default__except": {"unique_id": "macro.dbt.default__except", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.2.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/except.sql", "original_file_path": "macros/utils/except.sql", "name": "default__except", "macro_sql": "{% macro default__except() %}\n\n except\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600952.91699}, "macro.dbt.replace": {"unique_id": "macro.dbt.replace", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.2.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/replace.sql", "original_file_path": "macros/utils/replace.sql", "name": "replace", "macro_sql": "{% macro replace(field, old_chars, new_chars) -%}\n {{ return(adapter.dispatch('replace', 'dbt') (field, old_chars, new_chars)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__replace"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600952.917363}, "macro.dbt.default__replace": {"unique_id": "macro.dbt.default__replace", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.2.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/replace.sql", "original_file_path": "macros/utils/replace.sql", "name": "default__replace", "macro_sql": "{% macro default__replace(field, old_chars, new_chars) %}\n\n replace(\n {{ field }},\n {{ old_chars }},\n {{ new_chars }}\n )\n\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600952.917521}, "macro.dbt.concat": {"unique_id": "macro.dbt.concat", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.2.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/concat.sql", "original_file_path": "macros/utils/concat.sql", "name": "concat", "macro_sql": "{% macro concat(fields) -%}\n {{ return(adapter.dispatch('concat', 'dbt')(fields)) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__concat"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600952.9178188}, "macro.dbt.default__concat": {"unique_id": "macro.dbt.default__concat", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.2.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/concat.sql", "original_file_path": "macros/utils/concat.sql", "name": "default__concat", "macro_sql": "{% macro default__concat(fields) -%}\n {{ fields|join(' || ') }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600952.91794}, "macro.dbt.length": {"unique_id": "macro.dbt.length", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.2.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/length.sql", "original_file_path": "macros/utils/length.sql", "name": "length", "macro_sql": "{% macro length(expression) -%}\n {{ return(adapter.dispatch('length', 'dbt') (expression)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__length"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600952.9182432}, "macro.dbt.default__length": {"unique_id": "macro.dbt.default__length", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.2.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/length.sql", "original_file_path": "macros/utils/length.sql", "name": "default__length", "macro_sql": "{% macro default__length(expression) %}\n\n length(\n {{ expression }}\n )\n\n{%- endmacro -%}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600952.9183471}, "macro.dbt.dateadd": {"unique_id": "macro.dbt.dateadd", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.2.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/dateadd.sql", "original_file_path": "macros/utils/dateadd.sql", "name": "dateadd", "macro_sql": "{% macro dateadd(datepart, interval, from_date_or_timestamp) %}\n {{ return(adapter.dispatch('dateadd', 'dbt')(datepart, interval, from_date_or_timestamp)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.bigquery__dateadd"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600952.918729}, "macro.dbt.default__dateadd": {"unique_id": "macro.dbt.default__dateadd", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.2.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/dateadd.sql", "original_file_path": "macros/utils/dateadd.sql", "name": "default__dateadd", "macro_sql": "{% macro default__dateadd(datepart, interval, from_date_or_timestamp) %}\n\n dateadd(\n {{ datepart }},\n {{ interval }},\n {{ from_date_or_timestamp }}\n )\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600952.918884}, "macro.dbt.intersect": {"unique_id": "macro.dbt.intersect", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.2.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/intersect.sql", "original_file_path": "macros/utils/intersect.sql", "name": "intersect", "macro_sql": "{% macro intersect() %}\n {{ return(adapter.dispatch('intersect', 'dbt')()) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.bigquery__intersect"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600952.9191601}, "macro.dbt.default__intersect": {"unique_id": "macro.dbt.default__intersect", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.2.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/intersect.sql", "original_file_path": "macros/utils/intersect.sql", "name": "default__intersect", "macro_sql": "{% macro default__intersect() %}\n\n intersect\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600952.919234}, "macro.dbt.escape_single_quotes": {"unique_id": "macro.dbt.escape_single_quotes", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.2.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/escape_single_quotes.sql", "original_file_path": "macros/utils/escape_single_quotes.sql", "name": "escape_single_quotes", "macro_sql": "{% macro escape_single_quotes(expression) %}\n {{ return(adapter.dispatch('escape_single_quotes', 'dbt') (expression)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.bigquery__escape_single_quotes"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600952.9195452}, "macro.dbt.default__escape_single_quotes": {"unique_id": "macro.dbt.default__escape_single_quotes", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.2.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/escape_single_quotes.sql", "original_file_path": "macros/utils/escape_single_quotes.sql", "name": "default__escape_single_quotes", "macro_sql": "{% macro default__escape_single_quotes(expression) -%}\n{{ expression | replace(\"'\",\"''\") }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600952.919683}, "macro.dbt.right": {"unique_id": "macro.dbt.right", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.2.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/right.sql", "original_file_path": "macros/utils/right.sql", "name": "right", "macro_sql": "{% macro right(string_text, length_expression) -%}\n {{ return(adapter.dispatch('right', 'dbt') (string_text, length_expression)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.bigquery__right"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600952.920025}, "macro.dbt.default__right": {"unique_id": "macro.dbt.default__right", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.2.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/right.sql", "original_file_path": "macros/utils/right.sql", "name": "default__right", "macro_sql": "{% macro default__right(string_text, length_expression) %}\n\n right(\n {{ string_text }},\n {{ length_expression }}\n )\n\n{%- endmacro -%}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600952.9201589}, "macro.dbt.listagg": {"unique_id": "macro.dbt.listagg", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.2.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/listagg.sql", "original_file_path": "macros/utils/listagg.sql", "name": "listagg", "macro_sql": "{% macro listagg(measure, delimiter_text=\"','\", order_by_clause=none, limit_num=none) -%}\n {{ return(adapter.dispatch('listagg', 'dbt') (measure, delimiter_text, order_by_clause, limit_num)) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.bigquery__listagg"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600952.920802}, "macro.dbt.default__listagg": {"unique_id": "macro.dbt.default__listagg", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.2.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/listagg.sql", "original_file_path": "macros/utils/listagg.sql", "name": "default__listagg", "macro_sql": "{% macro default__listagg(measure, delimiter_text, order_by_clause, limit_num) -%}\n\n {% if limit_num -%}\n array_to_string(\n array_slice(\n array_agg(\n {{ measure }}\n ){% if order_by_clause -%}\n within group ({{ order_by_clause }})\n {%- endif %}\n ,0\n ,{{ limit_num }}\n ),\n {{ delimiter_text }}\n )\n {%- else %}\n listagg(\n {{ measure }},\n {{ delimiter_text }}\n )\n {% if order_by_clause -%}\n within group ({{ order_by_clause }})\n {%- endif %}\n {%- endif %}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600952.921257}, "macro.dbt.datediff": {"unique_id": "macro.dbt.datediff", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.2.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/datediff.sql", "original_file_path": "macros/utils/datediff.sql", "name": "datediff", "macro_sql": "{% macro datediff(first_date, second_date, datepart) %}\n {{ return(adapter.dispatch('datediff', 'dbt')(first_date, second_date, datepart)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.bigquery__datediff"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600952.9216378}, "macro.dbt.default__datediff": {"unique_id": "macro.dbt.default__datediff", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.2.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/datediff.sql", "original_file_path": "macros/utils/datediff.sql", "name": "default__datediff", "macro_sql": "{% macro default__datediff(first_date, second_date, datepart) -%}\n\n datediff(\n {{ datepart }},\n {{ first_date }},\n {{ second_date }}\n )\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600952.921794}, "macro.dbt.safe_cast": {"unique_id": "macro.dbt.safe_cast", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.2.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/safe_cast.sql", "original_file_path": "macros/utils/safe_cast.sql", "name": "safe_cast", "macro_sql": "{% macro safe_cast(field, type) %}\n {{ return(adapter.dispatch('safe_cast', 'dbt') (field, type)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.bigquery__safe_cast"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600952.922129}, "macro.dbt.default__safe_cast": {"unique_id": "macro.dbt.default__safe_cast", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.2.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/safe_cast.sql", "original_file_path": "macros/utils/safe_cast.sql", "name": "default__safe_cast", "macro_sql": "{% macro default__safe_cast(field, type) %}\n {# most databases don't support this function yet\n so we just need to use cast #}\n cast({{field}} as {{type}})\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600952.922265}, "macro.dbt.hash": {"unique_id": "macro.dbt.hash", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.2.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/hash.sql", "original_file_path": "macros/utils/hash.sql", "name": "hash", "macro_sql": "{% macro hash(field) -%}\n {{ return(adapter.dispatch('hash', 'dbt') (field)) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.bigquery__hash"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600952.922571}, "macro.dbt.default__hash": {"unique_id": "macro.dbt.default__hash", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.2.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/hash.sql", "original_file_path": "macros/utils/hash.sql", "name": "default__hash", "macro_sql": "{% macro default__hash(field) -%}\n md5(cast({{ field }} as {{ api.Column.translate_type('string') }}))\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600952.9227278}, "macro.dbt.cast_bool_to_text": {"unique_id": "macro.dbt.cast_bool_to_text", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.2.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/cast_bool_to_text.sql", "original_file_path": "macros/utils/cast_bool_to_text.sql", "name": "cast_bool_to_text", "macro_sql": "{% macro cast_bool_to_text(field) %}\n {{ adapter.dispatch('cast_bool_to_text', 'dbt') (field) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__cast_bool_to_text"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600952.923024}, "macro.dbt.default__cast_bool_to_text": {"unique_id": "macro.dbt.default__cast_bool_to_text", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.2.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/cast_bool_to_text.sql", "original_file_path": "macros/utils/cast_bool_to_text.sql", "name": "default__cast_bool_to_text", "macro_sql": "{% macro default__cast_bool_to_text(field) %}\n cast({{ field }} as {{ api.Column.translate_type('string') }})\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600952.923176}, "macro.dbt.any_value": {"unique_id": "macro.dbt.any_value", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.2.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/any_value.sql", "original_file_path": "macros/utils/any_value.sql", "name": "any_value", "macro_sql": "{% macro any_value(expression) -%}\n {{ return(adapter.dispatch('any_value', 'dbt') (expression)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__any_value"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600952.923475}, "macro.dbt.default__any_value": {"unique_id": "macro.dbt.default__any_value", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.2.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/any_value.sql", "original_file_path": "macros/utils/any_value.sql", "name": "default__any_value", "macro_sql": "{% macro default__any_value(expression) -%}\n\n any_value({{ expression }})\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600952.923577}, "macro.dbt.position": {"unique_id": "macro.dbt.position", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.2.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/position.sql", "original_file_path": "macros/utils/position.sql", "name": "position", "macro_sql": "{% macro position(substring_text, string_text) -%}\n {{ return(adapter.dispatch('position', 'dbt') (substring_text, string_text)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.bigquery__position"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600952.923914}, "macro.dbt.default__position": {"unique_id": "macro.dbt.default__position", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.2.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/position.sql", "original_file_path": "macros/utils/position.sql", "name": "default__position", "macro_sql": "{% macro default__position(substring_text, string_text) %}\n\n position(\n {{ substring_text }} in {{ string_text }}\n )\n\n{%- endmacro -%}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600952.924046}, "macro.dbt.string_literal": {"unique_id": "macro.dbt.string_literal", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.2.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/literal.sql", "original_file_path": "macros/utils/literal.sql", "name": "string_literal", "macro_sql": "{%- macro string_literal(value) -%}\n {{ return(adapter.dispatch('string_literal', 'dbt') (value)) }}\n{%- endmacro -%}\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__string_literal"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600952.924342}, "macro.dbt.default__string_literal": {"unique_id": "macro.dbt.default__string_literal", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.2.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/literal.sql", "original_file_path": "macros/utils/literal.sql", "name": "default__string_literal", "macro_sql": "{% macro default__string_literal(value) -%}\n '{{ value }}'\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600952.924442}, "macro.dbt.type_string": {"unique_id": "macro.dbt.type_string", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.2.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/data_types.sql", "original_file_path": "macros/utils/data_types.sql", "name": "type_string", "macro_sql": "\n\n{%- macro type_string() -%}\n {{ return(adapter.dispatch('type_string', 'dbt')()) }}\n{%- endmacro -%}\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__type_string"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600952.925299}, "macro.dbt.default__type_string": {"unique_id": "macro.dbt.default__type_string", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.2.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/data_types.sql", "original_file_path": "macros/utils/data_types.sql", "name": "default__type_string", "macro_sql": "{% macro default__type_string() %}\n {{ return(api.Column.translate_type(\"string\")) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600952.925442}, "macro.dbt.type_timestamp": {"unique_id": "macro.dbt.type_timestamp", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.2.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/data_types.sql", "original_file_path": "macros/utils/data_types.sql", "name": "type_timestamp", "macro_sql": "\n\n{%- macro type_timestamp() -%}\n {{ return(adapter.dispatch('type_timestamp', 'dbt')()) }}\n{%- endmacro -%}\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__type_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600952.925597}, "macro.dbt.default__type_timestamp": {"unique_id": "macro.dbt.default__type_timestamp", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.2.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/data_types.sql", "original_file_path": "macros/utils/data_types.sql", "name": "default__type_timestamp", "macro_sql": "{% macro default__type_timestamp() %}\n {{ return(api.Column.translate_type(\"timestamp\")) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600952.925741}, "macro.dbt.type_float": {"unique_id": "macro.dbt.type_float", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.2.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/data_types.sql", "original_file_path": "macros/utils/data_types.sql", "name": "type_float", "macro_sql": "\n\n{%- macro type_float() -%}\n {{ return(adapter.dispatch('type_float', 'dbt')()) }}\n{%- endmacro -%}\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__type_float"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600952.925951}, "macro.dbt.default__type_float": {"unique_id": "macro.dbt.default__type_float", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.2.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/data_types.sql", "original_file_path": "macros/utils/data_types.sql", "name": "default__type_float", "macro_sql": "{% macro default__type_float() %}\n {{ return(api.Column.translate_type(\"float\")) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600952.926097}, "macro.dbt.type_numeric": {"unique_id": "macro.dbt.type_numeric", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.2.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/data_types.sql", "original_file_path": "macros/utils/data_types.sql", "name": "type_numeric", "macro_sql": "\n\n{%- macro type_numeric() -%}\n {{ return(adapter.dispatch('type_numeric', 'dbt')()) }}\n{%- endmacro -%}\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__type_numeric"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600952.926254}, "macro.dbt.default__type_numeric": {"unique_id": "macro.dbt.default__type_numeric", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.2.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/data_types.sql", "original_file_path": "macros/utils/data_types.sql", "name": "default__type_numeric", "macro_sql": "{% macro default__type_numeric() %}\n {{ return(api.Column.numeric_type(\"numeric\", 28, 6)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600952.926423}, "macro.dbt.type_bigint": {"unique_id": "macro.dbt.type_bigint", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.2.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/data_types.sql", "original_file_path": "macros/utils/data_types.sql", "name": "type_bigint", "macro_sql": "\n\n{%- macro type_bigint() -%}\n {{ return(adapter.dispatch('type_bigint', 'dbt')()) }}\n{%- endmacro -%}\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__type_bigint"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600952.9265769}, "macro.dbt.default__type_bigint": {"unique_id": "macro.dbt.default__type_bigint", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.2.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/data_types.sql", "original_file_path": "macros/utils/data_types.sql", "name": "default__type_bigint", "macro_sql": "{% macro default__type_bigint() %}\n {{ return(api.Column.translate_type(\"bigint\")) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600952.926723}, "macro.dbt.type_int": {"unique_id": "macro.dbt.type_int", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.2.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/data_types.sql", "original_file_path": "macros/utils/data_types.sql", "name": "type_int", "macro_sql": "\n\n{%- macro type_int() -%}\n {{ return(adapter.dispatch('type_int', 'dbt')()) }}\n{%- endmacro -%}\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__type_int"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600952.926879}, "macro.dbt.default__type_int": {"unique_id": "macro.dbt.default__type_int", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.2.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/data_types.sql", "original_file_path": "macros/utils/data_types.sql", "name": "default__type_int", "macro_sql": "{%- macro default__type_int() -%}\n {{ return(api.Column.translate_type(\"integer\")) }}\n{%- endmacro -%}\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600952.9270191}, "macro.dbt.bool_or": {"unique_id": "macro.dbt.bool_or", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.2.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/bool_or.sql", "original_file_path": "macros/utils/bool_or.sql", "name": "bool_or", "macro_sql": "{% macro bool_or(expression) -%}\n {{ return(adapter.dispatch('bool_or', 'dbt') (expression)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.bigquery__bool_or"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600952.927333}, "macro.dbt.default__bool_or": {"unique_id": "macro.dbt.default__bool_or", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.2.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/bool_or.sql", "original_file_path": "macros/utils/bool_or.sql", "name": "default__bool_or", "macro_sql": "{% macro default__bool_or(expression) -%}\n\n bool_or({{ expression }})\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600952.927435}, "macro.dbt.last_day": {"unique_id": "macro.dbt.last_day", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.2.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/last_day.sql", "original_file_path": "macros/utils/last_day.sql", "name": "last_day", "macro_sql": "{% macro last_day(date, datepart) %}\n {{ return(adapter.dispatch('last_day', 'dbt') (date, datepart)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__last_day"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600952.927822}, "macro.dbt.default_last_day": {"unique_id": "macro.dbt.default_last_day", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.2.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/last_day.sql", "original_file_path": "macros/utils/last_day.sql", "name": "default_last_day", "macro_sql": "\n\n{%- macro default_last_day(date, datepart) -%}\n cast(\n {{dbt.dateadd('day', '-1',\n dbt.dateadd(datepart, '1', dbt.date_trunc(datepart, date))\n )}}\n as date)\n{%- endmacro -%}\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.dateadd", "macro.dbt_utils.date_trunc"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600952.928077}, "macro.dbt.default__last_day": {"unique_id": "macro.dbt.default__last_day", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.2.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/last_day.sql", "original_file_path": "macros/utils/last_day.sql", "name": "default__last_day", "macro_sql": "{% macro default__last_day(date, datepart) -%}\n {{dbt.default_last_day(date, datepart)}}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default_last_day"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600952.9282188}, "macro.dbt.split_part": {"unique_id": "macro.dbt.split_part", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.2.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/split_part.sql", "original_file_path": "macros/utils/split_part.sql", "name": "split_part", "macro_sql": "{% macro split_part(string_text, delimiter_text, part_number) %}\n {{ return(adapter.dispatch('split_part', 'dbt') (string_text, delimiter_text, part_number)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.bigquery__split_part"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600952.928777}, "macro.dbt.default__split_part": {"unique_id": "macro.dbt.default__split_part", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.2.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/split_part.sql", "original_file_path": "macros/utils/split_part.sql", "name": "default__split_part", "macro_sql": "{% macro default__split_part(string_text, delimiter_text, part_number) %}\n\n split_part(\n {{ string_text }},\n {{ delimiter_text }},\n {{ part_number }}\n )\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600952.928938}, "macro.dbt._split_part_negative": {"unique_id": "macro.dbt._split_part_negative", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.2.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/split_part.sql", "original_file_path": "macros/utils/split_part.sql", "name": "_split_part_negative", "macro_sql": "{% macro _split_part_negative(string_text, delimiter_text, part_number) %}\n\n split_part(\n {{ string_text }},\n {{ delimiter_text }},\n length({{ string_text }})\n - length(\n replace({{ string_text }}, {{ delimiter_text }}, '')\n ) + 2 {{ part_number }}\n )\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600952.929151}, "macro.dbt.date_trunc": {"unique_id": "macro.dbt.date_trunc", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.2.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/date_trunc.sql", "original_file_path": "macros/utils/date_trunc.sql", "name": "date_trunc", "macro_sql": "{% macro date_trunc(datepart, date) -%}\n {{ return(adapter.dispatch('date_trunc', 'dbt') (datepart, date)) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.bigquery__date_trunc"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600952.929474}, "macro.dbt.default__date_trunc": {"unique_id": "macro.dbt.default__date_trunc", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.2.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/date_trunc.sql", "original_file_path": "macros/utils/date_trunc.sql", "name": "default__date_trunc", "macro_sql": "{% macro default__date_trunc(datepart, date) -%}\n date_trunc('{{datepart}}', {{date}})\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600952.9296}, "macro.dbt.create_schema": {"unique_id": "macro.dbt.create_schema", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.2.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/schema.sql", "original_file_path": "macros/adapters/schema.sql", "name": "create_schema", "macro_sql": "{% macro create_schema(relation) -%}\n {{ adapter.dispatch('create_schema', 'dbt')(relation) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__create_schema"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600952.930007}, "macro.dbt.default__create_schema": {"unique_id": "macro.dbt.default__create_schema", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.2.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/schema.sql", "original_file_path": "macros/adapters/schema.sql", "name": "default__create_schema", "macro_sql": "{% macro default__create_schema(relation) -%}\n {%- call statement('create_schema') -%}\n create schema if not exists {{ relation.without_identifier() }}\n {% endcall %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600952.930184}, "macro.dbt.drop_schema": {"unique_id": "macro.dbt.drop_schema", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.2.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/schema.sql", "original_file_path": "macros/adapters/schema.sql", "name": "drop_schema", "macro_sql": "{% macro drop_schema(relation) -%}\n {{ adapter.dispatch('drop_schema', 'dbt')(relation) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__drop_schema"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600952.93034}, "macro.dbt.default__drop_schema": {"unique_id": "macro.dbt.default__drop_schema", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.2.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/schema.sql", "original_file_path": "macros/adapters/schema.sql", "name": "default__drop_schema", "macro_sql": "{% macro default__drop_schema(relation) -%}\n {%- call statement('drop_schema') -%}\n drop schema if exists {{ relation.without_identifier() }} cascade\n {% endcall %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600952.9305768}, "macro.dbt.get_create_index_sql": {"unique_id": "macro.dbt.get_create_index_sql", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.2.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/indexes.sql", "original_file_path": "macros/adapters/indexes.sql", "name": "get_create_index_sql", "macro_sql": "{% macro get_create_index_sql(relation, index_dict) -%}\n {{ return(adapter.dispatch('get_create_index_sql', 'dbt')(relation, index_dict)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__get_create_index_sql"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600952.931057}, "macro.dbt.default__get_create_index_sql": {"unique_id": "macro.dbt.default__get_create_index_sql", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.2.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/indexes.sql", "original_file_path": "macros/adapters/indexes.sql", "name": "default__get_create_index_sql", "macro_sql": "{% macro default__get_create_index_sql(relation, index_dict) -%}\n {% do return(None) %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600952.931189}, "macro.dbt.create_indexes": {"unique_id": "macro.dbt.create_indexes", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.2.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/indexes.sql", "original_file_path": "macros/adapters/indexes.sql", "name": "create_indexes", "macro_sql": "{% macro create_indexes(relation) -%}\n {{ adapter.dispatch('create_indexes', 'dbt')(relation) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__create_indexes"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600952.9313369}, "macro.dbt.default__create_indexes": {"unique_id": "macro.dbt.default__create_indexes", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.2.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/indexes.sql", "original_file_path": "macros/adapters/indexes.sql", "name": "default__create_indexes", "macro_sql": "{% macro default__create_indexes(relation) -%}\n {%- set _indexes = config.get('indexes', default=[]) -%}\n\n {% for _index_dict in _indexes %}\n {% set create_index_sql = get_create_index_sql(relation, _index_dict) %}\n {% if create_index_sql %}\n {% do run_query(create_index_sql) %}\n {% endif %}\n {% endfor %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.get_create_index_sql", "macro.dbt.run_query"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600952.931724}, "macro.dbt.make_intermediate_relation": {"unique_id": "macro.dbt.make_intermediate_relation", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.2.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "name": "make_intermediate_relation", "macro_sql": "{% macro make_intermediate_relation(base_relation, suffix='__dbt_tmp') %}\n {{ return(adapter.dispatch('make_intermediate_relation', 'dbt')(base_relation, suffix)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__make_intermediate_relation"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600952.934675}, "macro.dbt.default__make_intermediate_relation": {"unique_id": "macro.dbt.default__make_intermediate_relation", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.2.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "name": "default__make_intermediate_relation", "macro_sql": "{% macro default__make_intermediate_relation(base_relation, suffix) %}\n {{ return(default__make_temp_relation(base_relation, suffix)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__make_temp_relation"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600952.93484}, "macro.dbt.make_temp_relation": {"unique_id": "macro.dbt.make_temp_relation", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.2.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "name": "make_temp_relation", "macro_sql": "{% macro make_temp_relation(base_relation, suffix='__dbt_tmp') %}\n {{ return(adapter.dispatch('make_temp_relation', 'dbt')(base_relation, suffix)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__make_temp_relation"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600952.935051}, "macro.dbt.default__make_temp_relation": {"unique_id": "macro.dbt.default__make_temp_relation", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.2.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "name": "default__make_temp_relation", "macro_sql": "{% macro default__make_temp_relation(base_relation, suffix) %}\n {%- set temp_identifier = base_relation.identifier ~ suffix -%}\n {%- set temp_relation = base_relation.incorporate(\n path={\"identifier\": temp_identifier}) -%}\n\n {{ return(temp_relation) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600952.935334}, "macro.dbt.make_backup_relation": {"unique_id": "macro.dbt.make_backup_relation", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.2.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "name": "make_backup_relation", "macro_sql": "{% macro make_backup_relation(base_relation, backup_relation_type, suffix='__dbt_backup') %}\n {{ return(adapter.dispatch('make_backup_relation', 'dbt')(base_relation, backup_relation_type, suffix)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__make_backup_relation"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600952.93557}, "macro.dbt.default__make_backup_relation": {"unique_id": "macro.dbt.default__make_backup_relation", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.2.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "name": "default__make_backup_relation", "macro_sql": "{% macro default__make_backup_relation(base_relation, backup_relation_type, suffix) %}\n {%- set backup_identifier = base_relation.identifier ~ suffix -%}\n {%- set backup_relation = base_relation.incorporate(\n path={\"identifier\": backup_identifier},\n type=backup_relation_type\n ) -%}\n {{ return(backup_relation) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600952.9358778}, "macro.dbt.drop_relation": {"unique_id": "macro.dbt.drop_relation", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.2.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "name": "drop_relation", "macro_sql": "{% macro drop_relation(relation) -%}\n {{ return(adapter.dispatch('drop_relation', 'dbt')(relation)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__drop_relation"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600952.936055}, "macro.dbt.default__drop_relation": {"unique_id": "macro.dbt.default__drop_relation", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.2.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "name": "default__drop_relation", "macro_sql": "{% macro default__drop_relation(relation) -%}\n {% call statement('drop_relation', auto_begin=False) -%}\n drop {{ relation.type }} if exists {{ relation }} cascade\n {%- endcall %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600952.9362571}, "macro.dbt.truncate_relation": {"unique_id": "macro.dbt.truncate_relation", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.2.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "name": "truncate_relation", "macro_sql": "{% macro truncate_relation(relation) -%}\n {{ return(adapter.dispatch('truncate_relation', 'dbt')(relation)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__truncate_relation"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600952.9364321}, "macro.dbt.default__truncate_relation": {"unique_id": "macro.dbt.default__truncate_relation", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.2.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "name": "default__truncate_relation", "macro_sql": "{% macro default__truncate_relation(relation) -%}\n {% call statement('truncate_relation') -%}\n truncate table {{ relation }}\n {%- endcall %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600952.9365819}, "macro.dbt.rename_relation": {"unique_id": "macro.dbt.rename_relation", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.2.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "name": "rename_relation", "macro_sql": "{% macro rename_relation(from_relation, to_relation) -%}\n {{ return(adapter.dispatch('rename_relation', 'dbt')(from_relation, to_relation)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__rename_relation"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600952.9367738}, "macro.dbt.default__rename_relation": {"unique_id": "macro.dbt.default__rename_relation", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.2.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "name": "default__rename_relation", "macro_sql": "{% macro default__rename_relation(from_relation, to_relation) -%}\n {% set target_name = adapter.quote_as_configured(to_relation.identifier, 'identifier') %}\n {% call statement('rename_relation') -%}\n alter table {{ from_relation }} rename to {{ target_name }}\n {%- endcall %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600952.937047}, "macro.dbt.get_or_create_relation": {"unique_id": "macro.dbt.get_or_create_relation", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.2.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "name": "get_or_create_relation", "macro_sql": "{% macro get_or_create_relation(database, schema, identifier, type) -%}\n {{ return(adapter.dispatch('get_or_create_relation', 'dbt')(database, schema, identifier, type)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__get_or_create_relation"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600952.937288}, "macro.dbt.default__get_or_create_relation": {"unique_id": "macro.dbt.default__get_or_create_relation", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.2.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "name": "default__get_or_create_relation", "macro_sql": "{% macro default__get_or_create_relation(database, schema, identifier, type) %}\n {%- set target_relation = adapter.get_relation(database=database, schema=schema, identifier=identifier) %}\n\n {% if target_relation %}\n {% do return([true, target_relation]) %}\n {% endif %}\n\n {%- set new_relation = api.Relation.create(\n database=database,\n schema=schema,\n identifier=identifier,\n type=type\n ) -%}\n {% do return([false, new_relation]) %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600952.9378822}, "macro.dbt.load_cached_relation": {"unique_id": "macro.dbt.load_cached_relation", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.2.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "name": "load_cached_relation", "macro_sql": "{% macro load_cached_relation(relation) %}\n {% do return(adapter.get_relation(\n database=relation.database,\n schema=relation.schema,\n identifier=relation.identifier\n )) -%}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600952.938106}, "macro.dbt.load_relation": {"unique_id": "macro.dbt.load_relation", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.2.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "name": "load_relation", "macro_sql": "{% macro load_relation(relation) %}\n {{ return(load_cached_relation(relation)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.load_cached_relation"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600952.9382432}, "macro.dbt.drop_relation_if_exists": {"unique_id": "macro.dbt.drop_relation_if_exists", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.2.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "name": "drop_relation_if_exists", "macro_sql": "{% macro drop_relation_if_exists(relation) %}\n {% if relation is not none %}\n {{ adapter.drop_relation(relation) }}\n {% endif %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600952.938431}, "macro.dbt.current_timestamp": {"unique_id": "macro.dbt.current_timestamp", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.2.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/freshness.sql", "original_file_path": "macros/adapters/freshness.sql", "name": "current_timestamp", "macro_sql": "{% macro current_timestamp() -%}\n {{ adapter.dispatch('current_timestamp', 'dbt')() }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.bigquery__current_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600952.938933}, "macro.dbt.default__current_timestamp": {"unique_id": "macro.dbt.default__current_timestamp", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.2.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/freshness.sql", "original_file_path": "macros/adapters/freshness.sql", "name": "default__current_timestamp", "macro_sql": "{% macro default__current_timestamp() -%}\n {{ exceptions.raise_not_implemented(\n 'current_timestamp macro not implemented for adapter '+adapter.type()) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600952.939072}, "macro.dbt.collect_freshness": {"unique_id": "macro.dbt.collect_freshness", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.2.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/freshness.sql", "original_file_path": "macros/adapters/freshness.sql", "name": "collect_freshness", "macro_sql": "{% macro collect_freshness(source, loaded_at_field, filter) %}\n {{ return(adapter.dispatch('collect_freshness', 'dbt')(source, loaded_at_field, filter))}}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.fivetran_utils.default__collect_freshness"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600952.9392939}, "macro.dbt.default__collect_freshness": {"unique_id": "macro.dbt.default__collect_freshness", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.2.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/freshness.sql", "original_file_path": "macros/adapters/freshness.sql", "name": "default__collect_freshness", "macro_sql": "{% macro default__collect_freshness(source, loaded_at_field, filter) %}\n {% call statement('collect_freshness', fetch_result=True, auto_begin=False) -%}\n select\n max({{ loaded_at_field }}) as max_loaded_at,\n {{ current_timestamp() }} as snapshotted_at\n from {{ source }}\n {% if filter %}\n where {{ filter }}\n {% endif %}\n {% endcall %}\n {{ return(load_result('collect_freshness').table) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.statement", "macro.dbt_utils.current_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600952.939702}, "macro.dbt.copy_grants": {"unique_id": "macro.dbt.copy_grants", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.2.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "name": "copy_grants", "macro_sql": "{% macro copy_grants() %}\n {{ return(adapter.dispatch('copy_grants', 'dbt')()) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__copy_grants"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600952.941288}, "macro.dbt.default__copy_grants": {"unique_id": "macro.dbt.default__copy_grants", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.2.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "name": "default__copy_grants", "macro_sql": "{% macro default__copy_grants() %}\n {{ return(True) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600952.941401}, "macro.dbt.support_multiple_grantees_per_dcl_statement": {"unique_id": "macro.dbt.support_multiple_grantees_per_dcl_statement", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.2.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "name": "support_multiple_grantees_per_dcl_statement", "macro_sql": "{% macro support_multiple_grantees_per_dcl_statement() %}\n {{ return(adapter.dispatch('support_multiple_grantees_per_dcl_statement', 'dbt')()) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__support_multiple_grantees_per_dcl_statement"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600952.941559}, "macro.dbt.default__support_multiple_grantees_per_dcl_statement": {"unique_id": "macro.dbt.default__support_multiple_grantees_per_dcl_statement", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.2.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "name": "default__support_multiple_grantees_per_dcl_statement", "macro_sql": "\n\n{%- macro default__support_multiple_grantees_per_dcl_statement() -%}\n {{ return(True) }}\n{%- endmacro -%}\n\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600952.941667}, "macro.dbt.should_revoke": {"unique_id": "macro.dbt.should_revoke", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.2.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "name": "should_revoke", "macro_sql": "{% macro should_revoke(existing_relation, full_refresh_mode=True) %}\n\n {% if not existing_relation %}\n {#-- The table doesn't already exist, so no grants to copy over --#}\n {{ return(False) }}\n {% elif full_refresh_mode %}\n {#-- The object is being REPLACED -- whether grants are copied over depends on the value of user config --#}\n {{ return(copy_grants()) }}\n {% else %}\n {#-- The table is being merged/upserted/inserted -- grants will be carried over --#}\n {{ return(True) }}\n {% endif %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.copy_grants"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600952.9419892}, "macro.dbt.get_show_grant_sql": {"unique_id": "macro.dbt.get_show_grant_sql", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.2.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "name": "get_show_grant_sql", "macro_sql": "{% macro get_show_grant_sql(relation) %}\n {{ return(adapter.dispatch(\"get_show_grant_sql\", \"dbt\")(relation)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__get_show_grant_sql"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600952.942173}, "macro.dbt.default__get_show_grant_sql": {"unique_id": "macro.dbt.default__get_show_grant_sql", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.2.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "name": "default__get_show_grant_sql", "macro_sql": "{% macro default__get_show_grant_sql(relation) %}\n show grants on {{ relation }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600952.942268}, "macro.dbt.get_grant_sql": {"unique_id": "macro.dbt.get_grant_sql", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.2.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "name": "get_grant_sql", "macro_sql": "{% macro get_grant_sql(relation, privilege, grantees) %}\n {{ return(adapter.dispatch('get_grant_sql', 'dbt')(relation, privilege, grantees)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__get_grant_sql"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600952.942484}, "macro.dbt.default__get_grant_sql": {"unique_id": "macro.dbt.default__get_grant_sql", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.2.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "name": "default__get_grant_sql", "macro_sql": "\n\n{%- macro default__get_grant_sql(relation, privilege, grantees) -%}\n grant {{ privilege }} on {{ relation }} to {{ grantees | join(', ') }}\n{%- endmacro -%}\n\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600952.942668}, "macro.dbt.get_revoke_sql": {"unique_id": "macro.dbt.get_revoke_sql", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.2.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "name": "get_revoke_sql", "macro_sql": "{% macro get_revoke_sql(relation, privilege, grantees) %}\n {{ return(adapter.dispatch('get_revoke_sql', 'dbt')(relation, privilege, grantees)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__get_revoke_sql"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600952.9428852}, "macro.dbt.default__get_revoke_sql": {"unique_id": "macro.dbt.default__get_revoke_sql", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.2.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "name": "default__get_revoke_sql", "macro_sql": "\n\n{%- macro default__get_revoke_sql(relation, privilege, grantees) -%}\n revoke {{ privilege }} on {{ relation }} from {{ grantees | join(', ') }}\n{%- endmacro -%}\n\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600952.9430678}, "macro.dbt.get_dcl_statement_list": {"unique_id": "macro.dbt.get_dcl_statement_list", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.2.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "name": "get_dcl_statement_list", "macro_sql": "{% macro get_dcl_statement_list(relation, grant_config, get_dcl_macro) %}\n {{ return(adapter.dispatch('get_dcl_statement_list', 'dbt')(relation, grant_config, get_dcl_macro)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__get_dcl_statement_list"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600952.9432871}, "macro.dbt.default__get_dcl_statement_list": {"unique_id": "macro.dbt.default__get_dcl_statement_list", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.2.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "name": "default__get_dcl_statement_list", "macro_sql": "\n\n{%- macro default__get_dcl_statement_list(relation, grant_config, get_dcl_macro) -%}\n {#\n -- Unpack grant_config into specific privileges and the set of users who need them granted/revoked.\n -- Depending on whether this database supports multiple grantees per statement, pass in the list of\n -- all grantees per privilege, or (if not) template one statement per privilege-grantee pair.\n -- `get_dcl_macro` will be either `get_grant_sql` or `get_revoke_sql`\n #}\n {%- set dcl_statements = [] -%}\n {%- for privilege, grantees in grant_config.items() %}\n {%- if support_multiple_grantees_per_dcl_statement() and grantees -%}\n {%- set dcl = get_dcl_macro(relation, privilege, grantees) -%}\n {%- do dcl_statements.append(dcl) -%}\n {%- else -%}\n {%- for grantee in grantees -%}\n {% set dcl = get_dcl_macro(relation, privilege, [grantee]) %}\n {%- do dcl_statements.append(dcl) -%}\n {% endfor -%}\n {%- endif -%}\n {%- endfor -%}\n {{ return(dcl_statements) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.support_multiple_grantees_per_dcl_statement"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600952.944005}, "macro.dbt.call_dcl_statements": {"unique_id": "macro.dbt.call_dcl_statements", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.2.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "name": "call_dcl_statements", "macro_sql": "{% macro call_dcl_statements(dcl_statement_list) %}\n {{ return(adapter.dispatch(\"call_dcl_statements\", \"dbt\")(dcl_statement_list)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__call_dcl_statements"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600952.9441888}, "macro.dbt.default__call_dcl_statements": {"unique_id": "macro.dbt.default__call_dcl_statements", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.2.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "name": "default__call_dcl_statements", "macro_sql": "{% macro default__call_dcl_statements(dcl_statement_list) %}\n {#\n -- By default, supply all grant + revoke statements in a single semicolon-separated block,\n -- so that they're all processed together.\n\n -- Some databases do not support this. Those adapters will need to override this macro\n -- to run each statement individually.\n #}\n {% call statement('grants') %}\n {% for dcl_statement in dcl_statement_list %}\n {{ dcl_statement }};\n {% endfor %}\n {% endcall %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600952.94442}, "macro.dbt.apply_grants": {"unique_id": "macro.dbt.apply_grants", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.2.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "name": "apply_grants", "macro_sql": "{% macro apply_grants(relation, grant_config, should_revoke) %}\n {{ return(adapter.dispatch(\"apply_grants\", \"dbt\")(relation, grant_config, should_revoke)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__apply_grants"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600952.9446442}, "macro.dbt.default__apply_grants": {"unique_id": "macro.dbt.default__apply_grants", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.2.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "name": "default__apply_grants", "macro_sql": "{% macro default__apply_grants(relation, grant_config, should_revoke=True) %}\n {#-- If grant_config is {} or None, this is a no-op --#}\n {% if grant_config %}\n {% if should_revoke %}\n {#-- We think previous grants may have carried over --#}\n {#-- Show current grants and calculate diffs --#}\n {% set current_grants_table = run_query(get_show_grant_sql(relation)) %}\n {% set current_grants_dict = adapter.standardize_grants_dict(current_grants_table) %}\n {% set needs_granting = diff_of_two_dicts(grant_config, current_grants_dict) %}\n {% set needs_revoking = diff_of_two_dicts(current_grants_dict, grant_config) %}\n {% if not (needs_granting or needs_revoking) %}\n {{ log('On ' ~ relation ~': All grants are in place, no revocation or granting needed.')}}\n {% endif %}\n {% else %}\n {#-- We don't think there's any chance of previous grants having carried over. --#}\n {#-- Jump straight to granting what the user has configured. --#}\n {% set needs_revoking = {} %}\n {% set needs_granting = grant_config %}\n {% endif %}\n {% if needs_granting or needs_revoking %}\n {% set revoke_statement_list = get_dcl_statement_list(relation, needs_revoking, get_revoke_sql) %}\n {% set grant_statement_list = get_dcl_statement_list(relation, needs_granting, get_grant_sql) %}\n {% set dcl_statement_list = revoke_statement_list + grant_statement_list %}\n {% if dcl_statement_list %}\n {{ call_dcl_statements(dcl_statement_list) }}\n {% endif %}\n {% endif %}\n {% endif %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.run_query", "macro.dbt.get_show_grant_sql", "macro.dbt.get_dcl_statement_list", "macro.dbt.call_dcl_statements"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600952.9457421}, "macro.dbt.alter_column_comment": {"unique_id": "macro.dbt.alter_column_comment", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.2.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/persist_docs.sql", "original_file_path": "macros/adapters/persist_docs.sql", "name": "alter_column_comment", "macro_sql": "{% macro alter_column_comment(relation, column_dict) -%}\n {{ return(adapter.dispatch('alter_column_comment', 'dbt')(relation, column_dict)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__alter_column_comment"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600952.946431}, "macro.dbt.default__alter_column_comment": {"unique_id": "macro.dbt.default__alter_column_comment", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.2.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/persist_docs.sql", "original_file_path": "macros/adapters/persist_docs.sql", "name": "default__alter_column_comment", "macro_sql": "{% macro default__alter_column_comment(relation, column_dict) -%}\n {{ exceptions.raise_not_implemented(\n 'alter_column_comment macro not implemented for adapter '+adapter.type()) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600952.946594}, "macro.dbt.alter_relation_comment": {"unique_id": "macro.dbt.alter_relation_comment", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.2.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/persist_docs.sql", "original_file_path": "macros/adapters/persist_docs.sql", "name": "alter_relation_comment", "macro_sql": "{% macro alter_relation_comment(relation, relation_comment) -%}\n {{ return(adapter.dispatch('alter_relation_comment', 'dbt')(relation, relation_comment)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__alter_relation_comment"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600952.946792}, "macro.dbt.default__alter_relation_comment": {"unique_id": "macro.dbt.default__alter_relation_comment", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.2.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/persist_docs.sql", "original_file_path": "macros/adapters/persist_docs.sql", "name": "default__alter_relation_comment", "macro_sql": "{% macro default__alter_relation_comment(relation, relation_comment) -%}\n {{ exceptions.raise_not_implemented(\n 'alter_relation_comment macro not implemented for adapter '+adapter.type()) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600952.94695}, "macro.dbt.persist_docs": {"unique_id": "macro.dbt.persist_docs", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.2.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/persist_docs.sql", "original_file_path": "macros/adapters/persist_docs.sql", "name": "persist_docs", "macro_sql": "{% macro persist_docs(relation, model, for_relation=true, for_columns=true) -%}\n {{ return(adapter.dispatch('persist_docs', 'dbt')(relation, model, for_relation, for_columns)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__persist_docs"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600952.947215}, "macro.dbt.default__persist_docs": {"unique_id": "macro.dbt.default__persist_docs", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.2.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/persist_docs.sql", "original_file_path": "macros/adapters/persist_docs.sql", "name": "default__persist_docs", "macro_sql": "{% macro default__persist_docs(relation, model, for_relation, for_columns) -%}\n {% if for_relation and config.persist_relation_docs() and model.description %}\n {% do run_query(alter_relation_comment(relation, model.description)) %}\n {% endif %}\n\n {% if for_columns and config.persist_column_docs() and model.columns %}\n {% do run_query(alter_column_comment(relation, model.columns)) %}\n {% endif %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.run_query", "macro.dbt.alter_relation_comment", "macro.dbt.alter_column_comment"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600952.947679}, "macro.dbt.get_catalog": {"unique_id": "macro.dbt.get_catalog", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.2.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "name": "get_catalog", "macro_sql": "{% macro get_catalog(information_schema, schemas) -%}\n {{ return(adapter.dispatch('get_catalog', 'dbt')(information_schema, schemas)) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__get_catalog"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600952.949057}, "macro.dbt.default__get_catalog": {"unique_id": "macro.dbt.default__get_catalog", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.2.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "name": "default__get_catalog", "macro_sql": "{% macro default__get_catalog(information_schema, schemas) -%}\n\n {% set typename = adapter.type() %}\n {% set msg -%}\n get_catalog not implemented for {{ typename }}\n {%- endset %}\n\n {{ exceptions.raise_compiler_error(msg) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600952.949307}, "macro.dbt.information_schema_name": {"unique_id": "macro.dbt.information_schema_name", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.2.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "name": "information_schema_name", "macro_sql": "{% macro information_schema_name(database) %}\n {{ return(adapter.dispatch('information_schema_name', 'dbt')(database)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__information_schema_name"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600952.9494872}, "macro.dbt.default__information_schema_name": {"unique_id": "macro.dbt.default__information_schema_name", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.2.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "name": "default__information_schema_name", "macro_sql": "{% macro default__information_schema_name(database) -%}\n {%- if database -%}\n {{ database }}.INFORMATION_SCHEMA\n {%- else -%}\n INFORMATION_SCHEMA\n {%- endif -%}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600952.949634}, "macro.dbt.list_schemas": {"unique_id": "macro.dbt.list_schemas", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.2.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "name": "list_schemas", "macro_sql": "{% macro list_schemas(database) -%}\n {{ return(adapter.dispatch('list_schemas', 'dbt')(database)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__list_schemas"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600952.9498088}, "macro.dbt.default__list_schemas": {"unique_id": "macro.dbt.default__list_schemas", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.2.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "name": "default__list_schemas", "macro_sql": "{% macro default__list_schemas(database) -%}\n {% set sql %}\n select distinct schema_name\n from {{ information_schema_name(database) }}.SCHEMATA\n where catalog_name ilike '{{ database }}'\n {% endset %}\n {{ return(run_query(sql)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.information_schema_name", "macro.dbt.run_query"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600952.950044}, "macro.dbt.check_schema_exists": {"unique_id": "macro.dbt.check_schema_exists", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.2.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "name": "check_schema_exists", "macro_sql": "{% macro check_schema_exists(information_schema, schema) -%}\n {{ return(adapter.dispatch('check_schema_exists', 'dbt')(information_schema, schema)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__check_schema_exists"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600952.950242}, "macro.dbt.default__check_schema_exists": {"unique_id": "macro.dbt.default__check_schema_exists", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.2.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "name": "default__check_schema_exists", "macro_sql": "{% macro default__check_schema_exists(information_schema, schema) -%}\n {% set sql -%}\n select count(*)\n from {{ information_schema.replace(information_schema_view='SCHEMATA') }}\n where catalog_name='{{ information_schema.database }}'\n and schema_name='{{ schema }}'\n {%- endset %}\n {{ return(run_query(sql)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.replace", "macro.dbt.run_query"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600952.95053}, "macro.dbt.list_relations_without_caching": {"unique_id": "macro.dbt.list_relations_without_caching", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.2.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "name": "list_relations_without_caching", "macro_sql": "{% macro list_relations_without_caching(schema_relation) %}\n {{ return(adapter.dispatch('list_relations_without_caching', 'dbt')(schema_relation)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__list_relations_without_caching"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600952.9507148}, "macro.dbt.default__list_relations_without_caching": {"unique_id": "macro.dbt.default__list_relations_without_caching", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.2.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "name": "default__list_relations_without_caching", "macro_sql": "{% macro default__list_relations_without_caching(schema_relation) %}\n {{ exceptions.raise_not_implemented(\n 'list_relations_without_caching macro not implemented for adapter '+adapter.type()) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600952.9508648}, "macro.dbt.get_columns_in_relation": {"unique_id": "macro.dbt.get_columns_in_relation", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.2.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/columns.sql", "original_file_path": "macros/adapters/columns.sql", "name": "get_columns_in_relation", "macro_sql": "{% macro get_columns_in_relation(relation) -%}\n {{ return(adapter.dispatch('get_columns_in_relation', 'dbt')(relation)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__get_columns_in_relation"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600952.952437}, "macro.dbt.default__get_columns_in_relation": {"unique_id": "macro.dbt.default__get_columns_in_relation", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.2.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/columns.sql", "original_file_path": "macros/adapters/columns.sql", "name": "default__get_columns_in_relation", "macro_sql": "{% macro default__get_columns_in_relation(relation) -%}\n {{ exceptions.raise_not_implemented(\n 'get_columns_in_relation macro not implemented for adapter '+adapter.type()) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600952.952652}, "macro.dbt.sql_convert_columns_in_relation": {"unique_id": "macro.dbt.sql_convert_columns_in_relation", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.2.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/columns.sql", "original_file_path": "macros/adapters/columns.sql", "name": "sql_convert_columns_in_relation", "macro_sql": "{% macro sql_convert_columns_in_relation(table) -%}\n {% set columns = [] %}\n {% for row in table %}\n {% do columns.append(api.Column(*row)) %}\n {% endfor %}\n {{ return(columns) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600952.952953}, "macro.dbt.get_columns_in_query": {"unique_id": "macro.dbt.get_columns_in_query", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.2.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/columns.sql", "original_file_path": "macros/adapters/columns.sql", "name": "get_columns_in_query", "macro_sql": "{% macro get_columns_in_query(select_sql) -%}\n {{ return(adapter.dispatch('get_columns_in_query', 'dbt')(select_sql)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__get_columns_in_query"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600952.953132}, "macro.dbt.default__get_columns_in_query": {"unique_id": "macro.dbt.default__get_columns_in_query", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.2.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/columns.sql", "original_file_path": "macros/adapters/columns.sql", "name": "default__get_columns_in_query", "macro_sql": "{% macro default__get_columns_in_query(select_sql) %}\n {% call statement('get_columns_in_query', fetch_result=True, auto_begin=False) -%}\n select * from (\n {{ select_sql }}\n ) as __dbt_sbq\n where false\n limit 0\n {% endcall %}\n\n {{ return(load_result('get_columns_in_query').table.columns | map(attribute='name') | list) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600952.953459}, "macro.dbt.alter_column_type": {"unique_id": "macro.dbt.alter_column_type", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.2.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/columns.sql", "original_file_path": "macros/adapters/columns.sql", "name": "alter_column_type", "macro_sql": "{% macro alter_column_type(relation, column_name, new_column_type) -%}\n {{ return(adapter.dispatch('alter_column_type', 'dbt')(relation, column_name, new_column_type)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__alter_column_type"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600952.953682}, "macro.dbt.default__alter_column_type": {"unique_id": "macro.dbt.default__alter_column_type", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.2.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/columns.sql", "original_file_path": "macros/adapters/columns.sql", "name": "default__alter_column_type", "macro_sql": "{% macro default__alter_column_type(relation, column_name, new_column_type) -%}\n {#\n 1. Create a new column (w/ temp name and correct type)\n 2. Copy data over to it\n 3. Drop the existing column (cascade!)\n 4. Rename the new column to existing column\n #}\n {%- set tmp_column = column_name + \"__dbt_alter\" -%}\n\n {% call statement('alter_column_type') %}\n alter table {{ relation }} add column {{ adapter.quote(tmp_column) }} {{ new_column_type }};\n update {{ relation }} set {{ adapter.quote(tmp_column) }} = {{ adapter.quote(column_name) }};\n alter table {{ relation }} drop column {{ adapter.quote(column_name) }} cascade;\n alter table {{ relation }} rename column {{ adapter.quote(tmp_column) }} to {{ adapter.quote(column_name) }}\n {% endcall %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600952.954262}, "macro.dbt.alter_relation_add_remove_columns": {"unique_id": "macro.dbt.alter_relation_add_remove_columns", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.2.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/columns.sql", "original_file_path": "macros/adapters/columns.sql", "name": "alter_relation_add_remove_columns", "macro_sql": "{% macro alter_relation_add_remove_columns(relation, add_columns = none, remove_columns = none) -%}\n {{ return(adapter.dispatch('alter_relation_add_remove_columns', 'dbt')(relation, add_columns, remove_columns)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__alter_relation_add_remove_columns"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600952.95451}, "macro.dbt.default__alter_relation_add_remove_columns": {"unique_id": "macro.dbt.default__alter_relation_add_remove_columns", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.2.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/columns.sql", "original_file_path": "macros/adapters/columns.sql", "name": "default__alter_relation_add_remove_columns", "macro_sql": "{% macro default__alter_relation_add_remove_columns(relation, add_columns, remove_columns) %}\n\n {% if add_columns is none %}\n {% set add_columns = [] %}\n {% endif %}\n {% if remove_columns is none %}\n {% set remove_columns = [] %}\n {% endif %}\n\n {% set sql -%}\n\n alter {{ relation.type }} {{ relation }}\n\n {% for column in add_columns %}\n add column {{ column.name }} {{ column.data_type }}{{ ',' if not loop.last }}\n {% endfor %}{{ ',' if add_columns and remove_columns }}\n\n {% for column in remove_columns %}\n drop column {{ column.name }}{{ ',' if not loop.last }}\n {% endfor %}\n\n {%- endset -%}\n\n {% do run_query(sql) %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.run_query"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600952.955265}, "macro.dbt.test_unique": {"unique_id": "macro.dbt.test_unique", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.2.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "tests/generic/builtin.sql", "original_file_path": "tests/generic/builtin.sql", "name": "test_unique", "macro_sql": "{% test unique(model, column_name) %}\n {% set macro = adapter.dispatch('test_unique', 'dbt') %}\n {{ macro(model, column_name) }}\n{% endtest %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__test_unique"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600952.9558148}, "macro.dbt.test_not_null": {"unique_id": "macro.dbt.test_not_null", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.2.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "tests/generic/builtin.sql", "original_file_path": "tests/generic/builtin.sql", "name": "test_not_null", "macro_sql": "{% test not_null(model, column_name) %}\n {% set macro = adapter.dispatch('test_not_null', 'dbt') %}\n {{ macro(model, column_name) }}\n{% endtest %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__test_not_null"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600952.95604}, "macro.dbt.test_accepted_values": {"unique_id": "macro.dbt.test_accepted_values", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.2.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "tests/generic/builtin.sql", "original_file_path": "tests/generic/builtin.sql", "name": "test_accepted_values", "macro_sql": "{% test accepted_values(model, column_name, values, quote=True) %}\n {% set macro = adapter.dispatch('test_accepted_values', 'dbt') %}\n {{ macro(model, column_name, values, quote) }}\n{% endtest %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__test_accepted_values"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600952.956321}, "macro.dbt.test_relationships": {"unique_id": "macro.dbt.test_relationships", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.2.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "tests/generic/builtin.sql", "original_file_path": "tests/generic/builtin.sql", "name": "test_relationships", "macro_sql": "{% test relationships(model, column_name, to, field) %}\n {% set macro = adapter.dispatch('test_relationships', 'dbt') %}\n {{ macro(model, column_name, to, field) }}\n{% endtest %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__test_relationships"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600952.956588}, "macro.dbt_utils.except": {"unique_id": "macro.dbt_utils.except", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/except.sql", "original_file_path": "macros/cross_db_utils/except.sql", "name": "except", "macro_sql": "{% macro except() %}\n {{ return(adapter.dispatch('except', 'dbt_utils')()) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.bigquery__except"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600952.956903}, "macro.dbt_utils.default__except": {"unique_id": "macro.dbt_utils.default__except", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/except.sql", "original_file_path": "macros/cross_db_utils/except.sql", "name": "default__except", "macro_sql": "{% macro default__except() %}\n\n except\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600952.956977}, "macro.dbt_utils.bigquery__except": {"unique_id": "macro.dbt_utils.bigquery__except", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/except.sql", "original_file_path": "macros/cross_db_utils/except.sql", "name": "bigquery__except", "macro_sql": "{% macro bigquery__except() %}\n\n except distinct\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600952.957046}, "macro.dbt_utils.replace": {"unique_id": "macro.dbt_utils.replace", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/replace.sql", "original_file_path": "macros/cross_db_utils/replace.sql", "name": "replace", "macro_sql": "{% macro replace(field, old_chars, new_chars) -%}\n {{ return(adapter.dispatch('replace', 'dbt_utils') (field, old_chars, new_chars)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__replace"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600952.9574242}, "macro.dbt_utils.default__replace": {"unique_id": "macro.dbt_utils.default__replace", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/replace.sql", "original_file_path": "macros/cross_db_utils/replace.sql", "name": "default__replace", "macro_sql": "{% macro default__replace(field, old_chars, new_chars) %}\n\n replace(\n {{ field }},\n {{ old_chars }},\n {{ new_chars }}\n )\n \n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600952.957581}, "macro.dbt_utils.concat": {"unique_id": "macro.dbt_utils.concat", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/concat.sql", "original_file_path": "macros/cross_db_utils/concat.sql", "name": "concat", "macro_sql": "{% macro concat(fields) -%}\n {{ return(adapter.dispatch('concat', 'dbt_utils')(fields)) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__concat"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600952.95788}, "macro.dbt_utils.default__concat": {"unique_id": "macro.dbt_utils.default__concat", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/concat.sql", "original_file_path": "macros/cross_db_utils/concat.sql", "name": "default__concat", "macro_sql": "{% macro default__concat(fields) -%}\n {{ fields|join(' || ') }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600952.9580002}, "macro.dbt_utils.type_string": {"unique_id": "macro.dbt_utils.type_string", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/datatypes.sql", "original_file_path": "macros/cross_db_utils/datatypes.sql", "name": "type_string", "macro_sql": "\n\n{%- macro type_string() -%}\n {{ return(adapter.dispatch('type_string', 'dbt_utils')()) }}\n{%- endmacro -%}\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__type_string"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600952.958688}, "macro.dbt_utils.default__type_string": {"unique_id": "macro.dbt_utils.default__type_string", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/datatypes.sql", "original_file_path": "macros/cross_db_utils/datatypes.sql", "name": "default__type_string", "macro_sql": "{% macro default__type_string() %}\n string\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600952.95876}, "macro.dbt_utils.redshift__type_string": {"unique_id": "macro.dbt_utils.redshift__type_string", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/datatypes.sql", "original_file_path": "macros/cross_db_utils/datatypes.sql", "name": "redshift__type_string", "macro_sql": "\n\n{%- macro redshift__type_string() -%}\n varchar\n{%- endmacro -%}\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600952.959006}, "macro.dbt_utils.postgres__type_string": {"unique_id": "macro.dbt_utils.postgres__type_string", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/datatypes.sql", "original_file_path": "macros/cross_db_utils/datatypes.sql", "name": "postgres__type_string", "macro_sql": "{% macro postgres__type_string() %}\n varchar\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600952.959074}, "macro.dbt_utils.snowflake__type_string": {"unique_id": "macro.dbt_utils.snowflake__type_string", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/datatypes.sql", "original_file_path": "macros/cross_db_utils/datatypes.sql", "name": "snowflake__type_string", "macro_sql": "{% macro snowflake__type_string() %}\n varchar\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600952.959142}, "macro.dbt_utils.type_timestamp": {"unique_id": "macro.dbt_utils.type_timestamp", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/datatypes.sql", "original_file_path": "macros/cross_db_utils/datatypes.sql", "name": "type_timestamp", "macro_sql": "\n\n{%- macro type_timestamp() -%}\n {{ return(adapter.dispatch('type_timestamp', 'dbt_utils')()) }}\n{%- endmacro -%}\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__type_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600952.959296}, "macro.dbt_utils.default__type_timestamp": {"unique_id": "macro.dbt_utils.default__type_timestamp", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/datatypes.sql", "original_file_path": "macros/cross_db_utils/datatypes.sql", "name": "default__type_timestamp", "macro_sql": "{% macro default__type_timestamp() %}\n timestamp\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600952.9593642}, "macro.dbt_utils.postgres__type_timestamp": {"unique_id": "macro.dbt_utils.postgres__type_timestamp", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/datatypes.sql", "original_file_path": "macros/cross_db_utils/datatypes.sql", "name": "postgres__type_timestamp", "macro_sql": "{% macro postgres__type_timestamp() %}\n timestamp without time zone\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600952.959431}, "macro.dbt_utils.snowflake__type_timestamp": {"unique_id": "macro.dbt_utils.snowflake__type_timestamp", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/datatypes.sql", "original_file_path": "macros/cross_db_utils/datatypes.sql", "name": "snowflake__type_timestamp", "macro_sql": "{% macro snowflake__type_timestamp() %}\n timestamp_ntz\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600952.9594948}, "macro.dbt_utils.type_float": {"unique_id": "macro.dbt_utils.type_float", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/datatypes.sql", "original_file_path": "macros/cross_db_utils/datatypes.sql", "name": "type_float", "macro_sql": "\n\n{%- macro type_float() -%}\n {{ return(adapter.dispatch('type_float', 'dbt_utils')()) }}\n{%- endmacro -%}\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.bigquery__type_float"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600952.959649}, "macro.dbt_utils.default__type_float": {"unique_id": "macro.dbt_utils.default__type_float", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/datatypes.sql", "original_file_path": "macros/cross_db_utils/datatypes.sql", "name": "default__type_float", "macro_sql": "{% macro default__type_float() %}\n float\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600952.959717}, "macro.dbt_utils.bigquery__type_float": {"unique_id": "macro.dbt_utils.bigquery__type_float", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/datatypes.sql", "original_file_path": "macros/cross_db_utils/datatypes.sql", "name": "bigquery__type_float", "macro_sql": "{% macro bigquery__type_float() %}\n float64\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600952.959785}, "macro.dbt_utils.type_numeric": {"unique_id": "macro.dbt_utils.type_numeric", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/datatypes.sql", "original_file_path": "macros/cross_db_utils/datatypes.sql", "name": "type_numeric", "macro_sql": "\n\n{%- macro type_numeric() -%}\n {{ return(adapter.dispatch('type_numeric', 'dbt_utils')()) }}\n{%- endmacro -%}\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.bigquery__type_numeric"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600952.959936}, "macro.dbt_utils.default__type_numeric": {"unique_id": "macro.dbt_utils.default__type_numeric", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/datatypes.sql", "original_file_path": "macros/cross_db_utils/datatypes.sql", "name": "default__type_numeric", "macro_sql": "{% macro default__type_numeric() %}\n numeric(28, 6)\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600952.960007}, "macro.dbt_utils.bigquery__type_numeric": {"unique_id": "macro.dbt_utils.bigquery__type_numeric", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/datatypes.sql", "original_file_path": "macros/cross_db_utils/datatypes.sql", "name": "bigquery__type_numeric", "macro_sql": "{% macro bigquery__type_numeric() %}\n numeric\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600952.960072}, "macro.dbt_utils.type_bigint": {"unique_id": "macro.dbt_utils.type_bigint", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/datatypes.sql", "original_file_path": "macros/cross_db_utils/datatypes.sql", "name": "type_bigint", "macro_sql": "\n\n{%- macro type_bigint() -%}\n {{ return(adapter.dispatch('type_bigint', 'dbt_utils')()) }}\n{%- endmacro -%}\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.bigquery__type_bigint"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600952.960222}, "macro.dbt_utils.default__type_bigint": {"unique_id": "macro.dbt_utils.default__type_bigint", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/datatypes.sql", "original_file_path": "macros/cross_db_utils/datatypes.sql", "name": "default__type_bigint", "macro_sql": "{% macro default__type_bigint() %}\n bigint\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600952.960292}, "macro.dbt_utils.bigquery__type_bigint": {"unique_id": "macro.dbt_utils.bigquery__type_bigint", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/datatypes.sql", "original_file_path": "macros/cross_db_utils/datatypes.sql", "name": "bigquery__type_bigint", "macro_sql": "{% macro bigquery__type_bigint() %}\n int64\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600952.960356}, "macro.dbt_utils.type_int": {"unique_id": "macro.dbt_utils.type_int", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/datatypes.sql", "original_file_path": "macros/cross_db_utils/datatypes.sql", "name": "type_int", "macro_sql": "\n\n{%- macro type_int() -%}\n {{ return(adapter.dispatch('type_int', 'dbt_utils')()) }}\n{%- endmacro -%}\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.bigquery__type_int"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600952.9605088}, "macro.dbt_utils.default__type_int": {"unique_id": "macro.dbt_utils.default__type_int", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/datatypes.sql", "original_file_path": "macros/cross_db_utils/datatypes.sql", "name": "default__type_int", "macro_sql": "{% macro default__type_int() %}\n int\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600952.960576}, "macro.dbt_utils.bigquery__type_int": {"unique_id": "macro.dbt_utils.bigquery__type_int", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/datatypes.sql", "original_file_path": "macros/cross_db_utils/datatypes.sql", "name": "bigquery__type_int", "macro_sql": "{% macro bigquery__type_int() %}\n int64\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600952.96064}, "macro.dbt_utils._is_relation": {"unique_id": "macro.dbt_utils._is_relation", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/_is_relation.sql", "original_file_path": "macros/cross_db_utils/_is_relation.sql", "name": "_is_relation", "macro_sql": "{% macro _is_relation(obj, macro) %}\n {%- if not (obj is mapping and obj.get('metadata', {}).get('type', '').endswith('Relation')) -%}\n {%- do exceptions.raise_compiler_error(\"Macro \" ~ macro ~ \" expected a Relation but received the value: \" ~ obj) -%}\n {%- endif -%}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600952.96114}, "macro.dbt_utils.cast_array_to_string": {"unique_id": "macro.dbt_utils.cast_array_to_string", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/cast_array_to_string.sql", "original_file_path": "macros/cross_db_utils/cast_array_to_string.sql", "name": "cast_array_to_string", "macro_sql": "{% macro cast_array_to_string(array) %}\n {{ adapter.dispatch('cast_array_to_string', 'dbt_utils') (array) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.bigquery__cast_array_to_string"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600952.961584}, "macro.dbt_utils.default__cast_array_to_string": {"unique_id": "macro.dbt_utils.default__cast_array_to_string", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/cast_array_to_string.sql", "original_file_path": "macros/cross_db_utils/cast_array_to_string.sql", "name": "default__cast_array_to_string", "macro_sql": "{% macro default__cast_array_to_string(array) %}\n cast({{ array }} as {{ dbt_utils.type_string() }})\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.type_string"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600952.961781}, "macro.dbt_utils.postgres__cast_array_to_string": {"unique_id": "macro.dbt_utils.postgres__cast_array_to_string", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/cast_array_to_string.sql", "original_file_path": "macros/cross_db_utils/cast_array_to_string.sql", "name": "postgres__cast_array_to_string", "macro_sql": "{% macro postgres__cast_array_to_string(array) %}\n {%- set array_as_string -%}cast({{ array }} as {{ dbt_utils.type_string() }}){%- endset -%}\n {{ dbt_utils.replace(dbt_utils.replace(array_as_string,\"'}'\",\"']'\"),\"'{'\",\"'['\") }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.type_string", "macro.dbt_utils.replace"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600952.9620779}, "macro.dbt_utils.redshift__cast_array_to_string": {"unique_id": "macro.dbt_utils.redshift__cast_array_to_string", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/cast_array_to_string.sql", "original_file_path": "macros/cross_db_utils/cast_array_to_string.sql", "name": "redshift__cast_array_to_string", "macro_sql": "{% macro redshift__cast_array_to_string(array) %}\n cast({{ array }} as {{ dbt_utils.type_string() }})\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.type_string"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600952.962213}, "macro.dbt_utils.bigquery__cast_array_to_string": {"unique_id": "macro.dbt_utils.bigquery__cast_array_to_string", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/cast_array_to_string.sql", "original_file_path": "macros/cross_db_utils/cast_array_to_string.sql", "name": "bigquery__cast_array_to_string", "macro_sql": "{% macro bigquery__cast_array_to_string(array) %}\n '['||(select string_agg(cast(element as string), ',') from unnest({{ array }}) element)||']'\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600952.962311}, "macro.dbt_utils.length": {"unique_id": "macro.dbt_utils.length", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/length.sql", "original_file_path": "macros/cross_db_utils/length.sql", "name": "length", "macro_sql": "{% macro length(expression) -%}\n {{ return(adapter.dispatch('length', 'dbt_utils') (expression)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__length"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600952.962656}, "macro.dbt_utils.default__length": {"unique_id": "macro.dbt_utils.default__length", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/length.sql", "original_file_path": "macros/cross_db_utils/length.sql", "name": "default__length", "macro_sql": "{% macro default__length(expression) %}\n \n length(\n {{ expression }}\n )\n \n{%- endmacro -%}\n\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600952.9627578}, "macro.dbt_utils.redshift__length": {"unique_id": "macro.dbt_utils.redshift__length", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/length.sql", "original_file_path": "macros/cross_db_utils/length.sql", "name": "redshift__length", "macro_sql": "{% macro redshift__length(expression) %}\n\n len(\n {{ expression }}\n )\n \n{%- endmacro -%}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600952.962854}, "macro.dbt_utils.dateadd": {"unique_id": "macro.dbt_utils.dateadd", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/dateadd.sql", "original_file_path": "macros/cross_db_utils/dateadd.sql", "name": "dateadd", "macro_sql": "{% macro dateadd(datepart, interval, from_date_or_timestamp) %}\n {{ return(adapter.dispatch('dateadd', 'dbt_utils')(datepart, interval, from_date_or_timestamp)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.bigquery__dateadd"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600952.963431}, "macro.dbt_utils.default__dateadd": {"unique_id": "macro.dbt_utils.default__dateadd", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/dateadd.sql", "original_file_path": "macros/cross_db_utils/dateadd.sql", "name": "default__dateadd", "macro_sql": "{% macro default__dateadd(datepart, interval, from_date_or_timestamp) %}\n\n dateadd(\n {{ datepart }},\n {{ interval }},\n {{ from_date_or_timestamp }}\n )\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600952.963588}, "macro.dbt_utils.bigquery__dateadd": {"unique_id": "macro.dbt_utils.bigquery__dateadd", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/dateadd.sql", "original_file_path": "macros/cross_db_utils/dateadd.sql", "name": "bigquery__dateadd", "macro_sql": "{% macro bigquery__dateadd(datepart, interval, from_date_or_timestamp) %}\n\n datetime_add(\n cast( {{ from_date_or_timestamp }} as datetime),\n interval {{ interval }} {{ datepart }}\n )\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600952.963743}, "macro.dbt_utils.postgres__dateadd": {"unique_id": "macro.dbt_utils.postgres__dateadd", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/dateadd.sql", "original_file_path": "macros/cross_db_utils/dateadd.sql", "name": "postgres__dateadd", "macro_sql": "{% macro postgres__dateadd(datepart, interval, from_date_or_timestamp) %}\n\n {{ from_date_or_timestamp }} + ((interval '1 {{ datepart }}') * ({{ interval }}))\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600952.9638982}, "macro.dbt_utils.redshift__dateadd": {"unique_id": "macro.dbt_utils.redshift__dateadd", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/dateadd.sql", "original_file_path": "macros/cross_db_utils/dateadd.sql", "name": "redshift__dateadd", "macro_sql": "{% macro redshift__dateadd(datepart, interval, from_date_or_timestamp) %}\n\n {{ return(dbt_utils.default__dateadd(datepart, interval, from_date_or_timestamp)) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__dateadd"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600952.964084}, "macro.dbt_utils.intersect": {"unique_id": "macro.dbt_utils.intersect", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/intersect.sql", "original_file_path": "macros/cross_db_utils/intersect.sql", "name": "intersect", "macro_sql": "{% macro intersect() %}\n {{ return(adapter.dispatch('intersect', 'dbt_utils')()) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.bigquery__intersect"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600952.964383}, "macro.dbt_utils.default__intersect": {"unique_id": "macro.dbt_utils.default__intersect", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/intersect.sql", "original_file_path": "macros/cross_db_utils/intersect.sql", "name": "default__intersect", "macro_sql": "{% macro default__intersect() %}\n\n intersect\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600952.964455}, "macro.dbt_utils.bigquery__intersect": {"unique_id": "macro.dbt_utils.bigquery__intersect", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/intersect.sql", "original_file_path": "macros/cross_db_utils/intersect.sql", "name": "bigquery__intersect", "macro_sql": "{% macro bigquery__intersect() %}\n\n intersect distinct\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600952.964521}, "macro.dbt_utils.escape_single_quotes": {"unique_id": "macro.dbt_utils.escape_single_quotes", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/escape_single_quotes.sql", "original_file_path": "macros/cross_db_utils/escape_single_quotes.sql", "name": "escape_single_quotes", "macro_sql": "{% macro escape_single_quotes(expression) %}\n {{ return(adapter.dispatch('escape_single_quotes', 'dbt_utils') (expression)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.bigquery__escape_single_quotes"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600952.964896}, "macro.dbt_utils.default__escape_single_quotes": {"unique_id": "macro.dbt_utils.default__escape_single_quotes", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/escape_single_quotes.sql", "original_file_path": "macros/cross_db_utils/escape_single_quotes.sql", "name": "default__escape_single_quotes", "macro_sql": "{% macro default__escape_single_quotes(expression) -%}\n{{ expression | replace(\"'\",\"''\") }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600952.9650319}, "macro.dbt_utils.snowflake__escape_single_quotes": {"unique_id": "macro.dbt_utils.snowflake__escape_single_quotes", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/escape_single_quotes.sql", "original_file_path": "macros/cross_db_utils/escape_single_quotes.sql", "name": "snowflake__escape_single_quotes", "macro_sql": "{% macro snowflake__escape_single_quotes(expression) -%}\n{{ expression | replace(\"'\", \"\\\\'\") }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600952.965167}, "macro.dbt_utils.bigquery__escape_single_quotes": {"unique_id": "macro.dbt_utils.bigquery__escape_single_quotes", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/escape_single_quotes.sql", "original_file_path": "macros/cross_db_utils/escape_single_quotes.sql", "name": "bigquery__escape_single_quotes", "macro_sql": "{% macro bigquery__escape_single_quotes(expression) -%}\n{{ expression | replace(\"'\", \"\\\\'\") }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600952.965297}, "macro.dbt_utils.right": {"unique_id": "macro.dbt_utils.right", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/right.sql", "original_file_path": "macros/cross_db_utils/right.sql", "name": "right", "macro_sql": "{% macro right(string_text, length_expression) -%}\n {{ return(adapter.dispatch('right', 'dbt_utils') (string_text, length_expression)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.bigquery__right"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600952.9658592}, "macro.dbt_utils.default__right": {"unique_id": "macro.dbt_utils.default__right", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/right.sql", "original_file_path": "macros/cross_db_utils/right.sql", "name": "default__right", "macro_sql": "{% macro default__right(string_text, length_expression) %}\n\n right(\n {{ string_text }},\n {{ length_expression }}\n )\n \n{%- endmacro -%}\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600952.965992}, "macro.dbt_utils.bigquery__right": {"unique_id": "macro.dbt_utils.bigquery__right", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/right.sql", "original_file_path": "macros/cross_db_utils/right.sql", "name": "bigquery__right", "macro_sql": "{% macro bigquery__right(string_text, length_expression) %}\n\n case when {{ length_expression }} = 0 \n then ''\n else \n substr(\n {{ string_text }},\n -1 * ({{ length_expression }})\n )\n end\n\n{%- endmacro -%}\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600952.9662058}, "macro.dbt_utils.snowflake__right": {"unique_id": "macro.dbt_utils.snowflake__right", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/right.sql", "original_file_path": "macros/cross_db_utils/right.sql", "name": "snowflake__right", "macro_sql": "{% macro snowflake__right(string_text, length_expression) %}\n\n case when {{ length_expression }} = 0 \n then ''\n else \n right(\n {{ string_text }},\n {{ length_expression }}\n )\n end\n\n{%- endmacro -%}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600952.9663548}, "macro.dbt_utils.listagg": {"unique_id": "macro.dbt_utils.listagg", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/listagg.sql", "original_file_path": "macros/cross_db_utils/listagg.sql", "name": "listagg", "macro_sql": "{% macro listagg(measure, delimiter_text=\"','\", order_by_clause=none, limit_num=none) -%}\n {{ return(adapter.dispatch('listagg', 'dbt_utils') (measure, delimiter_text, order_by_clause, limit_num)) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.bigquery__listagg"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600952.968517}, "macro.dbt_utils.default__listagg": {"unique_id": "macro.dbt_utils.default__listagg", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/listagg.sql", "original_file_path": "macros/cross_db_utils/listagg.sql", "name": "default__listagg", "macro_sql": "{% macro default__listagg(measure, delimiter_text, order_by_clause, limit_num) -%}\n\n {% if limit_num -%}\n array_to_string(\n array_slice(\n array_agg(\n {{ measure }}\n ){% if order_by_clause -%}\n within group ({{ order_by_clause }})\n {%- endif %}\n ,0\n ,{{ limit_num }}\n ),\n {{ delimiter_text }}\n )\n {%- else %}\n listagg(\n {{ measure }},\n {{ delimiter_text }}\n )\n {% if order_by_clause -%}\n within group ({{ order_by_clause }})\n {%- endif %}\n {%- endif %}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600952.96891}, "macro.dbt_utils.bigquery__listagg": {"unique_id": "macro.dbt_utils.bigquery__listagg", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/listagg.sql", "original_file_path": "macros/cross_db_utils/listagg.sql", "name": "bigquery__listagg", "macro_sql": "{% macro bigquery__listagg(measure, delimiter_text, order_by_clause, limit_num) -%}\n\n string_agg(\n {{ measure }},\n {{ delimiter_text }}\n {% if order_by_clause -%}\n {{ order_by_clause }}\n {%- endif %}\n {% if limit_num -%}\n limit {{ limit_num }}\n {%- endif %}\n )\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600952.969179}, "macro.dbt_utils.postgres__listagg": {"unique_id": "macro.dbt_utils.postgres__listagg", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/listagg.sql", "original_file_path": "macros/cross_db_utils/listagg.sql", "name": "postgres__listagg", "macro_sql": "{% macro postgres__listagg(measure, delimiter_text, order_by_clause, limit_num) -%}\n \n {% if limit_num -%}\n array_to_string(\n (array_agg(\n {{ measure }}\n {% if order_by_clause -%}\n {{ order_by_clause }}\n {%- endif %}\n ))[1:{{ limit_num }}],\n {{ delimiter_text }}\n )\n {%- else %}\n string_agg(\n {{ measure }},\n {{ delimiter_text }}\n {% if order_by_clause -%}\n {{ order_by_clause }}\n {%- endif %}\n )\n {%- endif %}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600952.969558}, "macro.dbt_utils.redshift__listagg": {"unique_id": "macro.dbt_utils.redshift__listagg", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/listagg.sql", "original_file_path": "macros/cross_db_utils/listagg.sql", "name": "redshift__listagg", "macro_sql": "{% macro redshift__listagg(measure, delimiter_text, order_by_clause, limit_num) -%}\n\n {% if limit_num -%}\n {% set ns = namespace() %}\n {% set ns.delimiter_text_regex = delimiter_text|trim(\"'\") %}\n {% set special_chars %}\\,^,$,.,|,?,*,+,(,),[,],{,}{% endset %} \n {%- for char in special_chars.split(',') -%}\n {% set escape_char %}\\\\{{ char }}{% endset %}\n {% set ns.delimiter_text_regex = ns.delimiter_text_regex|replace(char,escape_char) %}\n {%- endfor -%}\n\n {% set regex %}'([^{{ ns.delimiter_text_regex }}]+{{ ns.delimiter_text_regex }}){1,{{ limit_num - 1}}}[^{{ ns.delimiter_text_regex }}]+'{% endset %}\n regexp_substr(\n listagg(\n {{ measure }},\n {{ delimiter_text }}\n )\n {% if order_by_clause -%}\n within group ({{ order_by_clause }})\n {%- endif %}\n ,{{ regex }}\n )\n {%- else %}\n listagg(\n {{ measure }},\n {{ delimiter_text }}\n )\n {% if order_by_clause -%}\n within group ({{ order_by_clause }})\n {%- endif %}\n {%- endif %}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600952.9704719}, "macro.dbt_utils.datediff": {"unique_id": "macro.dbt_utils.datediff", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/datediff.sql", "original_file_path": "macros/cross_db_utils/datediff.sql", "name": "datediff", "macro_sql": "{% macro datediff(first_date, second_date, datepart) %}\n {{ return(adapter.dispatch('datediff', 'dbt_utils')(first_date, second_date, datepart)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.bigquery__datediff"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600952.972904}, "macro.dbt_utils.default__datediff": {"unique_id": "macro.dbt_utils.default__datediff", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/datediff.sql", "original_file_path": "macros/cross_db_utils/datediff.sql", "name": "default__datediff", "macro_sql": "{% macro default__datediff(first_date, second_date, datepart) -%}\n\n datediff(\n {{ datepart }},\n {{ first_date }},\n {{ second_date }}\n )\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600952.9730618}, "macro.dbt_utils.bigquery__datediff": {"unique_id": "macro.dbt_utils.bigquery__datediff", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/datediff.sql", "original_file_path": "macros/cross_db_utils/datediff.sql", "name": "bigquery__datediff", "macro_sql": "{% macro bigquery__datediff(first_date, second_date, datepart) -%}\n\n datetime_diff(\n cast({{second_date}} as datetime),\n cast({{first_date}} as datetime),\n {{datepart}}\n )\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600952.973217}, "macro.dbt_utils.postgres__datediff": {"unique_id": "macro.dbt_utils.postgres__datediff", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/datediff.sql", "original_file_path": "macros/cross_db_utils/datediff.sql", "name": "postgres__datediff", "macro_sql": "{% macro postgres__datediff(first_date, second_date, datepart) -%}\n\n {% if datepart == 'year' %}\n (date_part('year', ({{second_date}})::date) - date_part('year', ({{first_date}})::date))\n {% elif datepart == 'quarter' %}\n ({{ dbt_utils.datediff(first_date, second_date, 'year') }} * 4 + date_part('quarter', ({{second_date}})::date) - date_part('quarter', ({{first_date}})::date))\n {% elif datepart == 'month' %}\n ({{ dbt_utils.datediff(first_date, second_date, 'year') }} * 12 + date_part('month', ({{second_date}})::date) - date_part('month', ({{first_date}})::date))\n {% elif datepart == 'day' %}\n (({{second_date}})::date - ({{first_date}})::date)\n {% elif datepart == 'week' %}\n ({{ dbt_utils.datediff(first_date, second_date, 'day') }} / 7 + case\n when date_part('dow', ({{first_date}})::timestamp) <= date_part('dow', ({{second_date}})::timestamp) then\n case when {{first_date}} <= {{second_date}} then 0 else -1 end\n else\n case when {{first_date}} <= {{second_date}} then 1 else 0 end\n end)\n {% elif datepart == 'hour' %}\n ({{ dbt_utils.datediff(first_date, second_date, 'day') }} * 24 + date_part('hour', ({{second_date}})::timestamp) - date_part('hour', ({{first_date}})::timestamp))\n {% elif datepart == 'minute' %}\n ({{ dbt_utils.datediff(first_date, second_date, 'hour') }} * 60 + date_part('minute', ({{second_date}})::timestamp) - date_part('minute', ({{first_date}})::timestamp))\n {% elif datepart == 'second' %}\n ({{ dbt_utils.datediff(first_date, second_date, 'minute') }} * 60 + floor(date_part('second', ({{second_date}})::timestamp)) - floor(date_part('second', ({{first_date}})::timestamp)))\n {% elif datepart == 'millisecond' %}\n ({{ dbt_utils.datediff(first_date, second_date, 'minute') }} * 60000 + floor(date_part('millisecond', ({{second_date}})::timestamp)) - floor(date_part('millisecond', ({{first_date}})::timestamp)))\n {% elif datepart == 'microsecond' %}\n ({{ dbt_utils.datediff(first_date, second_date, 'minute') }} * 60000000 + floor(date_part('microsecond', ({{second_date}})::timestamp)) - floor(date_part('microsecond', ({{first_date}})::timestamp)))\n {% else %}\n {{ exceptions.raise_compiler_error(\"Unsupported datepart for macro datediff in postgres: {!r}\".format(datepart)) }}\n {% endif %}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.datediff"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600952.974916}, "macro.dbt_utils.redshift__datediff": {"unique_id": "macro.dbt_utils.redshift__datediff", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/datediff.sql", "original_file_path": "macros/cross_db_utils/datediff.sql", "name": "redshift__datediff", "macro_sql": "{% macro redshift__datediff(first_date, second_date, datepart) -%}\n\n {{ return(dbt_utils.default__datediff(first_date, second_date, datepart)) }}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__datediff"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600952.975113}, "macro.dbt_utils.safe_cast": {"unique_id": "macro.dbt_utils.safe_cast", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/safe_cast.sql", "original_file_path": "macros/cross_db_utils/safe_cast.sql", "name": "safe_cast", "macro_sql": "{% macro safe_cast(field, type) %}\n {{ return(adapter.dispatch('safe_cast', 'dbt_utils') (field, type)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.bigquery__safe_cast"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600952.975519}, "macro.dbt_utils.default__safe_cast": {"unique_id": "macro.dbt_utils.default__safe_cast", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/safe_cast.sql", "original_file_path": "macros/cross_db_utils/safe_cast.sql", "name": "default__safe_cast", "macro_sql": "{% macro default__safe_cast(field, type) %}\n {# most databases don't support this function yet\n so we just need to use cast #}\n cast({{field}} as {{type}})\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600952.9756548}, "macro.dbt_utils.snowflake__safe_cast": {"unique_id": "macro.dbt_utils.snowflake__safe_cast", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/safe_cast.sql", "original_file_path": "macros/cross_db_utils/safe_cast.sql", "name": "snowflake__safe_cast", "macro_sql": "{% macro snowflake__safe_cast(field, type) %}\n try_cast({{field}} as {{type}})\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600952.975775}, "macro.dbt_utils.bigquery__safe_cast": {"unique_id": "macro.dbt_utils.bigquery__safe_cast", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/safe_cast.sql", "original_file_path": "macros/cross_db_utils/safe_cast.sql", "name": "bigquery__safe_cast", "macro_sql": "{% macro bigquery__safe_cast(field, type) %}\n safe_cast({{field}} as {{type}})\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600952.975898}, "macro.dbt_utils.hash": {"unique_id": "macro.dbt_utils.hash", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/hash.sql", "original_file_path": "macros/cross_db_utils/hash.sql", "name": "hash", "macro_sql": "{% macro hash(field) -%}\n {{ return(adapter.dispatch('hash', 'dbt_utils') (field)) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.bigquery__hash"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600952.976235}, "macro.dbt_utils.default__hash": {"unique_id": "macro.dbt_utils.default__hash", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/hash.sql", "original_file_path": "macros/cross_db_utils/hash.sql", "name": "default__hash", "macro_sql": "{% macro default__hash(field) -%}\n md5(cast({{field}} as {{dbt_utils.type_string()}}))\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.type_string"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600952.976369}, "macro.dbt_utils.bigquery__hash": {"unique_id": "macro.dbt_utils.bigquery__hash", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/hash.sql", "original_file_path": "macros/cross_db_utils/hash.sql", "name": "bigquery__hash", "macro_sql": "{% macro bigquery__hash(field) -%}\n to_hex({{dbt_utils.default__hash(field)}})\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__hash"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600952.976492}, "macro.dbt_utils.cast_bool_to_text": {"unique_id": "macro.dbt_utils.cast_bool_to_text", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/cast_bool_to_text.sql", "original_file_path": "macros/cross_db_utils/cast_bool_to_text.sql", "name": "cast_bool_to_text", "macro_sql": "{% macro cast_bool_to_text(field) %}\n {{ adapter.dispatch('cast_bool_to_text', 'dbt_utils') (field) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__cast_bool_to_text"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600952.976846}, "macro.dbt_utils.default__cast_bool_to_text": {"unique_id": "macro.dbt_utils.default__cast_bool_to_text", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/cast_bool_to_text.sql", "original_file_path": "macros/cross_db_utils/cast_bool_to_text.sql", "name": "default__cast_bool_to_text", "macro_sql": "{% macro default__cast_bool_to_text(field) %}\n cast({{ field }} as {{ dbt_utils.type_string() }})\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.type_string"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600952.976983}, "macro.dbt_utils.redshift__cast_bool_to_text": {"unique_id": "macro.dbt_utils.redshift__cast_bool_to_text", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/cast_bool_to_text.sql", "original_file_path": "macros/cross_db_utils/cast_bool_to_text.sql", "name": "redshift__cast_bool_to_text", "macro_sql": "{% macro redshift__cast_bool_to_text(field) %}\n case\n when {{ field }} is true then 'true'\n when {{ field }} is false then 'false'\n end::text\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600952.977104}, "macro.dbt_utils.identifier": {"unique_id": "macro.dbt_utils.identifier", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/identifier.sql", "original_file_path": "macros/cross_db_utils/identifier.sql", "name": "identifier", "macro_sql": "{% macro identifier(value) %}\t\n {%- set error_message = '\n Warning: the `identifier` macro is no longer supported and will be deprecated in a future release of dbt-utils. \\\n Use `adapter.quote` instead. The {}.{} model triggered this warning. \\\n '.format(model.package_name, model.name) -%}\n {%- do exceptions.warn(error_message) -%}\n {{ return(adapter.dispatch('identifier', 'dbt_utils') (value)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.bigquery__identifier"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600952.9776058}, "macro.dbt_utils.default__identifier": {"unique_id": "macro.dbt_utils.default__identifier", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/identifier.sql", "original_file_path": "macros/cross_db_utils/identifier.sql", "name": "default__identifier", "macro_sql": "{% macro default__identifier(value) -%}\t\n \"{{ value }}\"\t\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600952.977707}, "macro.dbt_utils.bigquery__identifier": {"unique_id": "macro.dbt_utils.bigquery__identifier", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/identifier.sql", "original_file_path": "macros/cross_db_utils/identifier.sql", "name": "bigquery__identifier", "macro_sql": "{% macro bigquery__identifier(value) -%}\t\n `{{ value }}`\t\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600952.9778}, "macro.dbt_utils.any_value": {"unique_id": "macro.dbt_utils.any_value", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/any_value.sql", "original_file_path": "macros/cross_db_utils/any_value.sql", "name": "any_value", "macro_sql": "{% macro any_value(expression) -%}\n {{ return(adapter.dispatch('any_value', 'dbt_utils') (expression)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__any_value"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600952.978148}, "macro.dbt_utils.default__any_value": {"unique_id": "macro.dbt_utils.default__any_value", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/any_value.sql", "original_file_path": "macros/cross_db_utils/any_value.sql", "name": "default__any_value", "macro_sql": "{% macro default__any_value(expression) -%}\n \n any_value({{ expression }})\n \n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600952.97825}, "macro.dbt_utils.postgres__any_value": {"unique_id": "macro.dbt_utils.postgres__any_value", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/any_value.sql", "original_file_path": "macros/cross_db_utils/any_value.sql", "name": "postgres__any_value", "macro_sql": "{% macro postgres__any_value(expression) -%}\n {#- /*Postgres doesn't support any_value, so we're using min() to get the same result*/ -#}\n min({{ expression }})\n \n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600952.978349}, "macro.dbt_utils.position": {"unique_id": "macro.dbt_utils.position", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/position.sql", "original_file_path": "macros/cross_db_utils/position.sql", "name": "position", "macro_sql": "{% macro position(substring_text, string_text) -%}\n {{ return(adapter.dispatch('position', 'dbt_utils') (substring_text, string_text)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.bigquery__position"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600952.97875}, "macro.dbt_utils.default__position": {"unique_id": "macro.dbt_utils.default__position", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/position.sql", "original_file_path": "macros/cross_db_utils/position.sql", "name": "default__position", "macro_sql": "{% macro default__position(substring_text, string_text) %}\n\n position(\n {{ substring_text }} in {{ string_text }}\n )\n \n{%- endmacro -%}\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600952.9788811}, "macro.dbt_utils.bigquery__position": {"unique_id": "macro.dbt_utils.bigquery__position", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/position.sql", "original_file_path": "macros/cross_db_utils/position.sql", "name": "bigquery__position", "macro_sql": "{% macro bigquery__position(substring_text, string_text) %}\n\n strpos(\n {{ string_text }},\n {{ substring_text }}\n \n )\n \n{%- endmacro -%}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600952.97901}, "macro.dbt_utils.string_literal": {"unique_id": "macro.dbt_utils.string_literal", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/literal.sql", "original_file_path": "macros/cross_db_utils/literal.sql", "name": "string_literal", "macro_sql": "{%- macro string_literal(value) -%}\n {{ return(adapter.dispatch('string_literal', 'dbt_utils') (value)) }}\n{%- endmacro -%}\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__string_literal"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600952.979365}, "macro.dbt_utils.default__string_literal": {"unique_id": "macro.dbt_utils.default__string_literal", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/literal.sql", "original_file_path": "macros/cross_db_utils/literal.sql", "name": "default__string_literal", "macro_sql": "{% macro default__string_literal(value) -%}\n '{{ value }}'\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600952.979465}, "macro.dbt_utils.current_timestamp": {"unique_id": "macro.dbt_utils.current_timestamp", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/current_timestamp.sql", "original_file_path": "macros/cross_db_utils/current_timestamp.sql", "name": "current_timestamp", "macro_sql": "{% macro current_timestamp() -%}\n {{ return(adapter.dispatch('current_timestamp', 'dbt_utils')()) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.bigquery__current_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600952.980034}, "macro.dbt_utils.default__current_timestamp": {"unique_id": "macro.dbt_utils.default__current_timestamp", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/current_timestamp.sql", "original_file_path": "macros/cross_db_utils/current_timestamp.sql", "name": "default__current_timestamp", "macro_sql": "{% macro default__current_timestamp() %}\n current_timestamp::{{dbt_utils.type_timestamp()}}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.type_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600952.980142}, "macro.dbt_utils.redshift__current_timestamp": {"unique_id": "macro.dbt_utils.redshift__current_timestamp", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/current_timestamp.sql", "original_file_path": "macros/cross_db_utils/current_timestamp.sql", "name": "redshift__current_timestamp", "macro_sql": "{% macro redshift__current_timestamp() %}\n getdate()\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600952.9802082}, "macro.dbt_utils.bigquery__current_timestamp": {"unique_id": "macro.dbt_utils.bigquery__current_timestamp", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/current_timestamp.sql", "original_file_path": "macros/cross_db_utils/current_timestamp.sql", "name": "bigquery__current_timestamp", "macro_sql": "{% macro bigquery__current_timestamp() %}\n current_timestamp\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600952.980278}, "macro.dbt_utils.current_timestamp_in_utc": {"unique_id": "macro.dbt_utils.current_timestamp_in_utc", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/current_timestamp.sql", "original_file_path": "macros/cross_db_utils/current_timestamp.sql", "name": "current_timestamp_in_utc", "macro_sql": "{% macro current_timestamp_in_utc() -%}\n {{ return(adapter.dispatch('current_timestamp_in_utc', 'dbt_utils')()) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__current_timestamp_in_utc"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600952.9804301}, "macro.dbt_utils.default__current_timestamp_in_utc": {"unique_id": "macro.dbt_utils.default__current_timestamp_in_utc", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/current_timestamp.sql", "original_file_path": "macros/cross_db_utils/current_timestamp.sql", "name": "default__current_timestamp_in_utc", "macro_sql": "{% macro default__current_timestamp_in_utc() %}\n {{dbt_utils.current_timestamp()}}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.current_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600952.9805388}, "macro.dbt_utils.snowflake__current_timestamp_in_utc": {"unique_id": "macro.dbt_utils.snowflake__current_timestamp_in_utc", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/current_timestamp.sql", "original_file_path": "macros/cross_db_utils/current_timestamp.sql", "name": "snowflake__current_timestamp_in_utc", "macro_sql": "{% macro snowflake__current_timestamp_in_utc() %}\n convert_timezone('UTC', {{dbt_utils.current_timestamp()}})::{{dbt_utils.type_timestamp()}}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.current_timestamp", "macro.dbt_utils.type_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600952.9806771}, "macro.dbt_utils.postgres__current_timestamp_in_utc": {"unique_id": "macro.dbt_utils.postgres__current_timestamp_in_utc", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/current_timestamp.sql", "original_file_path": "macros/cross_db_utils/current_timestamp.sql", "name": "postgres__current_timestamp_in_utc", "macro_sql": "{% macro postgres__current_timestamp_in_utc() %}\n (current_timestamp at time zone 'utc')::{{dbt_utils.type_timestamp()}}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.type_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600952.9807858}, "macro.dbt_utils.redshift__current_timestamp_in_utc": {"unique_id": "macro.dbt_utils.redshift__current_timestamp_in_utc", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/current_timestamp.sql", "original_file_path": "macros/cross_db_utils/current_timestamp.sql", "name": "redshift__current_timestamp_in_utc", "macro_sql": "{% macro redshift__current_timestamp_in_utc() %}\n {{ return(dbt_utils.default__current_timestamp_in_utc()) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__current_timestamp_in_utc"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600952.98091}, "macro.dbt_utils.width_bucket": {"unique_id": "macro.dbt_utils.width_bucket", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/width_bucket.sql", "original_file_path": "macros/cross_db_utils/width_bucket.sql", "name": "width_bucket", "macro_sql": "{% macro width_bucket(expr, min_value, max_value, num_buckets) %}\n {{ return(adapter.dispatch('width_bucket', 'dbt_utils') (expr, min_value, max_value, num_buckets)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__width_bucket"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600952.982284}, "macro.dbt_utils.default__width_bucket": {"unique_id": "macro.dbt_utils.default__width_bucket", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/width_bucket.sql", "original_file_path": "macros/cross_db_utils/width_bucket.sql", "name": "default__width_bucket", "macro_sql": "{% macro default__width_bucket(expr, min_value, max_value, num_buckets) -%}\n\n {% set bin_size -%}\n (( {{ max_value }} - {{ min_value }} ) / {{ num_buckets }} )\n {%- endset %}\n (\n -- to break ties when the amount is eaxtly at the bucket egde\n case\n when\n mod(\n {{ dbt_utils.safe_cast(expr, dbt_utils.type_numeric() ) }},\n {{ dbt_utils.safe_cast(bin_size, dbt_utils.type_numeric() ) }}\n ) = 0\n then 1\n else 0\n end\n ) +\n -- Anything over max_value goes the N+1 bucket\n least(\n ceil(\n ({{ expr }} - {{ min_value }})/{{ bin_size }}\n ),\n {{ num_buckets }} + 1\n )\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.safe_cast", "macro.dbt_utils.type_numeric"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600952.9827359}, "macro.dbt_utils.redshift__width_bucket": {"unique_id": "macro.dbt_utils.redshift__width_bucket", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/width_bucket.sql", "original_file_path": "macros/cross_db_utils/width_bucket.sql", "name": "redshift__width_bucket", "macro_sql": "{% macro redshift__width_bucket(expr, min_value, max_value, num_buckets) -%}\n\n {% set bin_size -%}\n (( {{ max_value }} - {{ min_value }} ) / {{ num_buckets }} )\n {%- endset %}\n (\n -- to break ties when the amount is exactly at the bucket edge\n case\n when\n {{ dbt_utils.safe_cast(expr, dbt_utils.type_numeric() ) }} %\n {{ dbt_utils.safe_cast(bin_size, dbt_utils.type_numeric() ) }}\n = 0\n then 1\n else 0\n end\n ) +\n -- Anything over max_value goes the N+1 bucket\n least(\n ceil(\n ({{ expr }} - {{ min_value }})/{{ bin_size }}\n ),\n {{ num_buckets }} + 1\n )\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.safe_cast", "macro.dbt_utils.type_numeric"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600952.983186}, "macro.dbt_utils.snowflake__width_bucket": {"unique_id": "macro.dbt_utils.snowflake__width_bucket", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/width_bucket.sql", "original_file_path": "macros/cross_db_utils/width_bucket.sql", "name": "snowflake__width_bucket", "macro_sql": "{% macro snowflake__width_bucket(expr, min_value, max_value, num_buckets) %}\n width_bucket({{ expr }}, {{ min_value }}, {{ max_value }}, {{ num_buckets }} )\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600952.98337}, "macro.dbt_utils.array_concat": {"unique_id": "macro.dbt_utils.array_concat", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/array_concat.sql", "original_file_path": "macros/cross_db_utils/array_concat.sql", "name": "array_concat", "macro_sql": "{% macro array_concat(array_1, array_2) -%}\n {{ return(adapter.dispatch('array_concat', 'dbt_utils')(array_1, array_2)) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.bigquery__array_concat"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600952.9837818}, "macro.dbt_utils.default__array_concat": {"unique_id": "macro.dbt_utils.default__array_concat", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/array_concat.sql", "original_file_path": "macros/cross_db_utils/array_concat.sql", "name": "default__array_concat", "macro_sql": "{% macro default__array_concat(array_1, array_2) -%}\n array_cat({{ array_1 }}, {{ array_2 }})\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600952.9839098}, "macro.dbt_utils.bigquery__array_concat": {"unique_id": "macro.dbt_utils.bigquery__array_concat", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/array_concat.sql", "original_file_path": "macros/cross_db_utils/array_concat.sql", "name": "bigquery__array_concat", "macro_sql": "{% macro bigquery__array_concat(array_1, array_2) -%}\n array_concat({{ array_1 }}, {{ array_2 }})\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600952.9840372}, "macro.dbt_utils.redshift__array_concat": {"unique_id": "macro.dbt_utils.redshift__array_concat", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/array_concat.sql", "original_file_path": "macros/cross_db_utils/array_concat.sql", "name": "redshift__array_concat", "macro_sql": "{% macro redshift__array_concat(array_1, array_2) -%}\n array_concat({{ array_1 }}, {{ array_2 }})\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600952.984159}, "macro.dbt_utils.bool_or": {"unique_id": "macro.dbt_utils.bool_or", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/bool_or.sql", "original_file_path": "macros/cross_db_utils/bool_or.sql", "name": "bool_or", "macro_sql": "{% macro bool_or(expression) -%}\n {{ return(adapter.dispatch('bool_or', 'dbt_utils') (expression)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.bigquery__bool_or"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600952.9845319}, "macro.dbt_utils.default__bool_or": {"unique_id": "macro.dbt_utils.default__bool_or", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/bool_or.sql", "original_file_path": "macros/cross_db_utils/bool_or.sql", "name": "default__bool_or", "macro_sql": "{% macro default__bool_or(expression) -%}\n \n bool_or({{ expression }})\n \n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600952.984632}, "macro.dbt_utils.snowflake__bool_or": {"unique_id": "macro.dbt_utils.snowflake__bool_or", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/bool_or.sql", "original_file_path": "macros/cross_db_utils/bool_or.sql", "name": "snowflake__bool_or", "macro_sql": "{% macro snowflake__bool_or(expression) -%}\n \n boolor_agg({{ expression }})\n \n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600952.984788}, "macro.dbt_utils.bigquery__bool_or": {"unique_id": "macro.dbt_utils.bigquery__bool_or", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/bool_or.sql", "original_file_path": "macros/cross_db_utils/bool_or.sql", "name": "bigquery__bool_or", "macro_sql": "{% macro bigquery__bool_or(expression) -%}\n \n logical_or({{ expression }})\n \n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600952.984885}, "macro.dbt_utils.last_day": {"unique_id": "macro.dbt_utils.last_day", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/last_day.sql", "original_file_path": "macros/cross_db_utils/last_day.sql", "name": "last_day", "macro_sql": "{% macro last_day(date, datepart) %}\n {{ return(adapter.dispatch('last_day', 'dbt_utils') (date, datepart)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__last_day"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600952.98546}, "macro.dbt_utils.default_last_day": {"unique_id": "macro.dbt_utils.default_last_day", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/last_day.sql", "original_file_path": "macros/cross_db_utils/last_day.sql", "name": "default_last_day", "macro_sql": "\n\n\n{%- macro default_last_day(date, datepart) -%}\n cast(\n {{dbt_utils.dateadd('day', '-1',\n dbt_utils.dateadd(datepart, '1', dbt_utils.date_trunc(datepart, date))\n )}}\n as date)\n{%- endmacro -%}\n\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.dateadd", "macro.dbt_utils.date_trunc"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600952.985721}, "macro.dbt_utils.default__last_day": {"unique_id": "macro.dbt_utils.default__last_day", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/last_day.sql", "original_file_path": "macros/cross_db_utils/last_day.sql", "name": "default__last_day", "macro_sql": "{% macro default__last_day(date, datepart) -%}\n {{dbt_utils.default_last_day(date, datepart)}}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default_last_day"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600952.9858649}, "macro.dbt_utils.postgres__last_day": {"unique_id": "macro.dbt_utils.postgres__last_day", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/last_day.sql", "original_file_path": "macros/cross_db_utils/last_day.sql", "name": "postgres__last_day", "macro_sql": "{% macro postgres__last_day(date, datepart) -%}\n\n {%- if datepart == 'quarter' -%}\n -- postgres dateadd does not support quarter interval.\n cast(\n {{dbt_utils.dateadd('day', '-1',\n dbt_utils.dateadd('month', '3', dbt_utils.date_trunc(datepart, date))\n )}}\n as date)\n {%- else -%}\n {{dbt_utils.default_last_day(date, datepart)}}\n {%- endif -%}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.dateadd", "macro.dbt_utils.date_trunc", "macro.dbt_utils.default_last_day"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600952.986249}, "macro.dbt_utils.redshift__last_day": {"unique_id": "macro.dbt_utils.redshift__last_day", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/last_day.sql", "original_file_path": "macros/cross_db_utils/last_day.sql", "name": "redshift__last_day", "macro_sql": "{% macro redshift__last_day(date, datepart) %}\n\n {{ return(dbt_utils.default__last_day(date, datepart)) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__last_day"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600952.9864168}, "macro.dbt_utils.split_part": {"unique_id": "macro.dbt_utils.split_part", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/split_part.sql", "original_file_path": "macros/cross_db_utils/split_part.sql", "name": "split_part", "macro_sql": "{% macro split_part(string_text, delimiter_text, part_number) %}\n {{ return(adapter.dispatch('split_part', 'dbt_utils') (string_text, delimiter_text, part_number)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.bigquery__split_part"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600952.987822}, "macro.dbt_utils.default__split_part": {"unique_id": "macro.dbt_utils.default__split_part", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/split_part.sql", "original_file_path": "macros/cross_db_utils/split_part.sql", "name": "default__split_part", "macro_sql": "{% macro default__split_part(string_text, delimiter_text, part_number) %}\n\n split_part(\n {{ string_text }},\n {{ delimiter_text }},\n {{ part_number }}\n )\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600952.987979}, "macro.dbt_utils._split_part_negative": {"unique_id": "macro.dbt_utils._split_part_negative", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/split_part.sql", "original_file_path": "macros/cross_db_utils/split_part.sql", "name": "_split_part_negative", "macro_sql": "{% macro _split_part_negative(string_text, delimiter_text, part_number) %}\n\n split_part(\n {{ string_text }},\n {{ delimiter_text }},\n length({{ string_text }}) \n - length(\n replace({{ string_text }}, {{ delimiter_text }}, '')\n ) + 2 {{ part_number }}\n )\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600952.988191}, "macro.dbt_utils.postgres__split_part": {"unique_id": "macro.dbt_utils.postgres__split_part", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/split_part.sql", "original_file_path": "macros/cross_db_utils/split_part.sql", "name": "postgres__split_part", "macro_sql": "{% macro postgres__split_part(string_text, delimiter_text, part_number) %}\n\n {% if part_number >= 0 %}\n {{ dbt_utils.default__split_part(string_text, delimiter_text, part_number) }}\n {% else %}\n {{ dbt_utils._split_part_negative(string_text, delimiter_text, part_number) }}\n {% endif %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__split_part", "macro.dbt_utils._split_part_negative"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600952.9885151}, "macro.dbt_utils.redshift__split_part": {"unique_id": "macro.dbt_utils.redshift__split_part", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/split_part.sql", "original_file_path": "macros/cross_db_utils/split_part.sql", "name": "redshift__split_part", "macro_sql": "{% macro redshift__split_part(string_text, delimiter_text, part_number) %}\n\n {% if part_number >= 0 %}\n {{ dbt_utils.default__split_part(string_text, delimiter_text, part_number) }}\n {% else %}\n {{ dbt_utils._split_part_negative(string_text, delimiter_text, part_number) }}\n {% endif %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__split_part", "macro.dbt_utils._split_part_negative"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600952.988835}, "macro.dbt_utils.bigquery__split_part": {"unique_id": "macro.dbt_utils.bigquery__split_part", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/split_part.sql", "original_file_path": "macros/cross_db_utils/split_part.sql", "name": "bigquery__split_part", "macro_sql": "{% macro bigquery__split_part(string_text, delimiter_text, part_number) %}\n\n {% if part_number >= 0 %}\n split(\n {{ string_text }},\n {{ delimiter_text }}\n )[safe_offset({{ part_number - 1 }})]\n {% else %}\n split(\n {{ string_text }},\n {{ delimiter_text }}\n )[safe_offset(\n length({{ string_text }}) \n - length(\n replace({{ string_text }}, {{ delimiter_text }}, '')\n ) + 1\n )]\n {% endif %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600952.989176}, "macro.dbt_utils.date_trunc": {"unique_id": "macro.dbt_utils.date_trunc", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/date_trunc.sql", "original_file_path": "macros/cross_db_utils/date_trunc.sql", "name": "date_trunc", "macro_sql": "{% macro date_trunc(datepart, date) -%}\n {{ return(adapter.dispatch('date_trunc', 'dbt_utils') (datepart, date)) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.bigquery__date_trunc"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600952.9895701}, "macro.dbt_utils.default__date_trunc": {"unique_id": "macro.dbt_utils.default__date_trunc", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/date_trunc.sql", "original_file_path": "macros/cross_db_utils/date_trunc.sql", "name": "default__date_trunc", "macro_sql": "{% macro default__date_trunc(datepart, date) -%}\n date_trunc('{{datepart}}', {{date}})\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600952.989697}, "macro.dbt_utils.bigquery__date_trunc": {"unique_id": "macro.dbt_utils.bigquery__date_trunc", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/date_trunc.sql", "original_file_path": "macros/cross_db_utils/date_trunc.sql", "name": "bigquery__date_trunc", "macro_sql": "{% macro bigquery__date_trunc(datepart, date) -%}\n timestamp_trunc(\n cast({{date}} as timestamp),\n {{datepart}}\n )\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600952.989824}, "macro.dbt_utils.array_construct": {"unique_id": "macro.dbt_utils.array_construct", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/array_construct.sql", "original_file_path": "macros/cross_db_utils/array_construct.sql", "name": "array_construct", "macro_sql": "{% macro array_construct(inputs = [], data_type = api.Column.translate_type('integer')) -%}\n {{ return(adapter.dispatch('array_construct', 'dbt_utils')(inputs, data_type)) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.bigquery__array_construct"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600952.990361}, "macro.dbt_utils.default__array_construct": {"unique_id": "macro.dbt_utils.default__array_construct", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/array_construct.sql", "original_file_path": "macros/cross_db_utils/array_construct.sql", "name": "default__array_construct", "macro_sql": "{% macro default__array_construct(inputs, data_type) -%}\n {% if inputs|length > 0 %}\n array[ {{ inputs|join(' , ') }} ]\n {% else %}\n array[]::{{data_type}}[]\n {% endif %}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600952.990592}, "macro.dbt_utils.snowflake__array_construct": {"unique_id": "macro.dbt_utils.snowflake__array_construct", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/array_construct.sql", "original_file_path": "macros/cross_db_utils/array_construct.sql", "name": "snowflake__array_construct", "macro_sql": "{% macro snowflake__array_construct(inputs, data_type) -%}\n array_construct( {{ inputs|join(' , ') }} )\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600952.990728}, "macro.dbt_utils.redshift__array_construct": {"unique_id": "macro.dbt_utils.redshift__array_construct", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/array_construct.sql", "original_file_path": "macros/cross_db_utils/array_construct.sql", "name": "redshift__array_construct", "macro_sql": "{% macro redshift__array_construct(inputs, data_type) -%}\n array( {{ inputs|join(' , ') }} )\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600952.9908621}, "macro.dbt_utils.bigquery__array_construct": {"unique_id": "macro.dbt_utils.bigquery__array_construct", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/array_construct.sql", "original_file_path": "macros/cross_db_utils/array_construct.sql", "name": "bigquery__array_construct", "macro_sql": "{% macro bigquery__array_construct(inputs, data_type) -%}\n [ {{ inputs|join(' , ') }} ]\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600952.990995}, "macro.dbt_utils._is_ephemeral": {"unique_id": "macro.dbt_utils._is_ephemeral", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/_is_ephemeral.sql", "original_file_path": "macros/cross_db_utils/_is_ephemeral.sql", "name": "_is_ephemeral", "macro_sql": "{% macro _is_ephemeral(obj, macro) %}\n {%- if obj.is_cte -%}\n {% set ephemeral_prefix = api.Relation.add_ephemeral_prefix('') %}\n {% if obj.name.startswith(ephemeral_prefix) %}\n {% set model_name = obj.name[(ephemeral_prefix|length):] %}\n {% else %}\n {% set model_name = obj.name %}\n {%- endif -%}\n {% set error_message %}\nThe `{{ macro }}` macro cannot be used with ephemeral models, as it relies on the information schema.\n\n`{{ model_name }}` is an ephemeral model. Consider making it a view or table instead.\n {% endset %}\n {%- do exceptions.raise_compiler_error(error_message) -%}\n {%- endif -%}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600952.991897}, "macro.dbt_utils.array_append": {"unique_id": "macro.dbt_utils.array_append", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/array_append.sql", "original_file_path": "macros/cross_db_utils/array_append.sql", "name": "array_append", "macro_sql": "{% macro array_append(array, new_element) -%}\n {{ return(adapter.dispatch('array_append', 'dbt_utils')(array, new_element)) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.bigquery__array_append"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600952.992318}, "macro.dbt_utils.default__array_append": {"unique_id": "macro.dbt_utils.default__array_append", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/array_append.sql", "original_file_path": "macros/cross_db_utils/array_append.sql", "name": "default__array_append", "macro_sql": "{% macro default__array_append(array, new_element) -%}\n array_append({{ array }}, {{ new_element }})\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600952.992445}, "macro.dbt_utils.bigquery__array_append": {"unique_id": "macro.dbt_utils.bigquery__array_append", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/array_append.sql", "original_file_path": "macros/cross_db_utils/array_append.sql", "name": "bigquery__array_append", "macro_sql": "{% macro bigquery__array_append(array, new_element) -%}\n {{ dbt_utils.array_concat(array, dbt_utils.array_construct([new_element])) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.array_concat", "macro.dbt_utils.array_construct"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600952.992627}, "macro.dbt_utils.redshift__array_append": {"unique_id": "macro.dbt_utils.redshift__array_append", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/array_append.sql", "original_file_path": "macros/cross_db_utils/array_append.sql", "name": "redshift__array_append", "macro_sql": "{% macro redshift__array_append(array, new_element) -%}\n {{ dbt_utils.array_concat(array, dbt_utils.array_construct([new_element])) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.array_concat", "macro.dbt_utils.array_construct"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600952.992806}, "macro.dbt_utils.get_period_boundaries": {"unique_id": "macro.dbt_utils.get_period_boundaries", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/dbt_utils", "path": "macros/materializations/insert_by_period_materialization.sql", "original_file_path": "macros/materializations/insert_by_period_materialization.sql", "name": "get_period_boundaries", "macro_sql": "{% macro get_period_boundaries(target_schema, target_table, timestamp_field, start_date, stop_date, period) -%}\n {{ return(adapter.dispatch('get_period_boundaries', 'dbt_utils')(target_schema, target_table, timestamp_field, start_date, stop_date, period)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__get_period_boundaries"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600952.998243}, "macro.dbt_utils.default__get_period_boundaries": {"unique_id": "macro.dbt_utils.default__get_period_boundaries", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/dbt_utils", "path": "macros/materializations/insert_by_period_materialization.sql", "original_file_path": "macros/materializations/insert_by_period_materialization.sql", "name": "default__get_period_boundaries", "macro_sql": "{% macro default__get_period_boundaries(target_schema, target_table, timestamp_field, start_date, stop_date, period) -%}\n\n {% call statement('period_boundaries', fetch_result=True) -%}\n with data as (\n select\n coalesce(max(\"{{timestamp_field}}\"), '{{start_date}}')::timestamp as start_timestamp,\n coalesce(\n {{dbt_utils.dateadd('millisecond',\n -1,\n \"nullif('\" ~ stop_date ~ \"','')::timestamp\")}},\n {{dbt_utils.current_timestamp()}}\n ) as stop_timestamp\n from \"{{target_schema}}\".\"{{target_table}}\"\n )\n\n select\n start_timestamp,\n stop_timestamp,\n {{dbt_utils.datediff('start_timestamp',\n 'stop_timestamp',\n period)}} + 1 as num_periods\n from data\n {%- endcall %}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.statement", "macro.dbt_utils.dateadd", "macro.dbt_utils.current_timestamp", "macro.dbt_utils.datediff"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600952.9987369}, "macro.dbt_utils.get_period_sql": {"unique_id": "macro.dbt_utils.get_period_sql", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/dbt_utils", "path": "macros/materializations/insert_by_period_materialization.sql", "original_file_path": "macros/materializations/insert_by_period_materialization.sql", "name": "get_period_sql", "macro_sql": "{% macro get_period_sql(target_cols_csv, sql, timestamp_field, period, start_timestamp, stop_timestamp, offset) -%}\n {{ return(adapter.dispatch('get_period_sql', 'dbt_utils')(target_cols_csv, sql, timestamp_field, period, start_timestamp, stop_timestamp, offset)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__get_period_sql"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600952.9990442}, "macro.dbt_utils.default__get_period_sql": {"unique_id": "macro.dbt_utils.default__get_period_sql", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/dbt_utils", "path": "macros/materializations/insert_by_period_materialization.sql", "original_file_path": "macros/materializations/insert_by_period_materialization.sql", "name": "default__get_period_sql", "macro_sql": "{% macro default__get_period_sql(target_cols_csv, sql, timestamp_field, period, start_timestamp, stop_timestamp, offset) -%}\n\n {%- set period_filter -%}\n (\"{{timestamp_field}}\" > '{{start_timestamp}}'::timestamp + interval '{{offset}} {{period}}' and\n \"{{timestamp_field}}\" <= '{{start_timestamp}}'::timestamp + interval '{{offset}} {{period}}' + interval '1 {{period}}' and\n \"{{timestamp_field}}\" < '{{stop_timestamp}}'::timestamp)\n {%- endset -%}\n\n {%- set filtered_sql = sql | replace(\"__PERIOD_FILTER__\", period_filter) -%}\n\n select\n {{target_cols_csv}}\n from (\n {{filtered_sql}}\n )\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600952.999521}, "macro.dbt_utils.materialization_insert_by_period_default": {"unique_id": "macro.dbt_utils.materialization_insert_by_period_default", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/dbt_utils", "path": "macros/materializations/insert_by_period_materialization.sql", "original_file_path": "macros/materializations/insert_by_period_materialization.sql", "name": "materialization_insert_by_period_default", "macro_sql": "{% materialization insert_by_period, default -%}\n {%- set timestamp_field = config.require('timestamp_field') -%}\n {%- set start_date = config.require('start_date') -%}\n {%- set stop_date = config.get('stop_date') or '' -%}\n {%- set period = config.get('period') or 'week' -%}\n\n {%- if sql.find('__PERIOD_FILTER__') == -1 -%}\n {%- set error_message -%}\n Model '{{ model.unique_id }}' does not include the required string '__PERIOD_FILTER__' in its sql\n {%- endset -%}\n {{ exceptions.raise_compiler_error(error_message) }}\n {%- endif -%}\n\n {%- set identifier = model['name'] -%}\n\n {%- set old_relation = adapter.get_relation(database=database, schema=schema, identifier=identifier) -%}\n {%- set target_relation = api.Relation.create(identifier=identifier, schema=schema, type='table') -%}\n\n {%- set non_destructive_mode = (flags.NON_DESTRUCTIVE == True) -%}\n {%- set full_refresh_mode = (flags.FULL_REFRESH == True) -%}\n\n {%- set exists_as_table = (old_relation is not none and old_relation.is_table) -%}\n {%- set exists_not_as_table = (old_relation is not none and not old_relation.is_table) -%}\n\n {%- set should_truncate = (non_destructive_mode and full_refresh_mode and exists_as_table) -%}\n {%- set should_drop = (not should_truncate and (full_refresh_mode or exists_not_as_table)) -%}\n {%- set force_create = (flags.FULL_REFRESH and not flags.NON_DESTRUCTIVE) -%}\n\n -- setup\n {% if old_relation is none -%}\n -- noop\n {%- elif should_truncate -%}\n {{adapter.truncate_relation(old_relation)}}\n {%- elif should_drop -%}\n {{adapter.drop_relation(old_relation)}}\n {%- set old_relation = none -%}\n {%- endif %}\n\n {{run_hooks(pre_hooks, inside_transaction=False)}}\n\n -- `begin` happens here, so `commit` after it to finish the transaction\n {{run_hooks(pre_hooks, inside_transaction=True)}}\n {% call statement() -%}\n begin; -- make extra sure we've closed out the transaction\n commit;\n {%- endcall %}\n\n -- build model\n {% if force_create or old_relation is none -%}\n {# Create an empty target table -#}\n {% call statement('main') -%}\n {%- set empty_sql = sql | replace(\"__PERIOD_FILTER__\", 'false') -%}\n {{create_table_as(False, target_relation, empty_sql)}}\n {%- endcall %}\n {%- endif %}\n\n {% set _ = dbt_utils.get_period_boundaries(schema,\n identifier,\n timestamp_field,\n start_date,\n stop_date,\n period) %}\n {%- set start_timestamp = load_result('period_boundaries')['data'][0][0] | string -%}\n {%- set stop_timestamp = load_result('period_boundaries')['data'][0][1] | string -%}\n {%- set num_periods = load_result('period_boundaries')['data'][0][2] | int -%}\n\n {% set target_columns = adapter.get_columns_in_relation(target_relation) %}\n {%- set target_cols_csv = target_columns | map(attribute='quoted') | join(', ') -%}\n {%- set loop_vars = {'sum_rows_inserted': 0} -%}\n\n -- commit each period as a separate transaction\n {% for i in range(num_periods) -%}\n {%- set msg = \"Running for \" ~ period ~ \" \" ~ (i + 1) ~ \" of \" ~ (num_periods) -%}\n {{ dbt_utils.log_info(msg) }}\n\n {%- set tmp_identifier = model['name'] ~ '__dbt_incremental_period' ~ i ~ '_tmp' -%}\n {%- set tmp_relation = api.Relation.create(identifier=tmp_identifier,\n schema=schema, type='table') -%}\n {% call statement() -%}\n {% set tmp_table_sql = dbt_utils.get_period_sql(target_cols_csv,\n sql,\n timestamp_field,\n period,\n start_timestamp,\n stop_timestamp,\n i) %}\n {{dbt.create_table_as(True, tmp_relation, tmp_table_sql)}}\n {%- endcall %}\n\n {{adapter.expand_target_column_types(from_relation=tmp_relation,\n to_relation=target_relation)}}\n {%- set name = 'main-' ~ i -%}\n {% call statement(name, fetch_result=True) -%}\n insert into {{target_relation}} ({{target_cols_csv}})\n (\n select\n {{target_cols_csv}}\n from {{tmp_relation.include(schema=False)}}\n );\n {%- endcall %}\n {% set result = load_result('main-' ~ i) %}\n {% if 'response' in result.keys() %} {# added in v0.19.0 #}\n {% set rows_inserted = result['response']['rows_affected'] %}\n {% else %} {# older versions #}\n {% set rows_inserted = result['status'].split(\" \")[2] | int %}\n {% endif %}\n \n {%- set sum_rows_inserted = loop_vars['sum_rows_inserted'] + rows_inserted -%}\n {%- if loop_vars.update({'sum_rows_inserted': sum_rows_inserted}) %} {% endif -%}\n\n {%- set msg = \"Ran for \" ~ period ~ \" \" ~ (i + 1) ~ \" of \" ~ (num_periods) ~ \"; \" ~ rows_inserted ~ \" records inserted\" -%}\n {{ dbt_utils.log_info(msg) }}\n\n {%- endfor %}\n\n {% call statement() -%}\n begin;\n {%- endcall %}\n\n {{run_hooks(post_hooks, inside_transaction=True)}}\n\n {% call statement() -%}\n commit;\n {%- endcall %}\n\n {{run_hooks(post_hooks, inside_transaction=False)}}\n\n {%- set status_string = \"INSERT \" ~ loop_vars['sum_rows_inserted'] -%}\n\n {% call noop_statement('main', status_string) -%}\n -- no-op\n {%- endcall %}\n\n -- Return the relations created in this materialization\n {{ return({'relations': [target_relation]}) }} \n\n{%- endmaterialization %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.run_hooks", "macro.dbt.statement", "macro.dbt.create_table_as", "macro.dbt_utils.get_period_boundaries", "macro.dbt_utils.log_info", "macro.dbt_utils.get_period_sql", "macro.dbt.noop_statement"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600953.004443}, "macro.dbt_utils.get_url_host": {"unique_id": "macro.dbt_utils.get_url_host", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/dbt_utils", "path": "macros/web/get_url_host.sql", "original_file_path": "macros/web/get_url_host.sql", "name": "get_url_host", "macro_sql": "{% macro get_url_host(field) -%}\n {{ return(adapter.dispatch('get_url_host', 'dbt_utils')(field)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__get_url_host"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600953.004871}, "macro.dbt_utils.default__get_url_host": {"unique_id": "macro.dbt_utils.default__get_url_host", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/dbt_utils", "path": "macros/web/get_url_host.sql", "original_file_path": "macros/web/get_url_host.sql", "name": "default__get_url_host", "macro_sql": "{% macro default__get_url_host(field) -%}\n\n{%- set parsed =\n dbt_utils.split_part(\n dbt_utils.split_part(\n dbt_utils.replace(\n dbt_utils.replace(\n dbt_utils.replace(field, \"'android-app://'\", \"''\"\n ), \"'http://'\", \"''\"\n ), \"'https://'\", \"''\"\n ), \"'/'\", 1\n ), \"'?'\", 1\n )\n\n-%}\n\n\n {{ dbt_utils.safe_cast(\n parsed,\n dbt_utils.type_string()\n )}}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.split_part", "macro.dbt_utils.replace", "macro.dbt_utils.safe_cast", "macro.dbt_utils.type_string"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600953.005336}, "macro.dbt_utils.get_url_path": {"unique_id": "macro.dbt_utils.get_url_path", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/dbt_utils", "path": "macros/web/get_url_path.sql", "original_file_path": "macros/web/get_url_path.sql", "name": "get_url_path", "macro_sql": "{% macro get_url_path(field) -%}\n {{ return(adapter.dispatch('get_url_path', 'dbt_utils')(field)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__get_url_path"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600953.0058482}, "macro.dbt_utils.default__get_url_path": {"unique_id": "macro.dbt_utils.default__get_url_path", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/dbt_utils", "path": "macros/web/get_url_path.sql", "original_file_path": "macros/web/get_url_path.sql", "name": "default__get_url_path", "macro_sql": "{% macro default__get_url_path(field) -%}\n\n {%- set stripped_url = \n dbt_utils.replace(\n dbt_utils.replace(field, \"'http://'\", \"''\"), \"'https://'\", \"''\")\n -%}\n\n {%- set first_slash_pos -%}\n coalesce(\n nullif({{dbt_utils.position(\"'/'\", stripped_url)}}, 0),\n {{dbt_utils.position(\"'?'\", stripped_url)}} - 1\n )\n {%- endset -%}\n\n {%- set parsed_path =\n dbt_utils.split_part(\n dbt_utils.right(\n stripped_url, \n dbt_utils.length(stripped_url) ~ \"-\" ~ first_slash_pos\n ), \n \"'?'\", 1\n )\n -%}\n\n {{ dbt_utils.safe_cast(\n parsed_path,\n dbt_utils.type_string()\n )}}\n \n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.replace", "macro.dbt_utils.position", "macro.dbt_utils.split_part", "macro.dbt_utils.right", "macro.dbt_utils.length", "macro.dbt_utils.safe_cast", "macro.dbt_utils.type_string"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600953.006484}, "macro.dbt_utils.get_url_parameter": {"unique_id": "macro.dbt_utils.get_url_parameter", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/dbt_utils", "path": "macros/web/get_url_parameter.sql", "original_file_path": "macros/web/get_url_parameter.sql", "name": "get_url_parameter", "macro_sql": "{% macro get_url_parameter(field, url_parameter) -%}\n {{ return(adapter.dispatch('get_url_parameter', 'dbt_utils')(field, url_parameter)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__get_url_parameter"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600953.006846}, "macro.dbt_utils.default__get_url_parameter": {"unique_id": "macro.dbt_utils.default__get_url_parameter", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/dbt_utils", "path": "macros/web/get_url_parameter.sql", "original_file_path": "macros/web/get_url_parameter.sql", "name": "default__get_url_parameter", "macro_sql": "{% macro default__get_url_parameter(field, url_parameter) -%}\n\n{%- set formatted_url_parameter = \"'\" + url_parameter + \"='\" -%}\n\n{%- set split = dbt_utils.split_part(dbt_utils.split_part(field, formatted_url_parameter, 2), \"'&'\", 1) -%}\n\nnullif({{ split }},'')\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.split_part"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600953.007155}, "macro.dbt_utils.test_fewer_rows_than": {"unique_id": "macro.dbt_utils.test_fewer_rows_than", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/dbt_utils", "path": "macros/generic_tests/fewer_rows_than.sql", "original_file_path": "macros/generic_tests/fewer_rows_than.sql", "name": "test_fewer_rows_than", "macro_sql": "{% test fewer_rows_than(model, compare_model) %}\n {{ return(adapter.dispatch('test_fewer_rows_than', 'dbt_utils')(model, compare_model)) }}\n{% endtest %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__test_fewer_rows_than"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600953.00772}, "macro.dbt_utils.default__test_fewer_rows_than": {"unique_id": "macro.dbt_utils.default__test_fewer_rows_than", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/dbt_utils", "path": "macros/generic_tests/fewer_rows_than.sql", "original_file_path": "macros/generic_tests/fewer_rows_than.sql", "name": "default__test_fewer_rows_than", "macro_sql": "{% macro default__test_fewer_rows_than(model, compare_model) %}\n\n{{ config(fail_calc = 'coalesce(row_count_delta, 0)') }}\n\nwith a as (\n\n select count(*) as count_our_model from {{ model }}\n\n),\nb as (\n\n select count(*) as count_comparison_model from {{ compare_model }}\n\n),\ncounts as (\n\n select\n count_our_model,\n count_comparison_model\n from a\n cross join b\n\n),\nfinal as (\n\n select *,\n case\n -- fail the test if we have more rows than the reference model and return the row count delta\n when count_our_model > count_comparison_model then (count_our_model - count_comparison_model)\n -- fail the test if they are the same number\n when count_our_model = count_comparison_model then 1\n -- pass the test if the delta is positive (i.e. return the number 0)\n else 0\n end as row_count_delta\n from counts\n\n)\n\nselect * from final\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600953.007948}, "macro.dbt_utils.test_equal_rowcount": {"unique_id": "macro.dbt_utils.test_equal_rowcount", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/dbt_utils", "path": "macros/generic_tests/equal_rowcount.sql", "original_file_path": "macros/generic_tests/equal_rowcount.sql", "name": "test_equal_rowcount", "macro_sql": "{% test equal_rowcount(model, compare_model) %}\n {{ return(adapter.dispatch('test_equal_rowcount', 'dbt_utils')(model, compare_model)) }}\n{% endtest %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__test_equal_rowcount"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600953.008378}, "macro.dbt_utils.default__test_equal_rowcount": {"unique_id": "macro.dbt_utils.default__test_equal_rowcount", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/dbt_utils", "path": "macros/generic_tests/equal_rowcount.sql", "original_file_path": "macros/generic_tests/equal_rowcount.sql", "name": "default__test_equal_rowcount", "macro_sql": "{% macro default__test_equal_rowcount(model, compare_model) %}\n\n{#-- Needs to be set at parse time, before we return '' below --#}\n{{ config(fail_calc = 'coalesce(diff_count, 0)') }}\n\n{#-- Prevent querying of db in parsing mode. This works because this macro does not create any new refs. #}\n{%- if not execute -%}\n {{ return('') }}\n{% endif %}\n\nwith a as (\n\n select count(*) as count_a from {{ model }}\n\n),\nb as (\n\n select count(*) as count_b from {{ compare_model }}\n\n),\nfinal as (\n\n select\n count_a,\n count_b,\n abs(count_a - count_b) as diff_count\n from a\n cross join b\n\n)\n\nselect * from final\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600953.0086641}, "macro.dbt_utils.test_relationships_where": {"unique_id": "macro.dbt_utils.test_relationships_where", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/dbt_utils", "path": "macros/generic_tests/relationships_where.sql", "original_file_path": "macros/generic_tests/relationships_where.sql", "name": "test_relationships_where", "macro_sql": "{% test relationships_where(model, column_name, to, field, from_condition=\"1=1\", to_condition=\"1=1\") %}\n {{ return(adapter.dispatch('test_relationships_where', 'dbt_utils')(model, column_name, to, field, from_condition, to_condition)) }}\n{% endtest %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__test_relationships_where"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600953.0093498}, "macro.dbt_utils.default__test_relationships_where": {"unique_id": "macro.dbt_utils.default__test_relationships_where", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/dbt_utils", "path": "macros/generic_tests/relationships_where.sql", "original_file_path": "macros/generic_tests/relationships_where.sql", "name": "default__test_relationships_where", "macro_sql": "{% macro default__test_relationships_where(model, column_name, to, field, from_condition=\"1=1\", to_condition=\"1=1\") %}\n\n{# T-SQL has no boolean data type so we use 1=1 which returns TRUE #}\n{# ref https://stackoverflow.com/a/7170753/3842610 #}\n\nwith left_table as (\n\n select\n {{column_name}} as id\n\n from {{model}}\n\n where {{column_name}} is not null\n and {{from_condition}}\n\n),\n\nright_table as (\n\n select\n {{field}} as id\n\n from {{to}}\n\n where {{field}} is not null\n and {{to_condition}}\n\n),\n\nexceptions as (\n\n select\n left_table.id,\n right_table.id as right_id\n\n from left_table\n\n left join right_table\n on left_table.id = right_table.id\n\n where right_table.id is null\n\n)\n\nselect * from exceptions\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600953.009675}, "macro.dbt_utils.test_recency": {"unique_id": "macro.dbt_utils.test_recency", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/dbt_utils", "path": "macros/generic_tests/recency.sql", "original_file_path": "macros/generic_tests/recency.sql", "name": "test_recency", "macro_sql": "{% test recency(model, field, datepart, interval) %}\n {{ return(adapter.dispatch('test_recency', 'dbt_utils')(model, field, datepart, interval)) }}\n{% endtest %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__test_recency"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600953.0101178}, "macro.dbt_utils.default__test_recency": {"unique_id": "macro.dbt_utils.default__test_recency", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/dbt_utils", "path": "macros/generic_tests/recency.sql", "original_file_path": "macros/generic_tests/recency.sql", "name": "default__test_recency", "macro_sql": "{% macro default__test_recency(model, field, datepart, interval) %}\n\n{% set threshold = dbt_utils.dateadd(datepart, interval * -1, dbt_utils.current_timestamp()) %}\n\nwith recency as (\n\n select max({{field}}) as most_recent\n from {{ model }}\n\n)\n\nselect\n\n most_recent,\n {{ threshold }} as threshold\n\nfrom recency\nwhere most_recent < {{ threshold }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.dateadd", "macro.dbt_utils.current_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600953.010443}, "macro.dbt_utils.test_not_constant": {"unique_id": "macro.dbt_utils.test_not_constant", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/dbt_utils", "path": "macros/generic_tests/not_constant.sql", "original_file_path": "macros/generic_tests/not_constant.sql", "name": "test_not_constant", "macro_sql": "{% test not_constant(model, column_name) %}\n {{ return(adapter.dispatch('test_not_constant', 'dbt_utils')(model, column_name)) }}\n{% endtest %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__test_not_constant"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600953.010808}, "macro.dbt_utils.default__test_not_constant": {"unique_id": "macro.dbt_utils.default__test_not_constant", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/dbt_utils", "path": "macros/generic_tests/not_constant.sql", "original_file_path": "macros/generic_tests/not_constant.sql", "name": "default__test_not_constant", "macro_sql": "{% macro default__test_not_constant(model, column_name) %}\n\n\nselect\n {# In TSQL, subquery aggregate columns need aliases #}\n {# thus: a filler col name, 'filler_column' #}\n count(distinct {{ column_name }}) as filler_column\n\nfrom {{ model }}\n\nhaving count(distinct {{ column_name }}) = 1\n\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600953.010975}, "macro.dbt_utils.test_accepted_range": {"unique_id": "macro.dbt_utils.test_accepted_range", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/dbt_utils", "path": "macros/generic_tests/accepted_range.sql", "original_file_path": "macros/generic_tests/accepted_range.sql", "name": "test_accepted_range", "macro_sql": "{% test accepted_range(model, column_name, min_value=none, max_value=none, inclusive=true) %}\n {{ return(adapter.dispatch('test_accepted_range', 'dbt_utils')(model, column_name, min_value, max_value, inclusive)) }}\n{% endtest %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__test_accepted_range"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600953.011599}, "macro.dbt_utils.default__test_accepted_range": {"unique_id": "macro.dbt_utils.default__test_accepted_range", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/dbt_utils", "path": "macros/generic_tests/accepted_range.sql", "original_file_path": "macros/generic_tests/accepted_range.sql", "name": "default__test_accepted_range", "macro_sql": "{% macro default__test_accepted_range(model, column_name, min_value=none, max_value=none, inclusive=true) %}\n\nwith meet_condition as(\n select *\n from {{ model }}\n),\n\nvalidation_errors as (\n select *\n from meet_condition\n where\n -- never true, defaults to an empty result set. Exists to ensure any combo of the `or` clauses below succeeds\n 1 = 2\n\n {%- if min_value is not none %}\n -- records with a value >= min_value are permitted. The `not` flips this to find records that don't meet the rule.\n or not {{ column_name }} > {{- \"=\" if inclusive }} {{ min_value }}\n {%- endif %}\n\n {%- if max_value is not none %}\n -- records with a value <= max_value are permitted. The `not` flips this to find records that don't meet the rule.\n or not {{ column_name }} < {{- \"=\" if inclusive }} {{ max_value }}\n {%- endif %}\n)\n\nselect *\nfrom validation_errors\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600953.012118}, "macro.dbt_utils.test_not_accepted_values": {"unique_id": "macro.dbt_utils.test_not_accepted_values", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/dbt_utils", "path": "macros/generic_tests/not_accepted_values.sql", "original_file_path": "macros/generic_tests/not_accepted_values.sql", "name": "test_not_accepted_values", "macro_sql": "{% test not_accepted_values(model, column_name, values, quote=True) %}\n {{ return(adapter.dispatch('test_not_accepted_values', 'dbt_utils')(model, column_name, values, quote)) }}\n{% endtest %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__test_not_accepted_values"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600953.012686}, "macro.dbt_utils.default__test_not_accepted_values": {"unique_id": "macro.dbt_utils.default__test_not_accepted_values", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/dbt_utils", "path": "macros/generic_tests/not_accepted_values.sql", "original_file_path": "macros/generic_tests/not_accepted_values.sql", "name": "default__test_not_accepted_values", "macro_sql": "{% macro default__test_not_accepted_values(model, column_name, values, quote=True) %}\nwith all_values as (\n\n select distinct\n {{ column_name }} as value_field\n\n from {{ model }}\n\n),\n\nvalidation_errors as (\n\n select\n value_field\n\n from all_values\n where value_field in (\n {% for value in values -%}\n {% if quote -%}\n '{{ value }}'\n {%- else -%}\n {{ value }}\n {%- endif -%}\n {%- if not loop.last -%},{%- endif %}\n {%- endfor %}\n )\n\n)\n\nselect *\nfrom validation_errors\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600953.0130591}, "macro.dbt_utils.test_unique_where": {"unique_id": "macro.dbt_utils.test_unique_where", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/dbt_utils", "path": "macros/generic_tests/test_unique_where.sql", "original_file_path": "macros/generic_tests/test_unique_where.sql", "name": "test_unique_where", "macro_sql": "{% test unique_where(model, column_name) %}\r\n {%- set deprecation_warning = '\r\n Warning: `dbt_utils.unique_where` is no longer supported.\r\n Starting in dbt v0.20.0, the built-in `unique` test supports a `where` config.\r\n ' -%}\r\n {%- do exceptions.warn(deprecation_warning) -%}\r\n {{ return(adapter.dispatch('test_unique_where', 'dbt_utils')(model, column_name)) }}\r\n{% endtest %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__test_unique_where"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600953.013509}, "macro.dbt_utils.default__test_unique_where": {"unique_id": "macro.dbt_utils.default__test_unique_where", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/dbt_utils", "path": "macros/generic_tests/test_unique_where.sql", "original_file_path": "macros/generic_tests/test_unique_where.sql", "name": "default__test_unique_where", "macro_sql": "{% macro default__test_unique_where(model, column_name) %}\r\n {{ return(test_unique(model, column_name)) }}\r\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.test_unique"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600953.013673}, "macro.dbt_utils.test_at_least_one": {"unique_id": "macro.dbt_utils.test_at_least_one", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/dbt_utils", "path": "macros/generic_tests/at_least_one.sql", "original_file_path": "macros/generic_tests/at_least_one.sql", "name": "test_at_least_one", "macro_sql": "{% test at_least_one(model, column_name) %}\n {{ return(adapter.dispatch('test_at_least_one', 'dbt_utils')(model, column_name)) }}\n{% endtest %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__test_at_least_one"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600953.014045}, "macro.dbt_utils.default__test_at_least_one": {"unique_id": "macro.dbt_utils.default__test_at_least_one", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/dbt_utils", "path": "macros/generic_tests/at_least_one.sql", "original_file_path": "macros/generic_tests/at_least_one.sql", "name": "default__test_at_least_one", "macro_sql": "{% macro default__test_at_least_one(model, column_name) %}\n\nselect *\nfrom (\n select\n {# In TSQL, subquery aggregate columns need aliases #}\n {# thus: a filler col name, 'filler_column' #}\n count({{ column_name }}) as filler_column\n\n from {{ model }}\n\n having count({{ column_name }}) = 0\n\n) validation_errors\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600953.014218}, "macro.dbt_utils.test_unique_combination_of_columns": {"unique_id": "macro.dbt_utils.test_unique_combination_of_columns", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/dbt_utils", "path": "macros/generic_tests/unique_combination_of_columns.sql", "original_file_path": "macros/generic_tests/unique_combination_of_columns.sql", "name": "test_unique_combination_of_columns", "macro_sql": "{% test unique_combination_of_columns(model, combination_of_columns, quote_columns=false) %}\n {{ return(adapter.dispatch('test_unique_combination_of_columns', 'dbt_utils')(model, combination_of_columns, quote_columns)) }}\n{% endtest %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__test_unique_combination_of_columns"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600953.014847}, "macro.dbt_utils.default__test_unique_combination_of_columns": {"unique_id": "macro.dbt_utils.default__test_unique_combination_of_columns", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/dbt_utils", "path": "macros/generic_tests/unique_combination_of_columns.sql", "original_file_path": "macros/generic_tests/unique_combination_of_columns.sql", "name": "default__test_unique_combination_of_columns", "macro_sql": "{% macro default__test_unique_combination_of_columns(model, combination_of_columns, quote_columns=false) %}\n\n{% if not quote_columns %}\n {%- set column_list=combination_of_columns %}\n{% elif quote_columns %}\n {%- set column_list=[] %}\n {% for column in combination_of_columns -%}\n {% set column_list = column_list.append( adapter.quote(column) ) %}\n {%- endfor %}\n{% else %}\n {{ exceptions.raise_compiler_error(\n \"`quote_columns` argument for unique_combination_of_columns test must be one of [True, False] Got: '\" ~ quote ~\"'.'\"\n ) }}\n{% endif %}\n\n{%- set columns_csv=column_list | join(', ') %}\n\n\nwith validation_errors as (\n\n select\n {{ columns_csv }}\n from {{ model }}\n group by {{ columns_csv }}\n having count(*) > 1\n\n)\n\nselect *\nfrom validation_errors\n\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600953.0154629}, "macro.dbt_utils.test_cardinality_equality": {"unique_id": "macro.dbt_utils.test_cardinality_equality", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/dbt_utils", "path": "macros/generic_tests/cardinality_equality.sql", "original_file_path": "macros/generic_tests/cardinality_equality.sql", "name": "test_cardinality_equality", "macro_sql": "{% test cardinality_equality(model, column_name, to, field) %}\n {{ return(adapter.dispatch('test_cardinality_equality', 'dbt_utils')(model, column_name, to, field)) }}\n{% endtest %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__test_cardinality_equality"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600953.0160582}, "macro.dbt_utils.default__test_cardinality_equality": {"unique_id": "macro.dbt_utils.default__test_cardinality_equality", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/dbt_utils", "path": "macros/generic_tests/cardinality_equality.sql", "original_file_path": "macros/generic_tests/cardinality_equality.sql", "name": "default__test_cardinality_equality", "macro_sql": "{% macro default__test_cardinality_equality(model, column_name, to, field) %}\n\n{# T-SQL does not let you use numbers as aliases for columns #}\n{# Thus, no \"GROUP BY 1\" #}\n\nwith table_a as (\nselect\n {{ column_name }},\n count(*) as num_rows\nfrom {{ model }}\ngroup by {{ column_name }}\n),\n\ntable_b as (\nselect\n {{ field }},\n count(*) as num_rows\nfrom {{ to }}\ngroup by {{ field }}\n),\n\nexcept_a as (\n select *\n from table_a\n {{ dbt_utils.except() }}\n select *\n from table_b\n),\n\nexcept_b as (\n select *\n from table_b\n {{ dbt_utils.except() }}\n select *\n from table_a\n),\n\nunioned as (\n select *\n from except_a\n union all\n select *\n from except_b\n)\n\nselect *\nfrom unioned\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.except"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600953.016386}, "macro.dbt_utils.test_expression_is_true": {"unique_id": "macro.dbt_utils.test_expression_is_true", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/dbt_utils", "path": "macros/generic_tests/expression_is_true.sql", "original_file_path": "macros/generic_tests/expression_is_true.sql", "name": "test_expression_is_true", "macro_sql": "{% test expression_is_true(model, expression, column_name=None, condition='1=1') %}\n{# T-SQL has no boolean data type so we use 1=1 which returns TRUE #}\n{# ref https://stackoverflow.com/a/7170753/3842610 #}\n {{ return(adapter.dispatch('test_expression_is_true', 'dbt_utils')(model, expression, column_name, condition)) }}\n{% endtest %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__test_expression_is_true"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600953.0168839}, "macro.dbt_utils.default__test_expression_is_true": {"unique_id": "macro.dbt_utils.default__test_expression_is_true", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/dbt_utils", "path": "macros/generic_tests/expression_is_true.sql", "original_file_path": "macros/generic_tests/expression_is_true.sql", "name": "default__test_expression_is_true", "macro_sql": "{% macro default__test_expression_is_true(model, expression, column_name, condition) %}\n\nwith meet_condition as (\n select * from {{ model }} where {{ condition }}\n)\n\nselect\n *\nfrom meet_condition\n{% if column_name is none %}\nwhere not({{ expression }})\n{%- else %}\nwhere not({{ column_name }} {{ expression }})\n{%- endif %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600953.017169}, "macro.dbt_utils.test_not_null_proportion": {"unique_id": "macro.dbt_utils.test_not_null_proportion", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/dbt_utils", "path": "macros/generic_tests/not_null_proportion.sql", "original_file_path": "macros/generic_tests/not_null_proportion.sql", "name": "test_not_null_proportion", "macro_sql": "{% macro test_not_null_proportion(model) %}\n {{ return(adapter.dispatch('test_not_null_proportion', 'dbt_utils')(model, **kwargs)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__test_not_null_proportion"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600953.0176399}, "macro.dbt_utils.default__test_not_null_proportion": {"unique_id": "macro.dbt_utils.default__test_not_null_proportion", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/dbt_utils", "path": "macros/generic_tests/not_null_proportion.sql", "original_file_path": "macros/generic_tests/not_null_proportion.sql", "name": "default__test_not_null_proportion", "macro_sql": "{% macro default__test_not_null_proportion(model) %}\n\n{% set column_name = kwargs.get('column_name', kwargs.get('arg')) %}\n{% set at_least = kwargs.get('at_least', kwargs.get('arg')) %}\n{% set at_most = kwargs.get('at_most', kwargs.get('arg', 1)) %}\n\nwith validation as (\n select\n sum(case when {{ column_name }} is null then 0 else 1 end) / cast(count(*) as numeric) as not_null_proportion\n from {{ model }}\n),\nvalidation_errors as (\n select\n not_null_proportion\n from validation\n where not_null_proportion < {{ at_least }} or not_null_proportion > {{ at_most }}\n)\nselect\n *\nfrom validation_errors\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600953.018136}, "macro.dbt_utils.test_sequential_values": {"unique_id": "macro.dbt_utils.test_sequential_values", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/dbt_utils", "path": "macros/generic_tests/sequential_values.sql", "original_file_path": "macros/generic_tests/sequential_values.sql", "name": "test_sequential_values", "macro_sql": "{% test sequential_values(model, column_name, interval=1, datepart=None) %}\n\n {{ return(adapter.dispatch('test_sequential_values', 'dbt_utils')(model, column_name, interval, datepart)) }}\n\n{% endtest %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__test_sequential_values"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600953.018806}, "macro.dbt_utils.default__test_sequential_values": {"unique_id": "macro.dbt_utils.default__test_sequential_values", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/dbt_utils", "path": "macros/generic_tests/sequential_values.sql", "original_file_path": "macros/generic_tests/sequential_values.sql", "name": "default__test_sequential_values", "macro_sql": "{% macro default__test_sequential_values(model, column_name, interval=1, datepart=None) %}\n\n{% set previous_column_name = \"previous_\" ~ dbt_utils.slugify(column_name) %}\n\nwith windowed as (\n\n select\n {{ column_name }},\n lag({{ column_name }}) over (\n order by {{ column_name }}\n ) as {{ previous_column_name }}\n from {{ model }}\n),\n\nvalidation_errors as (\n select\n *\n from windowed\n {% if datepart %}\n where not(cast({{ column_name }} as {{ dbt_utils.type_timestamp() }})= cast({{ dbt_utils.dateadd(datepart, interval, previous_column_name) }} as {{ dbt_utils.type_timestamp() }}))\n {% else %}\n where not({{ column_name }} = {{ previous_column_name }} + {{ interval }})\n {% endif %}\n)\n\nselect *\nfrom validation_errors\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.slugify", "macro.dbt_utils.type_timestamp", "macro.dbt_utils.dateadd"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600953.0194628}, "macro.dbt_utils.test_not_null_where": {"unique_id": "macro.dbt_utils.test_not_null_where", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/dbt_utils", "path": "macros/generic_tests/test_not_null_where.sql", "original_file_path": "macros/generic_tests/test_not_null_where.sql", "name": "test_not_null_where", "macro_sql": "{% test not_null_where(model, column_name) %}\r\n {%- set deprecation_warning = '\r\n Warning: `dbt_utils.not_null_where` is no longer supported.\r\n Starting in dbt v0.20.0, the built-in `not_null` test supports a `where` config.\r\n ' -%}\r\n {%- do exceptions.warn(deprecation_warning) -%}\r\n {{ return(adapter.dispatch('test_not_null_where', 'dbt_utils')(model, column_name)) }}\r\n{% endtest %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__test_not_null_where"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600953.0199199}, "macro.dbt_utils.default__test_not_null_where": {"unique_id": "macro.dbt_utils.default__test_not_null_where", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/dbt_utils", "path": "macros/generic_tests/test_not_null_where.sql", "original_file_path": "macros/generic_tests/test_not_null_where.sql", "name": "default__test_not_null_where", "macro_sql": "{% macro default__test_not_null_where(model, column_name) %}\r\n {{ return(test_not_null(model, column_name)) }}\r\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.test_not_null"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600953.020082}, "macro.dbt_utils.test_equality": {"unique_id": "macro.dbt_utils.test_equality", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/dbt_utils", "path": "macros/generic_tests/equality.sql", "original_file_path": "macros/generic_tests/equality.sql", "name": "test_equality", "macro_sql": "{% test equality(model, compare_model, compare_columns=None) %}\n {{ return(adapter.dispatch('test_equality', 'dbt_utils')(model, compare_model, compare_columns)) }}\n{% endtest %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__test_equality"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600953.0208309}, "macro.dbt_utils.default__test_equality": {"unique_id": "macro.dbt_utils.default__test_equality", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/dbt_utils", "path": "macros/generic_tests/equality.sql", "original_file_path": "macros/generic_tests/equality.sql", "name": "default__test_equality", "macro_sql": "{% macro default__test_equality(model, compare_model, compare_columns=None) %}\n\n{% set set_diff %}\n count(*) + coalesce(abs(\n sum(case when which_diff = 'a_minus_b' then 1 else 0 end) -\n sum(case when which_diff = 'b_minus_a' then 1 else 0 end)\n ), 0)\n{% endset %}\n\n{#-- Needs to be set at parse time, before we return '' below --#}\n{{ config(fail_calc = set_diff) }}\n\n{#-- Prevent querying of db in parsing mode. This works because this macro does not create any new refs. #}\n{%- if not execute -%}\n {{ return('') }}\n{% endif %}\n\n-- setup\n{%- do dbt_utils._is_relation(model, 'test_equality') -%}\n\n{#-\nIf the compare_cols arg is provided, we can run this test without querying the\ninformation schema\u00a0\u2014 this allows the model to be an ephemeral model\n-#}\n\n{%- if not compare_columns -%}\n {%- do dbt_utils._is_ephemeral(model, 'test_equality') -%}\n {%- set compare_columns = adapter.get_columns_in_relation(model) | map(attribute='quoted') -%}\n{%- endif -%}\n\n{% set compare_cols_csv = compare_columns | join(', ') %}\n\nwith a as (\n\n select * from {{ model }}\n\n),\n\nb as (\n\n select * from {{ compare_model }}\n\n),\n\na_minus_b as (\n\n select {{compare_cols_csv}} from a\n {{ dbt_utils.except() }}\n select {{compare_cols_csv}} from b\n\n),\n\nb_minus_a as (\n\n select {{compare_cols_csv}} from b\n {{ dbt_utils.except() }}\n select {{compare_cols_csv}} from a\n\n),\n\nunioned as (\n\n select 'a_minus_b' as which_diff, a_minus_b.* from a_minus_b\n union all\n select 'b_minus_a' as which_diff, b_minus_a.* from b_minus_a\n\n)\n\nselect * from unioned\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils._is_relation", "macro.dbt_utils._is_ephemeral", "macro.dbt_utils.except"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600953.021683}, "macro.dbt_utils.test_mutually_exclusive_ranges": {"unique_id": "macro.dbt_utils.test_mutually_exclusive_ranges", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/dbt_utils", "path": "macros/generic_tests/mutually_exclusive_ranges.sql", "original_file_path": "macros/generic_tests/mutually_exclusive_ranges.sql", "name": "test_mutually_exclusive_ranges", "macro_sql": "{% test mutually_exclusive_ranges(model, lower_bound_column, upper_bound_column, partition_by=None, gaps='allowed', zero_length_range_allowed=False) %}\n {{ return(adapter.dispatch('test_mutually_exclusive_ranges', 'dbt_utils')(model, lower_bound_column, upper_bound_column, partition_by, gaps, zero_length_range_allowed)) }}\n{% endtest %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__test_mutually_exclusive_ranges"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600953.024608}, "macro.dbt_utils.default__test_mutually_exclusive_ranges": {"unique_id": "macro.dbt_utils.default__test_mutually_exclusive_ranges", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/dbt_utils", "path": "macros/generic_tests/mutually_exclusive_ranges.sql", "original_file_path": "macros/generic_tests/mutually_exclusive_ranges.sql", "name": "default__test_mutually_exclusive_ranges", "macro_sql": "{% macro default__test_mutually_exclusive_ranges(model, lower_bound_column, upper_bound_column, partition_by=None, gaps='allowed', zero_length_range_allowed=False) %}\n{% if gaps == 'not_allowed' %}\n {% set allow_gaps_operator='=' %}\n {% set allow_gaps_operator_in_words='equal_to' %}\n{% elif gaps == 'allowed' %}\n {% set allow_gaps_operator='<=' %}\n {% set allow_gaps_operator_in_words='less_than_or_equal_to' %}\n{% elif gaps == 'required' %}\n {% set allow_gaps_operator='<' %}\n {% set allow_gaps_operator_in_words='less_than' %}\n{% else %}\n {{ exceptions.raise_compiler_error(\n \"`gaps` argument for mutually_exclusive_ranges test must be one of ['not_allowed', 'allowed', 'required'] Got: '\" ~ gaps ~\"'.'\"\n ) }}\n{% endif %}\n{% if not zero_length_range_allowed %}\n {% set allow_zero_length_operator='<' %}\n {% set allow_zero_length_operator_in_words='less_than' %}\n{% elif zero_length_range_allowed %}\n {% set allow_zero_length_operator='<=' %}\n {% set allow_zero_length_operator_in_words='less_than_or_equal_to' %}\n{% else %}\n {{ exceptions.raise_compiler_error(\n \"`zero_length_range_allowed` argument for mutually_exclusive_ranges test must be one of [true, false] Got: '\" ~ zero_length_range_allowed ~\"'.'\"\n ) }}\n{% endif %}\n\n{% set partition_clause=\"partition by \" ~ partition_by if partition_by else '' %}\n\nwith window_functions as (\n\n select\n {% if partition_by %}\n {{ partition_by }} as partition_by_col,\n {% endif %}\n {{ lower_bound_column }} as lower_bound,\n {{ upper_bound_column }} as upper_bound,\n\n lead({{ lower_bound_column }}) over (\n {{ partition_clause }}\n order by {{ lower_bound_column }}\n ) as next_lower_bound,\n\n row_number() over (\n {{ partition_clause }}\n order by {{ lower_bound_column }} desc\n ) = 1 as is_last_record\n\n from {{ model }}\n\n),\n\ncalc as (\n -- We want to return records where one of our assumptions fails, so we'll use\n -- the `not` function with `and` statements so we can write our assumptions nore cleanly\n select\n *,\n\n -- For each record: lower_bound should be < upper_bound.\n -- Coalesce it to return an error on the null case (implicit assumption\n -- these columns are not_null)\n coalesce(\n lower_bound {{ allow_zero_length_operator }} upper_bound,\n false\n ) as lower_bound_{{ allow_zero_length_operator_in_words }}_upper_bound,\n\n -- For each record: upper_bound {{ allow_gaps_operator }} the next lower_bound.\n -- Coalesce it to handle null cases for the last record.\n coalesce(\n upper_bound {{ allow_gaps_operator }} next_lower_bound,\n is_last_record,\n false\n ) as upper_bound_{{ allow_gaps_operator_in_words }}_next_lower_bound\n\n from window_functions\n\n),\n\nvalidation_errors as (\n\n select\n *\n from calc\n\n where not(\n -- THE FOLLOWING SHOULD BE TRUE --\n lower_bound_{{ allow_zero_length_operator_in_words }}_upper_bound\n and upper_bound_{{ allow_gaps_operator_in_words }}_next_lower_bound\n )\n)\n\nselect * from validation_errors\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600953.026048}, "macro.dbt_utils.pretty_log_format": {"unique_id": "macro.dbt_utils.pretty_log_format", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/dbt_utils", "path": "macros/jinja_helpers/pretty_log_format.sql", "original_file_path": "macros/jinja_helpers/pretty_log_format.sql", "name": "pretty_log_format", "macro_sql": "{% macro pretty_log_format(message) %}\n {{ return(adapter.dispatch('pretty_log_format', 'dbt_utils')(message)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__pretty_log_format"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600953.0263731}, "macro.dbt_utils.default__pretty_log_format": {"unique_id": "macro.dbt_utils.default__pretty_log_format", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/dbt_utils", "path": "macros/jinja_helpers/pretty_log_format.sql", "original_file_path": "macros/jinja_helpers/pretty_log_format.sql", "name": "default__pretty_log_format", "macro_sql": "{% macro default__pretty_log_format(message) %}\n {{ return( dbt_utils.pretty_time() ~ ' + ' ~ message) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.pretty_time"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600953.0265331}, "macro.dbt_utils.pretty_time": {"unique_id": "macro.dbt_utils.pretty_time", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/dbt_utils", "path": "macros/jinja_helpers/pretty_time.sql", "original_file_path": "macros/jinja_helpers/pretty_time.sql", "name": "pretty_time", "macro_sql": "{% macro pretty_time(format='%H:%M:%S') %}\n {{ return(adapter.dispatch('pretty_time', 'dbt_utils')(format)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__pretty_time"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600953.026859}, "macro.dbt_utils.default__pretty_time": {"unique_id": "macro.dbt_utils.default__pretty_time", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/dbt_utils", "path": "macros/jinja_helpers/pretty_time.sql", "original_file_path": "macros/jinja_helpers/pretty_time.sql", "name": "default__pretty_time", "macro_sql": "{% macro default__pretty_time(format='%H:%M:%S') %}\n {{ return(modules.datetime.datetime.now().strftime(format)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600953.027054}, "macro.dbt_utils.log_info": {"unique_id": "macro.dbt_utils.log_info", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/dbt_utils", "path": "macros/jinja_helpers/log_info.sql", "original_file_path": "macros/jinja_helpers/log_info.sql", "name": "log_info", "macro_sql": "{% macro log_info(message) %}\n {{ return(adapter.dispatch('log_info', 'dbt_utils')(message)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__log_info"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600953.027358}, "macro.dbt_utils.default__log_info": {"unique_id": "macro.dbt_utils.default__log_info", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/dbt_utils", "path": "macros/jinja_helpers/log_info.sql", "original_file_path": "macros/jinja_helpers/log_info.sql", "name": "default__log_info", "macro_sql": "{% macro default__log_info(message) %}\n {{ log(dbt_utils.pretty_log_format(message), info=True) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.pretty_log_format"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600953.027522}, "macro.dbt_utils.slugify": {"unique_id": "macro.dbt_utils.slugify", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/dbt_utils", "path": "macros/jinja_helpers/slugify.sql", "original_file_path": "macros/jinja_helpers/slugify.sql", "name": "slugify", "macro_sql": "{% macro slugify(string) %}\n\n{#- Lower case the string -#}\n{% set string = string | lower %}\n{#- Replace spaces and dashes with underscores -#}\n{% set string = modules.re.sub('[ -]+', '_', string) %}\n{#- Only take letters, numbers, and underscores -#}\n{% set string = modules.re.sub('[^a-z0-9_]+', '', string) %}\n\n{{ return(string) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600953.028026}, "macro.dbt_utils.get_intervals_between": {"unique_id": "macro.dbt_utils.get_intervals_between", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/date_spine.sql", "original_file_path": "macros/sql/date_spine.sql", "name": "get_intervals_between", "macro_sql": "{% macro get_intervals_between(start_date, end_date, datepart) -%}\n {{ return(adapter.dispatch('get_intervals_between', 'dbt_utils')(start_date, end_date, datepart)) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__get_intervals_between"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600953.0287292}, "macro.dbt_utils.default__get_intervals_between": {"unique_id": "macro.dbt_utils.default__get_intervals_between", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/date_spine.sql", "original_file_path": "macros/sql/date_spine.sql", "name": "default__get_intervals_between", "macro_sql": "{% macro default__get_intervals_between(start_date, end_date, datepart) -%}\n {%- call statement('get_intervals_between', fetch_result=True) %}\n\n select {{dbt_utils.datediff(start_date, end_date, datepart)}}\n\n {%- endcall -%}\n\n {%- set value_list = load_result('get_intervals_between') -%}\n\n {%- if value_list and value_list['data'] -%}\n {%- set values = value_list['data'] | map(attribute=0) | list %}\n {{ return(values[0]) }}\n {%- else -%}\n {{ return(1) }}\n {%- endif -%}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.statement", "macro.dbt_utils.datediff"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600953.029301}, "macro.dbt_utils.date_spine": {"unique_id": "macro.dbt_utils.date_spine", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/date_spine.sql", "original_file_path": "macros/sql/date_spine.sql", "name": "date_spine", "macro_sql": "{% macro date_spine(datepart, start_date, end_date) %}\n {{ return(adapter.dispatch('date_spine', 'dbt_utils')(datepart, start_date, end_date)) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__date_spine"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600953.029526}, "macro.dbt_utils.default__date_spine": {"unique_id": "macro.dbt_utils.default__date_spine", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/date_spine.sql", "original_file_path": "macros/sql/date_spine.sql", "name": "default__date_spine", "macro_sql": "{% macro default__date_spine(datepart, start_date, end_date) %}\n\n\n{# call as follows:\n\ndate_spine(\n \"day\",\n \"to_date('01/01/2016', 'mm/dd/yyyy')\",\n \"dateadd(week, 1, current_date)\"\n) #}\n\n\nwith rawdata as (\n\n {{dbt_utils.generate_series(\n dbt_utils.get_intervals_between(start_date, end_date, datepart)\n )}}\n\n),\n\nall_periods as (\n\n select (\n {{\n dbt_utils.dateadd(\n datepart,\n \"row_number() over (order by 1) - 1\",\n start_date\n )\n }}\n ) as date_{{datepart}}\n from rawdata\n\n),\n\nfiltered as (\n\n select *\n from all_periods\n where date_{{datepart}} <= {{ end_date }}\n\n)\n\nselect * from filtered\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.generate_series", "macro.dbt_utils.get_intervals_between", "macro.dbt_utils.dateadd"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600953.0298722}, "macro.dbt_utils.nullcheck_table": {"unique_id": "macro.dbt_utils.nullcheck_table", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/nullcheck_table.sql", "original_file_path": "macros/sql/nullcheck_table.sql", "name": "nullcheck_table", "macro_sql": "{% macro nullcheck_table(relation) %}\n {{ return(adapter.dispatch('nullcheck_table', 'dbt_utils')(relation)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__nullcheck_table"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600953.0302348}, "macro.dbt_utils.default__nullcheck_table": {"unique_id": "macro.dbt_utils.default__nullcheck_table", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/nullcheck_table.sql", "original_file_path": "macros/sql/nullcheck_table.sql", "name": "default__nullcheck_table", "macro_sql": "{% macro default__nullcheck_table(relation) %}\n\n {%- do dbt_utils._is_relation(relation, 'nullcheck_table') -%}\n {%- do dbt_utils._is_ephemeral(relation, 'nullcheck_table') -%}\n {% set cols = adapter.get_columns_in_relation(relation) %}\n\n select {{ dbt_utils.nullcheck(cols) }}\n from {{relation}}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils._is_relation", "macro.dbt_utils._is_ephemeral", "macro.dbt_utils.nullcheck"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600953.030635}, "macro.dbt_utils.get_relations_by_pattern": {"unique_id": "macro.dbt_utils.get_relations_by_pattern", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/get_relations_by_pattern.sql", "original_file_path": "macros/sql/get_relations_by_pattern.sql", "name": "get_relations_by_pattern", "macro_sql": "{% macro get_relations_by_pattern(schema_pattern, table_pattern, exclude='', database=target.database) %}\n {{ return(adapter.dispatch('get_relations_by_pattern', 'dbt_utils')(schema_pattern, table_pattern, exclude, database)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__get_relations_by_pattern"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600953.031328}, "macro.dbt_utils.default__get_relations_by_pattern": {"unique_id": "macro.dbt_utils.default__get_relations_by_pattern", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/get_relations_by_pattern.sql", "original_file_path": "macros/sql/get_relations_by_pattern.sql", "name": "default__get_relations_by_pattern", "macro_sql": "{% macro default__get_relations_by_pattern(schema_pattern, table_pattern, exclude='', database=target.database) %}\n\n {%- call statement('get_tables', fetch_result=True) %}\n\n {{ dbt_utils.get_tables_by_pattern_sql(schema_pattern, table_pattern, exclude, database) }}\n\n {%- endcall -%}\n\n {%- set table_list = load_result('get_tables') -%}\n\n {%- if table_list and table_list['table'] -%}\n {%- set tbl_relations = [] -%}\n {%- for row in table_list['table'] -%}\n {%- set tbl_relation = api.Relation.create(\n database=database,\n schema=row.table_schema,\n identifier=row.table_name,\n type=row.table_type\n ) -%}\n {%- do tbl_relations.append(tbl_relation) -%}\n {%- endfor -%}\n\n {{ return(tbl_relations) }}\n {%- else -%}\n {{ return([]) }}\n {%- endif -%}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.statement", "macro.dbt_utils.get_tables_by_pattern_sql"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600953.0321531}, "macro.dbt_utils.get_powers_of_two": {"unique_id": "macro.dbt_utils.get_powers_of_two", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/generate_series.sql", "original_file_path": "macros/sql/generate_series.sql", "name": "get_powers_of_two", "macro_sql": "{% macro get_powers_of_two(upper_bound) %}\n {{ return(adapter.dispatch('get_powers_of_two', 'dbt_utils')(upper_bound)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__get_powers_of_two"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600953.0329752}, "macro.dbt_utils.default__get_powers_of_two": {"unique_id": "macro.dbt_utils.default__get_powers_of_two", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/generate_series.sql", "original_file_path": "macros/sql/generate_series.sql", "name": "default__get_powers_of_two", "macro_sql": "{% macro default__get_powers_of_two(upper_bound) %}\n\n {% if upper_bound <= 0 %}\n {{ exceptions.raise_compiler_error(\"upper bound must be positive\") }}\n {% endif %}\n\n {% for _ in range(1, 100) %}\n {% if upper_bound <= 2 ** loop.index %}{{ return(loop.index) }}{% endif %}\n {% endfor %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600953.033391}, "macro.dbt_utils.generate_series": {"unique_id": "macro.dbt_utils.generate_series", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/generate_series.sql", "original_file_path": "macros/sql/generate_series.sql", "name": "generate_series", "macro_sql": "{% macro generate_series(upper_bound) %}\n {{ return(adapter.dispatch('generate_series', 'dbt_utils')(upper_bound)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__generate_series"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600953.033576}, "macro.dbt_utils.default__generate_series": {"unique_id": "macro.dbt_utils.default__generate_series", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/generate_series.sql", "original_file_path": "macros/sql/generate_series.sql", "name": "default__generate_series", "macro_sql": "{% macro default__generate_series(upper_bound) %}\n\n {% set n = dbt_utils.get_powers_of_two(upper_bound) %}\n\n with p as (\n select 0 as generated_number union all select 1\n ), unioned as (\n\n select\n\n {% for i in range(n) %}\n p{{i}}.generated_number * power(2, {{i}})\n {% if not loop.last %} + {% endif %}\n {% endfor %}\n + 1\n as generated_number\n\n from\n\n {% for i in range(n) %}\n p as p{{i}}\n {% if not loop.last %} cross join {% endif %}\n {% endfor %}\n\n )\n\n select *\n from unioned\n where generated_number <= {{upper_bound}}\n order by generated_number\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.get_powers_of_two"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600953.034078}, "macro.dbt_utils.get_relations_by_prefix": {"unique_id": "macro.dbt_utils.get_relations_by_prefix", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/get_relations_by_prefix.sql", "original_file_path": "macros/sql/get_relations_by_prefix.sql", "name": "get_relations_by_prefix", "macro_sql": "{% macro get_relations_by_prefix(schema, prefix, exclude='', database=target.database) %}\n {{ return(adapter.dispatch('get_relations_by_prefix', 'dbt_utils')(schema, prefix, exclude, database)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__get_relations_by_prefix"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600953.034762}, "macro.dbt_utils.default__get_relations_by_prefix": {"unique_id": "macro.dbt_utils.default__get_relations_by_prefix", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/get_relations_by_prefix.sql", "original_file_path": "macros/sql/get_relations_by_prefix.sql", "name": "default__get_relations_by_prefix", "macro_sql": "{% macro default__get_relations_by_prefix(schema, prefix, exclude='', database=target.database) %}\n\n {%- call statement('get_tables', fetch_result=True) %}\n\n {{ dbt_utils.get_tables_by_prefix_sql(schema, prefix, exclude, database) }}\n\n {%- endcall -%}\n\n {%- set table_list = load_result('get_tables') -%}\n\n {%- if table_list and table_list['table'] -%}\n {%- set tbl_relations = [] -%}\n {%- for row in table_list['table'] -%}\n {%- set tbl_relation = api.Relation.create(\n database=database,\n schema=row.table_schema,\n identifier=row.table_name,\n type=row.table_type\n ) -%}\n {%- do tbl_relations.append(tbl_relation) -%}\n {%- endfor -%}\n\n {{ return(tbl_relations) }}\n {%- else -%}\n {{ return([]) }}\n {%- endif -%}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.statement", "macro.dbt_utils.get_tables_by_prefix_sql"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600953.035597}, "macro.dbt_utils.get_tables_by_prefix_sql": {"unique_id": "macro.dbt_utils.get_tables_by_prefix_sql", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/get_tables_by_prefix_sql.sql", "original_file_path": "macros/sql/get_tables_by_prefix_sql.sql", "name": "get_tables_by_prefix_sql", "macro_sql": "{% macro get_tables_by_prefix_sql(schema, prefix, exclude='', database=target.database) %}\n {{ return(adapter.dispatch('get_tables_by_prefix_sql', 'dbt_utils')(schema, prefix, exclude, database)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__get_tables_by_prefix_sql"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600953.0360441}, "macro.dbt_utils.default__get_tables_by_prefix_sql": {"unique_id": "macro.dbt_utils.default__get_tables_by_prefix_sql", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/get_tables_by_prefix_sql.sql", "original_file_path": "macros/sql/get_tables_by_prefix_sql.sql", "name": "default__get_tables_by_prefix_sql", "macro_sql": "{% macro default__get_tables_by_prefix_sql(schema, prefix, exclude='', database=target.database) %}\n\n {{ dbt_utils.get_tables_by_pattern_sql(\n schema_pattern = schema,\n table_pattern = prefix ~ '%',\n exclude = exclude,\n database = database\n ) }}\n \n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.get_tables_by_pattern_sql"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600953.036318}, "macro.dbt_utils.star": {"unique_id": "macro.dbt_utils.star", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/star.sql", "original_file_path": "macros/sql/star.sql", "name": "star", "macro_sql": "{% macro star(from, relation_alias=False, except=[], prefix='', suffix='') -%}\n {{ return(adapter.dispatch('star', 'dbt_utils')(from, relation_alias, except, prefix, suffix)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__star"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600953.03703}, "macro.dbt_utils.default__star": {"unique_id": "macro.dbt_utils.default__star", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/star.sql", "original_file_path": "macros/sql/star.sql", "name": "default__star", "macro_sql": "{% macro default__star(from, relation_alias=False, except=[], prefix='', suffix='') -%}\n {%- do dbt_utils._is_relation(from, 'star') -%}\n {%- do dbt_utils._is_ephemeral(from, 'star') -%}\n\n {#-- Prevent querying of db in parsing mode. This works because this macro does not create any new refs. #}\n {%- if not execute -%}\n {{ return('*') }}\n {% endif %}\n\n {% set cols = dbt_utils.get_filtered_columns_in_relation(from, except) %}\n\n {%- if cols|length <= 0 -%}\n {{- return('*') -}}\n {%- else -%}\n {%- for col in cols %}\n {%- if relation_alias %}{{ relation_alias }}.{% else %}{%- endif -%}{{ adapter.quote(col)|trim }} {%- if prefix!='' or suffix!='' %} as {{ adapter.quote(prefix ~ col ~ suffix)|trim }} {%- endif -%}\n {%- if not loop.last %},{{ '\\n ' }}{% endif %}\n {%- endfor -%}\n {% endif %}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils._is_relation", "macro.dbt_utils._is_ephemeral", "macro.dbt_utils.get_filtered_columns_in_relation"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600953.037981}, "macro.dbt_utils.unpivot": {"unique_id": "macro.dbt_utils.unpivot", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/unpivot.sql", "original_file_path": "macros/sql/unpivot.sql", "name": "unpivot", "macro_sql": "{% macro unpivot(relation=none, cast_to='varchar', exclude=none, remove=none, field_name='field_name', value_name='value', table=none) -%}\n {{ return(adapter.dispatch('unpivot', 'dbt_utils')(relation, cast_to, exclude, remove, field_name, value_name, table)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__unpivot"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600953.03966}, "macro.dbt_utils.default__unpivot": {"unique_id": "macro.dbt_utils.default__unpivot", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/unpivot.sql", "original_file_path": "macros/sql/unpivot.sql", "name": "default__unpivot", "macro_sql": "{% macro default__unpivot(relation=none, cast_to='varchar', exclude=none, remove=none, field_name='field_name', value_name='value', table=none) -%}\n\n {% if table %}\n {%- set error_message = '\n Warning: the `unpivot` macro no longer accepts a `table` parameter. \\\n This parameter will be deprecated in a future release of dbt-utils. Use the `relation` parameter instead. \\\n The {}.{} model triggered this warning. \\\n '.format(model.package_name, model.name) -%}\n {%- do exceptions.warn(error_message) -%}\n {% endif %}\n\n {% if relation and table %}\n {{ exceptions.raise_compiler_error(\"Error: both the `relation` and `table` parameters were provided to `unpivot` macro. Choose one only (we recommend `relation`).\") }}\n {% elif not relation and table %}\n {% set relation=table %}\n {% elif not relation and not table %}\n {{ exceptions.raise_compiler_error(\"Error: argument `relation` is required for `unpivot` macro.\") }}\n {% endif %}\n\n {%- set exclude = exclude if exclude is not none else [] %}\n {%- set remove = remove if remove is not none else [] %}\n\n {%- set include_cols = [] %}\n\n {%- set table_columns = {} %}\n\n {%- do table_columns.update({relation: []}) %}\n\n {%- do dbt_utils._is_relation(relation, 'unpivot') -%}\n {%- do dbt_utils._is_ephemeral(relation, 'unpivot') -%}\n {%- set cols = adapter.get_columns_in_relation(relation) %}\n\n {%- for col in cols -%}\n {%- if col.column.lower() not in remove|map('lower') and col.column.lower() not in exclude|map('lower') -%}\n {% do include_cols.append(col) %}\n {%- endif %}\n {%- endfor %}\n\n\n {%- for col in include_cols -%}\n select\n {%- for exclude_col in exclude %}\n {{ exclude_col }},\n {%- endfor %}\n\n cast('{{ col.column }}' as {{ dbt_utils.type_string() }}) as {{ field_name }},\n cast( {% if col.data_type == 'boolean' %}\n {{ dbt_utils.cast_bool_to_text(col.column) }}\n {% else %}\n {{ col.column }}\n {% endif %}\n as {{ cast_to }}) as {{ value_name }}\n\n from {{ relation }}\n\n {% if not loop.last -%}\n union all\n {% endif -%}\n {%- endfor -%}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils._is_relation", "macro.dbt_utils._is_ephemeral", "macro.dbt_utils.type_string", "macro.dbt_utils.cast_bool_to_text"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600953.0417652}, "macro.dbt_utils.union_relations": {"unique_id": "macro.dbt_utils.union_relations", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/union.sql", "original_file_path": "macros/sql/union.sql", "name": "union_relations", "macro_sql": "{%- macro union_relations(relations, column_override=none, include=[], exclude=[], source_column_name='_dbt_source_relation', where=none) -%}\n {{ return(adapter.dispatch('union_relations', 'dbt_utils')(relations, column_override, include, exclude, source_column_name, where)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__union_relations"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600953.044218}, "macro.dbt_utils.default__union_relations": {"unique_id": "macro.dbt_utils.default__union_relations", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/union.sql", "original_file_path": "macros/sql/union.sql", "name": "default__union_relations", "macro_sql": "\n\n{%- macro default__union_relations(relations, column_override=none, include=[], exclude=[], source_column_name='_dbt_source_relation', where=none) -%}\n\n {%- if exclude and include -%}\n {{ exceptions.raise_compiler_error(\"Both an exclude and include list were provided to the `union` macro. Only one is allowed\") }}\n {%- endif -%}\n\n {#-- Prevent querying of db in parsing mode. This works because this macro does not create any new refs. -#}\n {%- if not execute %}\n {{ return('') }}\n {% endif -%}\n\n {%- set column_override = column_override if column_override is not none else {} -%}\n\n {%- set relation_columns = {} -%}\n {%- set column_superset = {} -%}\n\n {%- for relation in relations -%}\n\n {%- do relation_columns.update({relation: []}) -%}\n\n {%- do dbt_utils._is_relation(relation, 'union_relations') -%}\n {%- do dbt_utils._is_ephemeral(relation, 'union_relations') -%}\n {%- set cols = adapter.get_columns_in_relation(relation) -%}\n {%- for col in cols -%}\n\n {#- If an exclude list was provided and the column is in the list, do nothing -#}\n {%- if exclude and col.column in exclude -%}\n\n {#- If an include list was provided and the column is not in the list, do nothing -#}\n {%- elif include and col.column not in include -%}\n\n {#- Otherwise add the column to the column superset -#}\n {%- else -%}\n\n {#- update the list of columns in this relation -#}\n {%- do relation_columns[relation].append(col.column) -%}\n\n {%- if col.column in column_superset -%}\n\n {%- set stored = column_superset[col.column] -%}\n {%- if col.is_string() and stored.is_string() and col.string_size() > stored.string_size() -%}\n\n {%- do column_superset.update({col.column: col}) -%}\n\n {%- endif %}\n\n {%- else -%}\n\n {%- do column_superset.update({col.column: col}) -%}\n\n {%- endif -%}\n\n {%- endif -%}\n\n {%- endfor -%}\n {%- endfor -%}\n\n {%- set ordered_column_names = column_superset.keys() -%}\n {%- set dbt_command = flags.WHICH -%}\n\n\n {% if dbt_command in ['run', 'build'] %}\n {% if (include | length > 0 or exclude | length > 0) and not column_superset.keys() %}\n {%- set relations_string -%}\n {%- for relation in relations -%}\n {{ relation.name }}\n {%- if not loop.last %}, {% endif -%}\n {%- endfor -%}\n {%- endset -%}\n\n {%- set error_message -%}\n There were no columns found to union for relations {{ relations_string }}\n {%- endset -%}\n\n {{ exceptions.raise_compiler_error(error_message) }}\n {%- endif -%}\n {%- endif -%}\n\n {%- for relation in relations %}\n\n (\n select\n\n cast({{ dbt_utils.string_literal(relation) }} as {{ dbt_utils.type_string() }}) as {{ source_column_name }},\n {% for col_name in ordered_column_names -%}\n\n {%- set col = column_superset[col_name] %}\n {%- set col_type = column_override.get(col.column, col.data_type) %}\n {%- set col_name = adapter.quote(col_name) if col_name in relation_columns[relation] else 'null' %}\n cast({{ col_name }} as {{ col_type }}) as {{ col.quoted }} {% if not loop.last %},{% endif -%}\n\n {%- endfor %}\n\n from {{ relation }}\n\n {% if where -%}\n where {{ where }}\n {%- endif %}\n )\n\n {% if not loop.last -%}\n union all\n {% endif -%}\n\n {%- endfor -%}\n\n{%- endmacro -%}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils._is_relation", "macro.dbt_utils._is_ephemeral", "macro.dbt_utils.string_literal", "macro.dbt_utils.type_string"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600953.07412}, "macro.dbt_utils.group_by": {"unique_id": "macro.dbt_utils.group_by", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/groupby.sql", "original_file_path": "macros/sql/groupby.sql", "name": "group_by", "macro_sql": "{%- macro group_by(n) -%}\n {{ return(adapter.dispatch('group_by', 'dbt_utils')(n)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__group_by"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600953.074613}, "macro.dbt_utils.default__group_by": {"unique_id": "macro.dbt_utils.default__group_by", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/groupby.sql", "original_file_path": "macros/sql/groupby.sql", "name": "default__group_by", "macro_sql": "\n\n{%- macro default__group_by(n) -%}\n\n group by {% for i in range(1, n + 1) -%}\n {{ i }}{{ ',' if not loop.last }} \n {%- endfor -%}\n\n{%- endmacro -%}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600953.074867}, "macro.dbt_utils.deduplicate": {"unique_id": "macro.dbt_utils.deduplicate", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/deduplicate.sql", "original_file_path": "macros/sql/deduplicate.sql", "name": "deduplicate", "macro_sql": "{%- macro deduplicate(relation, partition_by, order_by=none, relation_alias=none) -%}\n\n {%- set error_message_group_by -%}\nWarning: the `group_by` parameter of the `deduplicate` macro is no longer supported and will be deprecated in a future release of dbt-utils.\nUse `partition_by` instead.\nThe {{ model.package_name }}.{{ model.name }} model triggered this warning.\n {%- endset -%}\n\n {% if kwargs.get('group_by') %}\n {%- do exceptions.warn(error_message_group_by) -%}\n {%- endif -%}\n\n {%- set error_message_order_by -%}\nWarning: `order_by` as an optional parameter of the `deduplicate` macro is no longer supported and will be deprecated in a future release of dbt-utils.\nSupply a non-null value for `order_by` instead.\nThe {{ model.package_name }}.{{ model.name }} model triggered this warning.\n {%- endset -%}\n\n {% if not order_by %}\n {%- do exceptions.warn(error_message_order_by) -%}\n {%- endif -%}\n\n {%- set error_message_alias -%}\nWarning: the `relation_alias` parameter of the `deduplicate` macro is no longer supported and will be deprecated in a future release of dbt-utils.\nIf you were using `relation_alias` to point to a CTE previously then you can now pass the alias directly to `relation` instead.\nThe {{ model.package_name }}.{{ model.name }} model triggered this warning.\n {%- endset -%}\n\n {% if relation_alias %}\n {%- do exceptions.warn(error_message_alias) -%}\n {%- endif -%}\n\n {% set partition_by = partition_by or kwargs.get('group_by') %}\n {% set relation = relation_alias or relation %}\n {% set order_by = order_by or \"'1'\" %}\n\n {{ return(adapter.dispatch('deduplicate', 'dbt_utils')(relation, partition_by, order_by)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.bigquery__deduplicate"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600953.0772321}, "macro.dbt_utils.default__deduplicate": {"unique_id": "macro.dbt_utils.default__deduplicate", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/deduplicate.sql", "original_file_path": "macros/sql/deduplicate.sql", "name": "default__deduplicate", "macro_sql": "\n\n{%- macro default__deduplicate(relation, partition_by, order_by) -%}\n\n with row_numbered as (\n select\n _inner.*,\n row_number() over (\n partition by {{ partition_by }}\n order by {{ order_by }}\n ) as rn\n from {{ relation }} as _inner\n )\n\n select\n distinct data.*\n from {{ relation }} as data\n {#\n -- Not all DBs will support natural joins but the ones that do include:\n -- Oracle, MySQL, SQLite, Redshift, Teradata, Materialize, Databricks\n -- Apache Spark, SingleStore, Vertica\n -- Those that do not appear to support natural joins include:\n -- SQLServer, Trino, Presto, Rockset, Athena\n #}\n natural join row_numbered\n where row_numbered.rn = 1\n\n{%- endmacro -%}\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600953.077451}, "macro.dbt_utils.redshift__deduplicate": {"unique_id": "macro.dbt_utils.redshift__deduplicate", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/deduplicate.sql", "original_file_path": "macros/sql/deduplicate.sql", "name": "redshift__deduplicate", "macro_sql": "{% macro redshift__deduplicate(relation, partition_by, order_by) -%}\n\n {{ return(dbt_utils.default__deduplicate(relation, partition_by, order_by=order_by)) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__deduplicate"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600953.0776498}, "macro.dbt_utils.postgres__deduplicate": {"unique_id": "macro.dbt_utils.postgres__deduplicate", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/deduplicate.sql", "original_file_path": "macros/sql/deduplicate.sql", "name": "postgres__deduplicate", "macro_sql": "\n{%- macro postgres__deduplicate(relation, partition_by, order_by) -%}\n\n select\n distinct on ({{ partition_by }}) *\n from {{ relation }}\n order by {{ partition_by }}{{ ',' ~ order_by }}\n\n{%- endmacro -%}\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600953.077843}, "macro.dbt_utils.snowflake__deduplicate": {"unique_id": "macro.dbt_utils.snowflake__deduplicate", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/deduplicate.sql", "original_file_path": "macros/sql/deduplicate.sql", "name": "snowflake__deduplicate", "macro_sql": "\n{%- macro snowflake__deduplicate(relation, partition_by, order_by) -%}\n\n select *\n from {{ relation }}\n qualify\n row_number() over (\n partition by {{ partition_by }}\n order by {{ order_by }}\n ) = 1\n\n{%- endmacro -%}\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600953.0780008}, "macro.dbt_utils.bigquery__deduplicate": {"unique_id": "macro.dbt_utils.bigquery__deduplicate", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/deduplicate.sql", "original_file_path": "macros/sql/deduplicate.sql", "name": "bigquery__deduplicate", "macro_sql": "\n{%- macro bigquery__deduplicate(relation, partition_by, order_by) -%}\n\n select unique.*\n from (\n select\n array_agg (\n original\n order by {{ order_by }}\n limit 1\n )[offset(0)] unique\n from {{ relation }} original\n group by {{ partition_by }}\n )\n\n{%- endmacro -%}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600953.078169}, "macro.dbt_utils.surrogate_key": {"unique_id": "macro.dbt_utils.surrogate_key", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/surrogate_key.sql", "original_file_path": "macros/sql/surrogate_key.sql", "name": "surrogate_key", "macro_sql": "{%- macro surrogate_key(field_list) -%}\n {# needed for safe_add to allow for non-keyword arguments see SO post #}\n {# https://stackoverflow.com/questions/13944751/args-kwargs-in-jinja2-macros #}\n {% set frustrating_jinja_feature = varargs %}\n {{ return(adapter.dispatch('surrogate_key', 'dbt_utils')(field_list, *varargs)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__surrogate_key"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600953.0787818}, "macro.dbt_utils.default__surrogate_key": {"unique_id": "macro.dbt_utils.default__surrogate_key", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/surrogate_key.sql", "original_file_path": "macros/sql/surrogate_key.sql", "name": "default__surrogate_key", "macro_sql": "\n\n{%- macro default__surrogate_key(field_list) -%}\n\n{%- if varargs|length >= 1 or field_list is string %}\n\n{%- set error_message = '\nWarning: the `surrogate_key` macro now takes a single list argument instead of \\\nmultiple string arguments. Support for multiple string arguments will be \\\ndeprecated in a future release of dbt-utils. The {}.{} model triggered this warning. \\\n'.format(model.package_name, model.name) -%}\n\n{%- do exceptions.warn(error_message) -%}\n\n{# first argument is not included in varargs, so add first element to field_list_xf #}\n{%- set field_list_xf = [field_list] -%}\n\n{%- for field in varargs %}\n{%- set _ = field_list_xf.append(field) -%}\n{%- endfor -%}\n\n{%- else -%}\n\n{# if using list, just set field_list_xf as field_list #}\n{%- set field_list_xf = field_list -%}\n\n{%- endif -%}\n\n\n{%- set fields = [] -%}\n\n{%- for field in field_list_xf -%}\n\n {%- set _ = fields.append(\n \"coalesce(cast(\" ~ field ~ \" as \" ~ dbt_utils.type_string() ~ \"), '')\"\n ) -%}\n\n {%- if not loop.last %}\n {%- set _ = fields.append(\"'-'\") -%}\n {%- endif -%}\n\n{%- endfor -%}\n\n{{dbt_utils.hash(dbt_utils.concat(fields))}}\n\n{%- endmacro -%}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.type_string", "macro.dbt_utils.hash", "macro.dbt_utils.concat"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600953.079695}, "macro.dbt_utils.safe_add": {"unique_id": "macro.dbt_utils.safe_add", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/safe_add.sql", "original_file_path": "macros/sql/safe_add.sql", "name": "safe_add", "macro_sql": "{%- macro safe_add() -%}\n {# needed for safe_add to allow for non-keyword arguments see SO post #}\n {# https://stackoverflow.com/questions/13944751/args-kwargs-in-jinja2-macros #}\n {% set frustrating_jinja_feature = varargs %}\n {{ return(adapter.dispatch('safe_add', 'dbt_utils')(*varargs)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__safe_add"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600953.08013}, "macro.dbt_utils.default__safe_add": {"unique_id": "macro.dbt_utils.default__safe_add", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/safe_add.sql", "original_file_path": "macros/sql/safe_add.sql", "name": "default__safe_add", "macro_sql": "\n\n{%- macro default__safe_add() -%}\n\n{% set fields = [] %}\n\n{%- for field in varargs -%}\n\n {% do fields.append(\"coalesce(\" ~ field ~ \", 0)\") %}\n\n{%- endfor -%}\n\n{{ fields|join(' +\\n ') }}\n\n{%- endmacro -%}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600953.080409}, "macro.dbt_utils.nullcheck": {"unique_id": "macro.dbt_utils.nullcheck", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/nullcheck.sql", "original_file_path": "macros/sql/nullcheck.sql", "name": "nullcheck", "macro_sql": "{% macro nullcheck(cols) %}\n {{ return(adapter.dispatch('nullcheck', 'dbt_utils')(cols)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__nullcheck"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600953.080794}, "macro.dbt_utils.default__nullcheck": {"unique_id": "macro.dbt_utils.default__nullcheck", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/nullcheck.sql", "original_file_path": "macros/sql/nullcheck.sql", "name": "default__nullcheck", "macro_sql": "{% macro default__nullcheck(cols) %}\n{%- for col in cols %}\n\n {% if col.is_string() -%}\n\n nullif({{col.name}},'') as {{col.name}}\n\n {%- else -%}\n\n {{col.name}}\n\n {%- endif -%}\n\n{%- if not loop.last -%} , {%- endif -%}\n\n{%- endfor -%}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600953.0811222}, "macro.dbt_utils.get_tables_by_pattern_sql": {"unique_id": "macro.dbt_utils.get_tables_by_pattern_sql", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/get_tables_by_pattern_sql.sql", "original_file_path": "macros/sql/get_tables_by_pattern_sql.sql", "name": "get_tables_by_pattern_sql", "macro_sql": "{% macro get_tables_by_pattern_sql(schema_pattern, table_pattern, exclude='', database=target.database) %}\n {{ return(adapter.dispatch('get_tables_by_pattern_sql', 'dbt_utils')\n (schema_pattern, table_pattern, exclude, database)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.bigquery__get_tables_by_pattern_sql"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600953.082591}, "macro.dbt_utils.default__get_tables_by_pattern_sql": {"unique_id": "macro.dbt_utils.default__get_tables_by_pattern_sql", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/get_tables_by_pattern_sql.sql", "original_file_path": "macros/sql/get_tables_by_pattern_sql.sql", "name": "default__get_tables_by_pattern_sql", "macro_sql": "{% macro default__get_tables_by_pattern_sql(schema_pattern, table_pattern, exclude='', database=target.database) %}\n\n select distinct\n table_schema as \"table_schema\",\n table_name as \"table_name\",\n {{ dbt_utils.get_table_types_sql() }}\n from {{ database }}.information_schema.tables\n where table_schema ilike '{{ schema_pattern }}'\n and table_name ilike '{{ table_pattern }}'\n and table_name not ilike '{{ exclude }}'\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.get_table_types_sql"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600953.08286}, "macro.dbt_utils.bigquery__get_tables_by_pattern_sql": {"unique_id": "macro.dbt_utils.bigquery__get_tables_by_pattern_sql", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/get_tables_by_pattern_sql.sql", "original_file_path": "macros/sql/get_tables_by_pattern_sql.sql", "name": "bigquery__get_tables_by_pattern_sql", "macro_sql": "{% macro bigquery__get_tables_by_pattern_sql(schema_pattern, table_pattern, exclude='', database=target.database) %}\n\n {% if '%' in schema_pattern %}\n {% set schemata=dbt_utils._bigquery__get_matching_schemata(schema_pattern, database) %}\n {% else %}\n {% set schemata=[schema_pattern] %}\n {% endif %}\n\n {% set sql %}\n {% for schema in schemata %}\n select distinct\n table_schema,\n table_name,\n {{ dbt_utils.get_table_types_sql() }}\n\n from {{ adapter.quote(database) }}.{{ schema }}.INFORMATION_SCHEMA.TABLES\n where lower(table_name) like lower ('{{ table_pattern }}')\n and lower(table_name) not like lower ('{{ exclude }}')\n\n {% if not loop.last %} union all {% endif %}\n\n {% endfor %}\n {% endset %}\n\n {{ return(sql) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils._bigquery__get_matching_schemata", "macro.dbt_utils.get_table_types_sql"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600953.083623}, "macro.dbt_utils._bigquery__get_matching_schemata": {"unique_id": "macro.dbt_utils._bigquery__get_matching_schemata", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/get_tables_by_pattern_sql.sql", "original_file_path": "macros/sql/get_tables_by_pattern_sql.sql", "name": "_bigquery__get_matching_schemata", "macro_sql": "{% macro _bigquery__get_matching_schemata(schema_pattern, database) %}\n {% if execute %}\n\n {% set sql %}\n select schema_name from {{ adapter.quote(database) }}.INFORMATION_SCHEMA.SCHEMATA\n where lower(schema_name) like lower('{{ schema_pattern }}')\n {% endset %}\n\n {% set results=run_query(sql) %}\n\n {% set schemata=results.columns['schema_name'].values() %}\n\n {{ return(schemata) }}\n\n {% else %}\n\n {{ return([]) }}\n\n {% endif %}\n\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.run_query"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600953.084119}, "macro.dbt_utils.get_column_values": {"unique_id": "macro.dbt_utils.get_column_values", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/get_column_values.sql", "original_file_path": "macros/sql/get_column_values.sql", "name": "get_column_values", "macro_sql": "{% macro get_column_values(table, column, order_by='count(*) desc', max_records=none, default=none, where=none) -%}\n {{ return(adapter.dispatch('get_column_values', 'dbt_utils')(table, column, order_by, max_records, default, where)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__get_column_values"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600953.085234}, "macro.dbt_utils.default__get_column_values": {"unique_id": "macro.dbt_utils.default__get_column_values", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/get_column_values.sql", "original_file_path": "macros/sql/get_column_values.sql", "name": "default__get_column_values", "macro_sql": "{% macro default__get_column_values(table, column, order_by='count(*) desc', max_records=none, default=none, where=none) -%}\n {#-- Prevent querying of db in parsing mode. This works because this macro does not create any new refs. #}\n {%- if not execute -%}\n {% set default = [] if not default %}\n {{ return(default) }}\n {% endif %}\n\n {%- do dbt_utils._is_ephemeral(table, 'get_column_values') -%}\n\n {# Not all relations are tables. Renaming for internal clarity without breaking functionality for anyone using named arguments #}\n {# TODO: Change the method signature in a future 0.x.0 release #}\n {%- set target_relation = table -%}\n\n {# adapter.load_relation is a convenience wrapper to avoid building a Relation when we already have one #}\n {% set relation_exists = (load_relation(target_relation)) is not none %}\n\n {%- call statement('get_column_values', fetch_result=true) %}\n\n {%- if not relation_exists and default is none -%}\n\n {{ exceptions.raise_compiler_error(\"In get_column_values(): relation \" ~ target_relation ~ \" does not exist and no default value was provided.\") }}\n\n {%- elif not relation_exists and default is not none -%}\n\n {{ log(\"Relation \" ~ target_relation ~ \" does not exist. Returning the default value: \" ~ default) }}\n\n {{ return(default) }}\n\n {%- else -%}\n\n\n select\n {{ column }} as value\n\n from {{ target_relation }}\n\n {% if where is not none %}\n where {{ where }}\n {% endif %}\n\n group by {{ column }}\n order by {{ order_by }}\n\n {% if max_records is not none %}\n limit {{ max_records }}\n {% endif %}\n\n {% endif %}\n\n {%- endcall -%}\n\n {%- set value_list = load_result('get_column_values') -%}\n\n {%- if value_list and value_list['data'] -%}\n {%- set values = value_list['data'] | map(attribute=0) | list %}\n {{ return(values) }}\n {%- else -%}\n {{ return(default) }}\n {%- endif -%}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils._is_ephemeral", "macro.dbt.load_relation", "macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600953.086731}, "macro.dbt_utils.pivot": {"unique_id": "macro.dbt_utils.pivot", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/pivot.sql", "original_file_path": "macros/sql/pivot.sql", "name": "pivot", "macro_sql": "{% macro pivot(column,\n values,\n alias=True,\n agg='sum',\n cmp='=',\n prefix='',\n suffix='',\n then_value=1,\n else_value=0,\n quote_identifiers=True,\n distinct=False) %}\n {{ return(adapter.dispatch('pivot', 'dbt_utils')(column, values, alias, agg, cmp, prefix, suffix, then_value, else_value, quote_identifiers, distinct)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__pivot"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600953.087808}, "macro.dbt_utils.default__pivot": {"unique_id": "macro.dbt_utils.default__pivot", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/pivot.sql", "original_file_path": "macros/sql/pivot.sql", "name": "default__pivot", "macro_sql": "{% macro default__pivot(column,\n values,\n alias=True,\n agg='sum',\n cmp='=',\n prefix='',\n suffix='',\n then_value=1,\n else_value=0,\n quote_identifiers=True,\n distinct=False) %}\n {% for value in values %}\n {{ agg }}(\n {% if distinct %} distinct {% endif %}\n case\n when {{ column }} {{ cmp }} '{{ dbt_utils.escape_single_quotes(value) }}'\n then {{ then_value }}\n else {{ else_value }}\n end\n )\n {% if alias %}\n {% if quote_identifiers %}\n as {{ adapter.quote(prefix ~ value ~ suffix) }}\n {% else %}\n as {{ dbt_utils.slugify(prefix ~ value ~ suffix) }}\n {% endif %}\n {% endif %}\n {% if not loop.last %},{% endif %}\n {% endfor %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.escape_single_quotes", "macro.dbt_utils.slugify"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600953.088626}, "macro.dbt_utils.get_filtered_columns_in_relation": {"unique_id": "macro.dbt_utils.get_filtered_columns_in_relation", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/get_filtered_columns_in_relation.sql", "original_file_path": "macros/sql/get_filtered_columns_in_relation.sql", "name": "get_filtered_columns_in_relation", "macro_sql": "{% macro get_filtered_columns_in_relation(from, except=[]) -%}\n {{ return(adapter.dispatch('get_filtered_columns_in_relation', 'dbt_utils')(from, except)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__get_filtered_columns_in_relation"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600953.089133}, "macro.dbt_utils.default__get_filtered_columns_in_relation": {"unique_id": "macro.dbt_utils.default__get_filtered_columns_in_relation", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/get_filtered_columns_in_relation.sql", "original_file_path": "macros/sql/get_filtered_columns_in_relation.sql", "name": "default__get_filtered_columns_in_relation", "macro_sql": "{% macro default__get_filtered_columns_in_relation(from, except=[]) -%}\n {%- do dbt_utils._is_relation(from, 'get_filtered_columns_in_relation') -%}\n {%- do dbt_utils._is_ephemeral(from, 'get_filtered_columns_in_relation') -%}\n\n {# -- Prevent querying of db in parsing mode. This works because this macro does not create any new refs. #}\n {%- if not execute -%}\n {{ return('') }}\n {% endif %}\n\n {%- set include_cols = [] %}\n {%- set cols = adapter.get_columns_in_relation(from) -%}\n {%- set except = except | map(\"lower\") | list %}\n {%- for col in cols -%}\n {%- if col.column|lower not in except -%}\n {% do include_cols.append(col.column) %}\n {%- endif %}\n {%- endfor %}\n\n {{ return(include_cols) }}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils._is_relation", "macro.dbt_utils._is_ephemeral"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600953.089838}, "macro.dbt_utils.get_query_results_as_dict": {"unique_id": "macro.dbt_utils.get_query_results_as_dict", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/get_query_results_as_dict.sql", "original_file_path": "macros/sql/get_query_results_as_dict.sql", "name": "get_query_results_as_dict", "macro_sql": "{% macro get_query_results_as_dict(query) %}\n {{ return(adapter.dispatch('get_query_results_as_dict', 'dbt_utils')(query)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__get_query_results_as_dict"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600953.0902731}, "macro.dbt_utils.default__get_query_results_as_dict": {"unique_id": "macro.dbt_utils.default__get_query_results_as_dict", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/get_query_results_as_dict.sql", "original_file_path": "macros/sql/get_query_results_as_dict.sql", "name": "default__get_query_results_as_dict", "macro_sql": "{% macro default__get_query_results_as_dict(query) %}\n\n{# This macro returns a dictionary of the form {column_name: (tuple_of_results)} #}\n\n {%- call statement('get_query_results', fetch_result=True,auto_begin=false) -%}\n\n {{ query }}\n\n {%- endcall -%}\n\n {% set sql_results={} %}\n\n {%- if execute -%}\n {% set sql_results_table = load_result('get_query_results').table.columns %}\n {% for column_name, column in sql_results_table.items() %}\n {% do sql_results.update({column_name: column.values()}) %}\n {% endfor %}\n {%- endif -%}\n\n {{ return(sql_results) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600953.090852}, "macro.dbt_utils.get_table_types_sql": {"unique_id": "macro.dbt_utils.get_table_types_sql", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/get_table_types_sql.sql", "original_file_path": "macros/sql/get_table_types_sql.sql", "name": "get_table_types_sql", "macro_sql": "{%- macro get_table_types_sql() -%}\n {{ return(adapter.dispatch('get_table_types_sql', 'dbt_utils')()) }}\n{%- endmacro -%}\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.bigquery__get_table_types_sql"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600953.0913558}, "macro.dbt_utils.default__get_table_types_sql": {"unique_id": "macro.dbt_utils.default__get_table_types_sql", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/get_table_types_sql.sql", "original_file_path": "macros/sql/get_table_types_sql.sql", "name": "default__get_table_types_sql", "macro_sql": "{% macro default__get_table_types_sql() %}\n case table_type\n when 'BASE TABLE' then 'table'\n when 'EXTERNAL TABLE' then 'external'\n when 'MATERIALIZED VIEW' then 'materializedview'\n else lower(table_type)\n end as \"table_type\"\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600953.091439}, "macro.dbt_utils.postgres__get_table_types_sql": {"unique_id": "macro.dbt_utils.postgres__get_table_types_sql", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/get_table_types_sql.sql", "original_file_path": "macros/sql/get_table_types_sql.sql", "name": "postgres__get_table_types_sql", "macro_sql": "{% macro postgres__get_table_types_sql() %}\n case table_type\n when 'BASE TABLE' then 'table'\n when 'FOREIGN' then 'external'\n when 'MATERIALIZED VIEW' then 'materializedview'\n else lower(table_type)\n end as \"table_type\"\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600953.091522}, "macro.dbt_utils.bigquery__get_table_types_sql": {"unique_id": "macro.dbt_utils.bigquery__get_table_types_sql", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/get_table_types_sql.sql", "original_file_path": "macros/sql/get_table_types_sql.sql", "name": "bigquery__get_table_types_sql", "macro_sql": "{% macro bigquery__get_table_types_sql() %}\n case table_type\n when 'BASE TABLE' then 'table'\n when 'EXTERNAL TABLE' then 'external'\n when 'MATERIALIZED VIEW' then 'materializedview'\n else lower(table_type)\n end as `table_type`\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600953.091601}, "macro.dbt_utils.degrees_to_radians": {"unique_id": "macro.dbt_utils.degrees_to_radians", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/haversine_distance.sql", "original_file_path": "macros/sql/haversine_distance.sql", "name": "degrees_to_radians", "macro_sql": "{% macro degrees_to_radians(degrees) -%}\n acos(-1) * {{degrees}} / 180\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600953.092625}, "macro.dbt_utils.haversine_distance": {"unique_id": "macro.dbt_utils.haversine_distance", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/haversine_distance.sql", "original_file_path": "macros/sql/haversine_distance.sql", "name": "haversine_distance", "macro_sql": "{% macro haversine_distance(lat1, lon1, lat2, lon2, unit='mi') -%}\n {{ return(adapter.dispatch('haversine_distance', 'dbt_utils')(lat1,lon1,lat2,lon2,unit)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.bigquery__haversine_distance"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600953.0928981}, "macro.dbt_utils.default__haversine_distance": {"unique_id": "macro.dbt_utils.default__haversine_distance", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/haversine_distance.sql", "original_file_path": "macros/sql/haversine_distance.sql", "name": "default__haversine_distance", "macro_sql": "{% macro default__haversine_distance(lat1, lon1, lat2, lon2, unit='mi') -%}\n{%- if unit == 'mi' %}\n {% set conversion_rate = 1 %}\n{% elif unit == 'km' %}\n {% set conversion_rate = 1.60934 %}\n{% else %}\n {{ exceptions.raise_compiler_error(\"unit input must be one of 'mi' or 'km'. Got \" ~ unit) }}\n{% endif %}\n\n 2 * 3961 * asin(sqrt(power((sin(radians(({{ lat2 }} - {{ lat1 }}) / 2))), 2) +\n cos(radians({{lat1}})) * cos(radians({{lat2}})) *\n power((sin(radians(({{ lon2 }} - {{ lon1 }}) / 2))), 2))) * {{ conversion_rate }}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600953.094594}, "macro.dbt_utils.bigquery__haversine_distance": {"unique_id": "macro.dbt_utils.bigquery__haversine_distance", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/haversine_distance.sql", "original_file_path": "macros/sql/haversine_distance.sql", "name": "bigquery__haversine_distance", "macro_sql": "{% macro bigquery__haversine_distance(lat1, lon1, lat2, lon2, unit='mi') -%}\n{% set radians_lat1 = dbt_utils.degrees_to_radians(lat1) %}\n{% set radians_lat2 = dbt_utils.degrees_to_radians(lat2) %}\n{% set radians_lon1 = dbt_utils.degrees_to_radians(lon1) %}\n{% set radians_lon2 = dbt_utils.degrees_to_radians(lon2) %}\n{%- if unit == 'mi' %}\n {% set conversion_rate = 1 %}\n{% elif unit == 'km' %}\n {% set conversion_rate = 1.60934 %}\n{% else %}\n {{ exceptions.raise_compiler_error(\"unit input must be one of 'mi' or 'km'. Got \" ~ unit) }}\n{% endif %}\n 2 * 3961 * asin(sqrt(power(sin(({{ radians_lat2 }} - {{ radians_lat1 }}) / 2), 2) +\n cos({{ radians_lat1 }}) * cos({{ radians_lat2 }}) *\n power(sin(({{ radians_lon2 }} - {{ radians_lon1 }}) / 2), 2))) * {{ conversion_rate }}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.degrees_to_radians"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600953.095447}, "macro.asana_source.get_story_columns": {"unique_id": "macro.asana_source.get_story_columns", "package_name": "asana_source", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/asana_source", "path": "macros/get_story_columns.sql", "original_file_path": "macros/get_story_columns.sql", "name": "get_story_columns", "macro_sql": "{% macro get_story_columns() %}\n\n{% set columns = [\n {\"name\": \"_fivetran_synced\", \"datatype\": dbt_utils.type_timestamp()},\n {\"name\": \"created_at\", \"datatype\": dbt_utils.type_timestamp()},\n {\"name\": \"created_by_id\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"hearted\", \"datatype\": \"boolean\"},\n {\"name\": \"id\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"num_hearts\", \"datatype\": dbt_utils.type_int()},\n {\"name\": \"source\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"target_id\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"text\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"type\", \"datatype\": dbt_utils.type_string()}\n] %}\n\n{{ return(columns) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.type_timestamp", "macro.dbt_utils.type_string", "macro.dbt_utils.type_int"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600953.096661}, "macro.asana_source.get_task_tag_columns": {"unique_id": "macro.asana_source.get_task_tag_columns", "package_name": "asana_source", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/asana_source", "path": "macros/get_task_tag_columns.sql", "original_file_path": "macros/get_task_tag_columns.sql", "name": "get_task_tag_columns", "macro_sql": "{% macro get_task_tag_columns() %}\n\n{% set columns = [\n {\"name\": \"_fivetran_synced\", \"datatype\": dbt_utils.type_timestamp()},\n {\"name\": \"tag_id\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"task_id\", \"datatype\": dbt_utils.type_string()}\n] %}\n\n{{ return(columns) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.type_timestamp", "macro.dbt_utils.type_string"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600953.097211}, "macro.asana_source.get_task_columns": {"unique_id": "macro.asana_source.get_task_columns", "package_name": "asana_source", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/asana_source", "path": "macros/get_task_columns.sql", "original_file_path": "macros/get_task_columns.sql", "name": "get_task_columns", "macro_sql": "{% macro get_task_columns() %}\n\n{% set columns = [\n {\"name\": \"_fivetran_synced\", \"datatype\": dbt_utils.type_timestamp()},\n {\"name\": \"assignee_id\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"completed\", \"datatype\": \"boolean\"},\n {\"name\": \"completed_at\", \"datatype\": dbt_utils.type_timestamp()},\n {\"name\": \"completed_by_id\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"created_at\", \"datatype\": dbt_utils.type_timestamp()},\n {\"name\": \"due_at\", \"datatype\": dbt_utils.type_timestamp()},\n {\"name\": \"due_on\", \"datatype\": dbt_utils.type_timestamp()},\n {\"name\": \"id\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"modified_at\", \"datatype\": dbt_utils.type_timestamp()},\n {\"name\": \"name\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"notes\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"liked\", \"datatype\": \"boolean\"},\n {\"name\": \"num_likes\", \"datatype\": dbt_utils.type_int()},\n {\"name\": \"parent_id\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"start_on\", \"datatype\": dbt_utils.type_timestamp()},\n {\"name\": \"workspace_id\", \"datatype\": dbt_utils.type_string()}\n] %}\n\n{{ return(columns) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.type_timestamp", "macro.dbt_utils.type_string", "macro.dbt_utils.type_int"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600953.099085}, "macro.asana_source.get_task_section_columns": {"unique_id": "macro.asana_source.get_task_section_columns", "package_name": "asana_source", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/asana_source", "path": "macros/get_task_section_columns.sql", "original_file_path": "macros/get_task_section_columns.sql", "name": "get_task_section_columns", "macro_sql": "{% macro get_task_section_columns() %}\n\n{% set columns = [\n {\"name\": \"_fivetran_synced\", \"datatype\": dbt_utils.type_timestamp()},\n {\"name\": \"section_id\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"task_id\", \"datatype\": dbt_utils.type_string()}\n] %}\n\n{{ return(columns) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.type_timestamp", "macro.dbt_utils.type_string"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600953.099632}, "macro.asana_source.get_team_columns": {"unique_id": "macro.asana_source.get_team_columns", "package_name": "asana_source", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/asana_source", "path": "macros/get_team_columns.sql", "original_file_path": "macros/get_team_columns.sql", "name": "get_team_columns", "macro_sql": "{% macro get_team_columns() %}\n\n{% set columns = [\n {\"name\": \"_fivetran_deleted\", \"datatype\": \"boolean\"},\n {\"name\": \"_fivetran_synced\", \"datatype\": dbt_utils.type_timestamp()},\n {\"name\": \"id\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"name\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"organization_id\", \"datatype\": dbt_utils.type_string()}\n] %}\n\n{{ return(columns) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.type_timestamp", "macro.dbt_utils.type_string"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600953.10034}, "macro.asana_source.get_user_columns": {"unique_id": "macro.asana_source.get_user_columns", "package_name": "asana_source", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/asana_source", "path": "macros/get_user_columns.sql", "original_file_path": "macros/get_user_columns.sql", "name": "get_user_columns", "macro_sql": "{% macro get_user_columns() %}\n\n{% set columns = [\n {\"name\": \"_fivetran_deleted\", \"datatype\": \"boolean\"},\n {\"name\": \"_fivetran_synced\", \"datatype\": dbt_utils.type_timestamp()},\n {\"name\": \"email\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"id\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"name\", \"datatype\": dbt_utils.type_string()}\n] %}\n\n{{ return(columns) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.type_timestamp", "macro.dbt_utils.type_string"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600953.101047}, "macro.asana_source.get_project_columns": {"unique_id": "macro.asana_source.get_project_columns", "package_name": "asana_source", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/asana_source", "path": "macros/get_project_columns.sql", "original_file_path": "macros/get_project_columns.sql", "name": "get_project_columns", "macro_sql": "{% macro get_project_columns() %}\n\n{% set columns = [\n {\"name\": \"_fivetran_deleted\", \"datatype\": \"boolean\"},\n {\"name\": \"_fivetran_synced\", \"datatype\": dbt_utils.type_timestamp()},\n {\"name\": \"archived\", \"datatype\": \"boolean\"},\n {\"name\": \"color\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"created_at\", \"datatype\": dbt_utils.type_timestamp()},\n {\"name\": \"current_status\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"due_date\", \"datatype\": dbt_utils.type_timestamp()},\n {\"name\": \"id\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"modified_at\", \"datatype\": dbt_utils.type_timestamp()},\n {\"name\": \"name\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"notes\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"owner_id\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"public\", \"datatype\": \"boolean\"},\n {\"name\": \"team_id\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"workspace_id\", \"datatype\": dbt_utils.type_string()}\n] %}\n\n{{ return(columns) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.type_timestamp", "macro.dbt_utils.type_string"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600953.102696}, "macro.asana_source.get_task_follower_columns": {"unique_id": "macro.asana_source.get_task_follower_columns", "package_name": "asana_source", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/asana_source", "path": "macros/get_task_follower_columns.sql", "original_file_path": "macros/get_task_follower_columns.sql", "name": "get_task_follower_columns", "macro_sql": "{% macro get_task_follower_columns() %}\n\n{% set columns = [\n {\"name\": \"_fivetran_synced\", \"datatype\": dbt_utils.type_timestamp()},\n {\"name\": \"task_id\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"user_id\", \"datatype\": dbt_utils.type_string()}\n] %}\n\n{{ return(columns) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.type_timestamp", "macro.dbt_utils.type_string"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600953.1032379}, "macro.asana_source.get_section_columns": {"unique_id": "macro.asana_source.get_section_columns", "package_name": "asana_source", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/asana_source", "path": "macros/get_section_columns.sql", "original_file_path": "macros/get_section_columns.sql", "name": "get_section_columns", "macro_sql": "{% macro get_section_columns() %}\n\n{% set columns = [\n {\"name\": \"_fivetran_synced\", \"datatype\": dbt_utils.type_timestamp()},\n {\"name\": \"created_at\", \"datatype\": dbt_utils.type_timestamp()},\n {\"name\": \"id\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"name\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"project_id\", \"datatype\": dbt_utils.type_string()}\n] %}\n\n{{ return(columns) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.type_timestamp", "macro.dbt_utils.type_string"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600953.103956}, "macro.asana_source.get_project_task_columns": {"unique_id": "macro.asana_source.get_project_task_columns", "package_name": "asana_source", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/asana_source", "path": "macros/get_project_task_columns.sql", "original_file_path": "macros/get_project_task_columns.sql", "name": "get_project_task_columns", "macro_sql": "{% macro get_project_task_columns() %}\n\n{% set columns = [\n {\"name\": \"_fivetran_synced\", \"datatype\": dbt_utils.type_timestamp()},\n {\"name\": \"project_id\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"task_id\", \"datatype\": dbt_utils.type_string()}\n] %}\n\n{{ return(columns) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.type_timestamp", "macro.dbt_utils.type_string"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600953.104497}, "macro.asana_source.get_tag_columns": {"unique_id": "macro.asana_source.get_tag_columns", "package_name": "asana_source", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/asana_source", "path": "macros/get_tag_columns.sql", "original_file_path": "macros/get_tag_columns.sql", "name": "get_tag_columns", "macro_sql": "{% macro get_tag_columns() %}\n\n{% set columns = [\n {\"name\": \"_fivetran_deleted\", \"datatype\": \"boolean\"},\n {\"name\": \"_fivetran_synced\", \"datatype\": dbt_utils.type_timestamp()},\n {\"name\": \"color\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"created_at\", \"datatype\": dbt_utils.type_timestamp()},\n {\"name\": \"id\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"message\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"name\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"notes\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"workspace_id\", \"datatype\": dbt_utils.type_string()}\n] %}\n\n{{ return(columns) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.type_timestamp", "macro.dbt_utils.type_string"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600953.105591}, "macro.dbt_date.get_date_dimension": {"unique_id": "macro.dbt_date.get_date_dimension", "package_name": "dbt_date", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/dbt_date", "path": "macros/get_date_dimension.sql", "original_file_path": "macros/get_date_dimension.sql", "name": "get_date_dimension", "macro_sql": "{% macro get_date_dimension(start_date, end_date) %}\n {{ adapter.dispatch('get_date_dimension', 'dbt_date') (start_date, end_date) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_date.default__get_date_dimension"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600953.1133618}, "macro.dbt_date.default__get_date_dimension": {"unique_id": "macro.dbt_date.default__get_date_dimension", "package_name": "dbt_date", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/dbt_date", "path": "macros/get_date_dimension.sql", "original_file_path": "macros/get_date_dimension.sql", "name": "default__get_date_dimension", "macro_sql": "{% macro default__get_date_dimension(start_date, end_date) %}\nwith base_dates as (\n {{ dbt_date.get_base_dates(start_date, end_date) }}\n),\ndates_with_prior_year_dates as (\n\n select\n cast(d.date_day as date) as date_day,\n cast({{ dbt_utils.dateadd('year', -1 , 'd.date_day') }} as date) as prior_year_date_day,\n cast({{ dbt_utils.dateadd('day', -364 , 'd.date_day') }} as date) as prior_year_over_year_date_day\n from\n \tbase_dates d\n\n)\nselect\n d.date_day,\n {{ dbt_date.yesterday('d.date_day') }} as prior_date_day,\n {{ dbt_date.tomorrow('d.date_day') }} as next_date_day,\n d.prior_year_date_day as prior_year_date_day,\n d.prior_year_over_year_date_day,\n {{ dbt_date.day_of_week('d.date_day', isoweek=false) }} as day_of_week,\n {{ dbt_date.day_of_week('d.date_day', isoweek=true) }} as day_of_week_iso,\n {{ dbt_date.day_name('d.date_day', short=false) }} as day_of_week_name,\n {{ dbt_date.day_name('d.date_day', short=true) }} as day_of_week_name_short,\n {{ dbt_date.day_of_month('d.date_day') }} as day_of_month,\n {{ dbt_date.day_of_year('d.date_day') }} as day_of_year,\n\n {{ dbt_date.week_start('d.date_day') }} as week_start_date,\n {{ dbt_date.week_end('d.date_day') }} as week_end_date,\n {{ dbt_date.week_start('d.prior_year_over_year_date_day') }} as prior_year_week_start_date,\n {{ dbt_date.week_end('d.prior_year_over_year_date_day') }} as prior_year_week_end_date,\n {{ dbt_date.week_of_year('d.date_day') }} as week_of_year,\n\n {{ dbt_date.iso_week_start('d.date_day') }} as iso_week_start_date,\n {{ dbt_date.iso_week_end('d.date_day') }} as iso_week_end_date,\n {{ dbt_date.iso_week_start('d.prior_year_over_year_date_day') }} as prior_year_iso_week_start_date,\n {{ dbt_date.iso_week_end('d.prior_year_over_year_date_day') }} as prior_year_iso_week_end_date,\n {{ dbt_date.iso_week_of_year('d.date_day') }} as iso_week_of_year,\n\n {{ dbt_date.week_of_year('d.prior_year_over_year_date_day') }} as prior_year_week_of_year,\n {{ dbt_date.iso_week_of_year('d.prior_year_over_year_date_day') }} as prior_year_iso_week_of_year,\n\n cast({{ dbt_date.date_part('month', 'd.date_day') }} as {{ dbt_utils.type_int() }}) as month_of_year,\n {{ dbt_date.month_name('d.date_day', short=false) }} as month_name,\n {{ dbt_date.month_name('d.date_day', short=true) }} as month_name_short,\n\n cast({{ dbt_utils.date_trunc('month', 'd.date_day') }} as date) as month_start_date,\n cast({{ dbt_utils.last_day('d.date_day', 'month') }} as date) as month_end_date,\n\n cast({{ dbt_utils.date_trunc('month', 'd.prior_year_date_day') }} as date) as prior_year_month_start_date,\n cast({{ dbt_utils.last_day('d.prior_year_date_day', 'month') }} as date) as prior_year_month_end_date,\n\n cast({{ dbt_date.date_part('quarter', 'd.date_day') }} as {{ dbt_utils.type_int() }}) as quarter_of_year,\n cast({{ dbt_utils.date_trunc('quarter', 'd.date_day') }} as date) as quarter_start_date,\n cast({{ dbt_utils.last_day('d.date_day', 'quarter') }} as date) as quarter_end_date,\n\n cast({{ dbt_date.date_part('year', 'd.date_day') }} as {{ dbt_utils.type_int() }}) as year_number,\n cast({{ dbt_utils.date_trunc('year', 'd.date_day') }} as date) as year_start_date,\n cast({{ dbt_utils.last_day('d.date_day', 'year') }} as date) as year_end_date\nfrom\n dates_with_prior_year_dates d\norder by 1\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_date.get_base_dates", "macro.dbt_utils.dateadd", "macro.dbt_date.yesterday", "macro.dbt_date.tomorrow", "macro.dbt_date.day_of_week", "macro.dbt_date.day_name", "macro.dbt_date.day_of_month", "macro.dbt_date.day_of_year", "macro.dbt_date.week_start", "macro.dbt_date.week_end", "macro.dbt_date.week_of_year", "macro.dbt_date.iso_week_start", "macro.dbt_date.iso_week_end", "macro.dbt_date.iso_week_of_year", "macro.dbt_date.date_part", "macro.dbt_utils.type_int", "macro.dbt_date.month_name", "macro.dbt_utils.date_trunc", "macro.dbt_utils.last_day"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600953.115648}, "macro.dbt_date.postgres__get_date_dimension": {"unique_id": "macro.dbt_date.postgres__get_date_dimension", "package_name": "dbt_date", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/dbt_date", "path": "macros/get_date_dimension.sql", "original_file_path": "macros/get_date_dimension.sql", "name": "postgres__get_date_dimension", "macro_sql": "{% macro postgres__get_date_dimension(start_date, end_date) %}\nwith base_dates as (\n {{ dbt_date.get_base_dates(start_date, end_date) }}\n),\ndates_with_prior_year_dates as (\n\n select\n cast(d.date_day as date) as date_day,\n cast({{ dbt_utils.dateadd('year', -1 , 'd.date_day') }} as date) as prior_year_date_day,\n cast({{ dbt_utils.dateadd('day', -364 , 'd.date_day') }} as date) as prior_year_over_year_date_day\n from\n \tbase_dates d\n\n)\nselect\n d.date_day,\n {{ dbt_date.yesterday('d.date_day') }} as prior_date_day,\n {{ dbt_date.tomorrow('d.date_day') }} as next_date_day,\n d.prior_year_date_day as prior_year_date_day,\n d.prior_year_over_year_date_day,\n {{ dbt_date.day_of_week('d.date_day', isoweek=true) }} as day_of_week,\n\n {{ dbt_date.day_name('d.date_day', short=false) }} as day_of_week_name,\n {{ dbt_date.day_name('d.date_day', short=true) }} as day_of_week_name_short,\n {{ dbt_date.day_of_month('d.date_day') }} as day_of_month,\n {{ dbt_date.day_of_year('d.date_day') }} as day_of_year,\n\n {{ dbt_date.week_start('d.date_day') }} as week_start_date,\n {{ dbt_date.week_end('d.date_day') }} as week_end_date,\n {{ dbt_date.week_start('d.prior_year_over_year_date_day') }} as prior_year_week_start_date,\n {{ dbt_date.week_end('d.prior_year_over_year_date_day') }} as prior_year_week_end_date,\n {{ dbt_date.week_of_year('d.date_day') }} as week_of_year,\n\n {{ dbt_date.iso_week_start('d.date_day') }} as iso_week_start_date,\n {{ dbt_date.iso_week_end('d.date_day') }} as iso_week_end_date,\n {{ dbt_date.iso_week_start('d.prior_year_over_year_date_day') }} as prior_year_iso_week_start_date,\n {{ dbt_date.iso_week_end('d.prior_year_over_year_date_day') }} as prior_year_iso_week_end_date,\n {{ dbt_date.iso_week_of_year('d.date_day') }} as iso_week_of_year,\n\n {{ dbt_date.week_of_year('d.prior_year_over_year_date_day') }} as prior_year_week_of_year,\n {{ dbt_date.iso_week_of_year('d.prior_year_over_year_date_day') }} as prior_year_iso_week_of_year,\n\n cast({{ dbt_date.date_part('month', 'd.date_day') }} as {{ dbt_utils.type_int() }}) as month_of_year,\n {{ dbt_date.month_name('d.date_day', short=false) }} as month_name,\n {{ dbt_date.month_name('d.date_day', short=true) }} as month_name_short,\n\n cast({{ dbt_utils.date_trunc('month', 'd.date_day') }} as date) as month_start_date,\n cast({{ dbt_utils.last_day('d.date_day', 'month') }} as date) as month_end_date,\n\n cast({{ dbt_utils.date_trunc('month', 'd.prior_year_date_day') }} as date) as prior_year_month_start_date,\n cast({{ dbt_utils.last_day('d.prior_year_date_day', 'month') }} as date) as prior_year_month_end_date,\n\n cast({{ dbt_date.date_part('quarter', 'd.date_day') }} as {{ dbt_utils.type_int() }}) as quarter_of_year,\n cast({{ dbt_utils.date_trunc('quarter', 'd.date_day') }} as date) as quarter_start_date,\n {# dbt_utils.last_day does not support quarter because postgresql does not support quarter interval. #}\n cast({{dbt_utils.dateadd('day', '-1', dbt_utils.dateadd('month', '3', dbt_utils.date_trunc('quarter', 'd.date_day')))}} as date) as quarter_end_date,\n\n cast({{ dbt_date.date_part('year', 'd.date_day') }} as {{ dbt_utils.type_int() }}) as year_number,\n cast({{ dbt_utils.date_trunc('year', 'd.date_day') }} as date) as year_start_date,\n cast({{ dbt_utils.last_day('d.date_day', 'year') }} as date) as year_end_date\nfrom\n dates_with_prior_year_dates d\norder by 1\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_date.get_base_dates", "macro.dbt_utils.dateadd", "macro.dbt_date.yesterday", "macro.dbt_date.tomorrow", "macro.dbt_date.day_of_week", "macro.dbt_date.day_name", "macro.dbt_date.day_of_month", "macro.dbt_date.day_of_year", "macro.dbt_date.week_start", "macro.dbt_date.week_end", "macro.dbt_date.week_of_year", "macro.dbt_date.iso_week_start", "macro.dbt_date.iso_week_end", "macro.dbt_date.iso_week_of_year", "macro.dbt_date.date_part", "macro.dbt_utils.type_int", "macro.dbt_date.month_name", "macro.dbt_utils.date_trunc", "macro.dbt_utils.last_day"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600953.1179469}, "macro.dbt_date.get_base_dates": {"unique_id": "macro.dbt_date.get_base_dates", "package_name": "dbt_date", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/dbt_date", "path": "macros/get_base_dates.sql", "original_file_path": "macros/get_base_dates.sql", "name": "get_base_dates", "macro_sql": "{% macro get_base_dates(start_date=None, end_date=None, n_dateparts=None, datepart=\"day\") %}\n {{ adapter.dispatch('get_base_dates', 'dbt_date') (start_date, end_date, n_dateparts, datepart) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_date.bigquery__get_base_dates"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600953.118943}, "macro.dbt_date.default__get_base_dates": {"unique_id": "macro.dbt_date.default__get_base_dates", "package_name": "dbt_date", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/dbt_date", "path": "macros/get_base_dates.sql", "original_file_path": "macros/get_base_dates.sql", "name": "default__get_base_dates", "macro_sql": "{% macro default__get_base_dates(start_date, end_date, n_dateparts, datepart) %}\n\n{%- if start_date and end_date -%}\n{%- set start_date=\"cast('\" ~ start_date ~ \"' as \" ~ dbt_utils.type_timestamp() ~ \")\" -%}\n{%- set end_date=\"cast('\" ~ end_date ~ \"' as \" ~ dbt_utils.type_timestamp() ~ \")\" -%}\n\n{%- elif n_dateparts and datepart -%}\n\n{%- set start_date = dbt_utils.dateadd(datepart, -1 * n_dateparts, dbt_date.today()) -%}\n{%- set end_date = dbt_date.tomorrow() -%}\n{%- endif -%}\n\nwith date_spine as\n(\n\n {{ dbt_utils.date_spine(\n datepart=datepart,\n start_date=start_date,\n end_date=end_date,\n )\n }}\n\n)\nselect\n cast(d.date_{{ datepart }} as {{ dbt_utils.type_timestamp() }}) as date_{{ datepart }}\nfrom\n date_spine d\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.type_timestamp", "macro.dbt_utils.dateadd", "macro.dbt_date.today", "macro.dbt_date.tomorrow", "macro.dbt_utils.date_spine"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600953.119672}, "macro.dbt_date.bigquery__get_base_dates": {"unique_id": "macro.dbt_date.bigquery__get_base_dates", "package_name": "dbt_date", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/dbt_date", "path": "macros/get_base_dates.sql", "original_file_path": "macros/get_base_dates.sql", "name": "bigquery__get_base_dates", "macro_sql": "{% macro bigquery__get_base_dates(start_date, end_date, n_dateparts, datepart) %}\n\n{%- if start_date and end_date -%}\n{%- set start_date=\"cast('\" ~ start_date ~ \"' as date )\" -%}\n{%- set end_date=\"cast('\" ~ end_date ~ \"' as date )\" -%}\n\n{%- elif n_dateparts and datepart -%}\n\n{%- set start_date = dbt_utils.dateadd(datepart, -1 * n_dateparts, dbt_date.today()) -%}\n{%- set end_date = dbt_date.tomorrow() -%}\n{%- endif -%}\n\nwith date_spine as\n(\n\n {{ dbt_utils.date_spine(\n datepart=datepart,\n start_date=start_date,\n end_date=end_date,\n )\n }}\n\n)\nselect\n cast(d.date_{{ datepart }} as {{ dbt_utils.type_timestamp() }}) as date_{{ datepart }}\nfrom\n date_spine d\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.dateadd", "macro.dbt_date.today", "macro.dbt_date.tomorrow", "macro.dbt_utils.date_spine", "macro.dbt_utils.type_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600953.1203341}, "macro.dbt_date.get_fiscal_year_dates": {"unique_id": "macro.dbt_date.get_fiscal_year_dates", "package_name": "dbt_date", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/dbt_date", "path": "macros/fiscal_date/get_fiscal_year_dates.sql", "original_file_path": "macros/fiscal_date/get_fiscal_year_dates.sql", "name": "get_fiscal_year_dates", "macro_sql": "{% macro get_fiscal_year_dates(dates, year_end_month=12, week_start_day=1, shift_year=1) %}\n{{ adapter.dispatch('get_fiscal_year_dates', 'dbt_date') (dates, year_end_month, week_start_day, shift_year) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_date.default__get_fiscal_year_dates"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600953.121967}, "macro.dbt_date.default__get_fiscal_year_dates": {"unique_id": "macro.dbt_date.default__get_fiscal_year_dates", "package_name": "dbt_date", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/dbt_date", "path": "macros/fiscal_date/get_fiscal_year_dates.sql", "original_file_path": "macros/fiscal_date/get_fiscal_year_dates.sql", "name": "default__get_fiscal_year_dates", "macro_sql": "{% macro default__get_fiscal_year_dates(dates, year_end_month, week_start_day, shift_year) %}\n-- this gets all the dates within a fiscal year\n-- determined by the given year-end-month\n-- ending on the saturday closest to that month's end date\nwith date_dimension as (\n select * from {{ dates }}\n),\nyear_month_end as (\n\n select\n d.year_number - {{ shift_year }} as fiscal_year_number,\n d.month_end_date\n from\n date_dimension d\n where\n d.month_of_year = {{ year_end_month }}\n group by 1,2\n\n),\nweeks as (\n\n select\n d.year_number,\n d.month_of_year,\n d.date_day as week_start_date,\n cast({{ dbt_utils.dateadd('day', 6, 'd.date_day') }} as date) as week_end_date\n from\n date_dimension d\n where\n d.day_of_week = {{ week_start_day }}\n\n),\n-- get all the weeks that start in the month the year ends\nyear_week_ends as (\n\n select\n d.year_number - {{ shift_year }} as fiscal_year_number,\n d.week_end_date\n from\n weeks d\n where\n d.month_of_year = {{ year_end_month }}\n group by\n 1,2\n\n),\n-- then calculate which Saturday is closest to month end\nweeks_at_month_end as (\n\n select\n d.fiscal_year_number,\n d.week_end_date,\n m.month_end_date,\n rank() over\n (partition by d.fiscal_year_number\n order by\n abs({{ dbt_utils.datediff('d.week_end_date', 'm.month_end_date', 'day') }})\n\n ) as closest_to_month_end\n from\n year_week_ends d\n join\n year_month_end m on d.fiscal_year_number = m.fiscal_year_number\n),\nfiscal_year_range as (\n\n select\n w.fiscal_year_number,\n cast(\n {{ dbt_utils.dateadd('day', 1,\n 'lag(w.week_end_date) over(order by w.week_end_date)') }}\n as date) as fiscal_year_start_date,\n w.week_end_date as fiscal_year_end_date\n from\n weeks_at_month_end w\n where\n w.closest_to_month_end = 1\n\n),\nfiscal_year_dates as (\n\n select\n d.date_day,\n m.fiscal_year_number,\n m.fiscal_year_start_date,\n m.fiscal_year_end_date,\n w.week_start_date,\n w.week_end_date,\n -- we reset the weeks of the year starting with the merch year start date\n dense_rank()\n over(\n partition by m.fiscal_year_number\n order by w.week_start_date\n ) as fiscal_week_of_year\n from\n date_dimension d\n join\n fiscal_year_range m on d.date_day between m.fiscal_year_start_date and m.fiscal_year_end_date\n join\n weeks w on d.date_day between w.week_start_date and w.week_end_date\n\n)\nselect * from fiscal_year_dates order by 1\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.dateadd", "macro.dbt_utils.datediff"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600953.1225212}, "macro.dbt_date.get_fiscal_periods": {"unique_id": "macro.dbt_date.get_fiscal_periods", "package_name": "dbt_date", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/dbt_date", "path": "macros/fiscal_date/get_fiscal_periods.sql", "original_file_path": "macros/fiscal_date/get_fiscal_periods.sql", "name": "get_fiscal_periods", "macro_sql": "{% macro get_fiscal_periods(dates, year_end_month, week_start_day, shift_year=1) %}\n{# \nThis macro requires you to pass in a ref to a date dimension, created via\ndbt_date.get_date_dimension()s\n#}\nwith fscl_year_dates_for_periods as (\n {{ dbt_date.get_fiscal_year_dates(dates, year_end_month, week_start_day, shift_year) }}\n),\nfscl_year_w13 as (\n\n select\n f.*,\n -- We count the weeks in a 13 week period\n -- and separate the 4-5-4 week sequences\n mod(cast(\n (f.fiscal_week_of_year-1) as {{ dbt_utils.type_int() }}\n ), 13) as w13_number,\n -- Chop weeks into 13 week merch quarters\n cast(\n least(\n floor((f.fiscal_week_of_year-1)/13.0)\n , 3)\n as {{ dbt_utils.type_int() }}) as quarter_number\n from\n fscl_year_dates_for_periods f\n\n),\nfscl_periods as (\n\n select\n f.date_day,\n f.fiscal_year_number,\n f.week_start_date,\n f.week_end_date,\n f.fiscal_week_of_year,\n case \n -- we move week 53 into the 3rd period of the quarter\n when f.fiscal_week_of_year = 53 then 3\n when f.w13_number between 0 and 3 then 1\n when f.w13_number between 4 and 8 then 2\n when f.w13_number between 9 and 12 then 3\n end as period_of_quarter,\n f.quarter_number\n from\n fscl_year_w13 f\n\n),\nfscl_periods_quarters as (\n\n select\n f.*,\n cast((\n (f.quarter_number * 3) + f.period_of_quarter\n ) as {{ dbt_utils.type_int() }}) as fiscal_period_number\n from\n fscl_periods f\n\n)\nselect\n date_day,\n fiscal_year_number,\n week_start_date,\n week_end_date,\n fiscal_week_of_year, \n dense_rank() over(partition by fiscal_period_number order by fiscal_week_of_year) as fiscal_week_of_period,\n fiscal_period_number,\n quarter_number+1 as fiscal_quarter_number,\n period_of_quarter as fiscal_period_of_quarter\nfrom \n fscl_periods_quarters \norder by 1,2\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_date.get_fiscal_year_dates", "macro.dbt_utils.type_int"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600953.1234372}, "macro.dbt_date.tomorrow": {"unique_id": "macro.dbt_date.tomorrow", "package_name": "dbt_date", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/dbt_date", "path": "macros/calendar_date/tomorrow.sql", "original_file_path": "macros/calendar_date/tomorrow.sql", "name": "tomorrow", "macro_sql": "{%- macro tomorrow(date=None, tz=None) -%}\n{{ dbt_date.n_days_away(1, date, tz) }}\n{%- endmacro -%}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_date.n_days_away"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600953.123716}, "macro.dbt_date.next_week": {"unique_id": "macro.dbt_date.next_week", "package_name": "dbt_date", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/dbt_date", "path": "macros/calendar_date/next_week.sql", "original_file_path": "macros/calendar_date/next_week.sql", "name": "next_week", "macro_sql": "{%- macro next_week(tz=None) -%}\n{{ dbt_date.n_weeks_away(1, tz) }}\n{%- endmacro -%}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_date.n_weeks_away"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600953.1239538}, "macro.dbt_date.next_month_name": {"unique_id": "macro.dbt_date.next_month_name", "package_name": "dbt_date", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/dbt_date", "path": "macros/calendar_date/next_month_name.sql", "original_file_path": "macros/calendar_date/next_month_name.sql", "name": "next_month_name", "macro_sql": "{%- macro next_month_name(short=True, tz=None) -%}\n{{ dbt_date.month_name(dbt_date.next_month(1, tz), short=short) }}\n{%- endmacro -%}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_date.month_name", "macro.dbt_date.next_month"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600953.12427}, "macro.dbt_date.next_month": {"unique_id": "macro.dbt_date.next_month", "package_name": "dbt_date", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/dbt_date", "path": "macros/calendar_date/next_month.sql", "original_file_path": "macros/calendar_date/next_month.sql", "name": "next_month", "macro_sql": "{%- macro next_month(tz=None) -%}\n{{ dbt_date.n_months_away(1, tz) }}\n{%- endmacro -%}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_date.n_months_away"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600953.12451}, "macro.dbt_date.day_name": {"unique_id": "macro.dbt_date.day_name", "package_name": "dbt_date", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/dbt_date", "path": "macros/calendar_date/day_name.sql", "original_file_path": "macros/calendar_date/day_name.sql", "name": "day_name", "macro_sql": "{%- macro day_name(date, short=True) -%}\n {{ adapter.dispatch('day_name', 'dbt_date') (date, short) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_date.bigquery__day_name"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600953.1251452}, "macro.dbt_date.default__day_name": {"unique_id": "macro.dbt_date.default__day_name", "package_name": "dbt_date", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/dbt_date", "path": "macros/calendar_date/day_name.sql", "original_file_path": "macros/calendar_date/day_name.sql", "name": "default__day_name", "macro_sql": "\n\n{%- macro default__day_name(date, short) -%}\n{%- set f = 'Dy' if short else 'Day' -%}\n to_char({{ date }}, '{{ f }}')\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600953.125342}, "macro.dbt_date.snowflake__day_name": {"unique_id": "macro.dbt_date.snowflake__day_name", "package_name": "dbt_date", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/dbt_date", "path": "macros/calendar_date/day_name.sql", "original_file_path": "macros/calendar_date/day_name.sql", "name": "snowflake__day_name", "macro_sql": "\n\n{%- macro snowflake__day_name(date, short) -%}\n {%- if short -%}\n dayname({{ date }})\n {%- else -%}\n -- long version not implemented on Snowflake so we're doing it manually :/\n case dayname({{ date }})\n when 'Mon' then 'Monday'\n when 'Tue' then 'Tuesday'\n when 'Wed' then 'Wednesday'\n when 'Thu' then 'Thursday'\n when 'Fri' then 'Friday'\n when 'Sat' then 'Saturday'\n when 'Sun' then 'Sunday'\n end\n {%- endif -%}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600953.125539}, "macro.dbt_date.bigquery__day_name": {"unique_id": "macro.dbt_date.bigquery__day_name", "package_name": "dbt_date", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/dbt_date", "path": "macros/calendar_date/day_name.sql", "original_file_path": "macros/calendar_date/day_name.sql", "name": "bigquery__day_name", "macro_sql": "\n\n{%- macro bigquery__day_name(date, short) -%}\n{%- set f = '%a' if short else '%A' -%}\n format_date('{{ f }}', cast({{ date }} as date))\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600953.1257331}, "macro.dbt_date.postgres__day_name": {"unique_id": "macro.dbt_date.postgres__day_name", "package_name": "dbt_date", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/dbt_date", "path": "macros/calendar_date/day_name.sql", "original_file_path": "macros/calendar_date/day_name.sql", "name": "postgres__day_name", "macro_sql": "\n\n{%- macro postgres__day_name(date, short) -%}\n{# FM = Fill mode, which suppresses padding blanks #}\n{%- set f = 'FMDy' if short else 'FMDay' -%}\n to_char({{ date }}, '{{ f }}')\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600953.125928}, "macro.dbt_date.to_unixtimestamp": {"unique_id": "macro.dbt_date.to_unixtimestamp", "package_name": "dbt_date", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/dbt_date", "path": "macros/calendar_date/to_unixtimestamp.sql", "original_file_path": "macros/calendar_date/to_unixtimestamp.sql", "name": "to_unixtimestamp", "macro_sql": "{%- macro to_unixtimestamp(timestamp) -%}\n {{ adapter.dispatch('to_unixtimestamp', 'dbt_date') (timestamp) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_date.bigquery__to_unixtimestamp"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600953.1262798}, "macro.dbt_date.default__to_unixtimestamp": {"unique_id": "macro.dbt_date.default__to_unixtimestamp", "package_name": "dbt_date", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/dbt_date", "path": "macros/calendar_date/to_unixtimestamp.sql", "original_file_path": "macros/calendar_date/to_unixtimestamp.sql", "name": "default__to_unixtimestamp", "macro_sql": "\n\n{%- macro default__to_unixtimestamp(timestamp) -%}\n {{ dbt_date.date_part('epoch', timestamp) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_date.date_part"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600953.126415}, "macro.dbt_date.snowflake__to_unixtimestamp": {"unique_id": "macro.dbt_date.snowflake__to_unixtimestamp", "package_name": "dbt_date", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/dbt_date", "path": "macros/calendar_date/to_unixtimestamp.sql", "original_file_path": "macros/calendar_date/to_unixtimestamp.sql", "name": "snowflake__to_unixtimestamp", "macro_sql": "\n\n{%- macro snowflake__to_unixtimestamp(timestamp) -%}\n {{ dbt_date.date_part('epoch_seconds', timestamp) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_date.date_part"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600953.126548}, "macro.dbt_date.bigquery__to_unixtimestamp": {"unique_id": "macro.dbt_date.bigquery__to_unixtimestamp", "package_name": "dbt_date", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/dbt_date", "path": "macros/calendar_date/to_unixtimestamp.sql", "original_file_path": "macros/calendar_date/to_unixtimestamp.sql", "name": "bigquery__to_unixtimestamp", "macro_sql": "\n\n{%- macro bigquery__to_unixtimestamp(timestamp) -%}\n unix_seconds({{ timestamp }})\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600953.126645}, "macro.dbt_date.n_days_away": {"unique_id": "macro.dbt_date.n_days_away", "package_name": "dbt_date", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/dbt_date", "path": "macros/calendar_date/n_days_away.sql", "original_file_path": "macros/calendar_date/n_days_away.sql", "name": "n_days_away", "macro_sql": "{%- macro n_days_away(n, date=None, tz=None) -%}\n{{ dbt_date.n_days_ago(-1 * n, date, tz) }}\n{%- endmacro -%}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_date.n_days_ago"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600953.1270049}, "macro.dbt_date.week_start": {"unique_id": "macro.dbt_date.week_start", "package_name": "dbt_date", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/dbt_date", "path": "macros/calendar_date/week_start.sql", "original_file_path": "macros/calendar_date/week_start.sql", "name": "week_start", "macro_sql": "{%- macro week_start(date=None, tz=None) -%}\n{%-set dt = date if date else dbt_date.today(tz) -%}\n{{ adapter.dispatch('week_start', 'dbt_date') (dt) }}\n{%- endmacro -%}\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_date.today", "macro.dbt_date.default__week_start"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600953.1275232}, "macro.dbt_date.default__week_start": {"unique_id": "macro.dbt_date.default__week_start", "package_name": "dbt_date", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/dbt_date", "path": "macros/calendar_date/week_start.sql", "original_file_path": "macros/calendar_date/week_start.sql", "name": "default__week_start", "macro_sql": "{%- macro default__week_start(date) -%}\ncast({{ dbt_utils.date_trunc('week', date) }} as date)\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.date_trunc"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600953.127666}, "macro.dbt_date.snowflake__week_start": {"unique_id": "macro.dbt_date.snowflake__week_start", "package_name": "dbt_date", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/dbt_date", "path": "macros/calendar_date/week_start.sql", "original_file_path": "macros/calendar_date/week_start.sql", "name": "snowflake__week_start", "macro_sql": "\n\n{%- macro snowflake__week_start(date) -%}\n {#\n Get the day of week offset: e.g. if the date is a Sunday,\n dbt_date.day_of_week returns 1, so we subtract 1 to get a 0 offset\n #}\n {% set off_set = dbt_date.day_of_week(date, isoweek=False) ~ \" - 1\" %}\n cast({{ dbt_utils.dateadd(\"day\", \"-1 * (\" ~ off_set ~ \")\", date) }} as date)\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_date.day_of_week", "macro.dbt_utils.dateadd"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600953.127954}, "macro.dbt_date.postgres__week_start": {"unique_id": "macro.dbt_date.postgres__week_start", "package_name": "dbt_date", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/dbt_date", "path": "macros/calendar_date/week_start.sql", "original_file_path": "macros/calendar_date/week_start.sql", "name": "postgres__week_start", "macro_sql": "\n\n{%- macro postgres__week_start(date) -%}\n-- Sunday as week start date\ncast({{ dbt_utils.dateadd('day', -1, dbt_utils.date_trunc('week', dbt_utils.dateadd('day', 1, date))) }} as date)\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.dateadd", "macro.dbt_utils.date_trunc"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600953.128211}, "macro.dbt_date.iso_week_start": {"unique_id": "macro.dbt_date.iso_week_start", "package_name": "dbt_date", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/dbt_date", "path": "macros/calendar_date/iso_week_start.sql", "original_file_path": "macros/calendar_date/iso_week_start.sql", "name": "iso_week_start", "macro_sql": "{%- macro iso_week_start(date=None, tz=None) -%}\n{%-set dt = date if date else dbt_date.today(tz) -%}\n{{ adapter.dispatch('iso_week_start', 'dbt_date') (dt) }}\n{%- endmacro -%}\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_date.today", "macro.dbt_date.default__iso_week_start"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600953.1287382}, "macro.dbt_date._iso_week_start": {"unique_id": "macro.dbt_date._iso_week_start", "package_name": "dbt_date", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/dbt_date", "path": "macros/calendar_date/iso_week_start.sql", "original_file_path": "macros/calendar_date/iso_week_start.sql", "name": "_iso_week_start", "macro_sql": "{%- macro _iso_week_start(date, week_type) -%}\ncast({{ dbt_utils.date_trunc(week_type, date) }} as date)\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.date_trunc"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600953.128891}, "macro.dbt_date.default__iso_week_start": {"unique_id": "macro.dbt_date.default__iso_week_start", "package_name": "dbt_date", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/dbt_date", "path": "macros/calendar_date/iso_week_start.sql", "original_file_path": "macros/calendar_date/iso_week_start.sql", "name": "default__iso_week_start", "macro_sql": "\n\n{%- macro default__iso_week_start(date) -%}\n{{ dbt_date._iso_week_start(date, 'isoweek') }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_date._iso_week_start"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600953.1290271}, "macro.dbt_date.snowflake__iso_week_start": {"unique_id": "macro.dbt_date.snowflake__iso_week_start", "package_name": "dbt_date", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/dbt_date", "path": "macros/calendar_date/iso_week_start.sql", "original_file_path": "macros/calendar_date/iso_week_start.sql", "name": "snowflake__iso_week_start", "macro_sql": "\n\n{%- macro snowflake__iso_week_start(date) -%}\n{{ dbt_date._iso_week_start(date, 'week') }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_date._iso_week_start"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600953.129162}, "macro.dbt_date.postgres__iso_week_start": {"unique_id": "macro.dbt_date.postgres__iso_week_start", "package_name": "dbt_date", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/dbt_date", "path": "macros/calendar_date/iso_week_start.sql", "original_file_path": "macros/calendar_date/iso_week_start.sql", "name": "postgres__iso_week_start", "macro_sql": "\n\n{%- macro postgres__iso_week_start(date) -%}\n{{ dbt_date._iso_week_start(date, 'week') }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_date._iso_week_start"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600953.129293}, "macro.dbt_date.n_days_ago": {"unique_id": "macro.dbt_date.n_days_ago", "package_name": "dbt_date", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/dbt_date", "path": "macros/calendar_date/n_days_ago.sql", "original_file_path": "macros/calendar_date/n_days_ago.sql", "name": "n_days_ago", "macro_sql": "{%- macro n_days_ago(n, date=None, tz=None) -%}\n{%-set dt = date if date else dbt_date.today(tz) -%}\n{%- set n = n|int -%}\ncast({{ dbt_utils.dateadd('day', -1 * n, dt) }} as date)\n{%- endmacro -%}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_date.today", "macro.dbt_utils.dateadd"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600953.129756}, "macro.dbt_date.last_week": {"unique_id": "macro.dbt_date.last_week", "package_name": "dbt_date", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/dbt_date", "path": "macros/calendar_date/last_week.sql", "original_file_path": "macros/calendar_date/last_week.sql", "name": "last_week", "macro_sql": "{%- macro last_week(tz=None) -%}\n{{ dbt_date.n_weeks_ago(1, tz) }}\n{%- endmacro -%}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_date.n_weeks_ago"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600953.129997}, "macro.dbt_date.now": {"unique_id": "macro.dbt_date.now", "package_name": "dbt_date", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/dbt_date", "path": "macros/calendar_date/now.sql", "original_file_path": "macros/calendar_date/now.sql", "name": "now", "macro_sql": "{%- macro now(tz=None) -%}\n{{ dbt_date.convert_timezone(dbt_utils.current_timestamp(), tz) }}\n{%- endmacro -%}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_date.convert_timezone", "macro.dbt_utils.current_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600953.130251}, "macro.dbt_date.periods_since": {"unique_id": "macro.dbt_date.periods_since", "package_name": "dbt_date", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/dbt_date", "path": "macros/calendar_date/periods_since.sql", "original_file_path": "macros/calendar_date/periods_since.sql", "name": "periods_since", "macro_sql": "{%- macro periods_since(date_col, period_name='day', tz=None) -%}\n{{ dbt_utils.datediff(date_col, dbt_date.now(tz), period_name) }}\n{%- endmacro -%}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.datediff", "macro.dbt_date.now"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600953.1305668}, "macro.dbt_date.today": {"unique_id": "macro.dbt_date.today", "package_name": "dbt_date", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/dbt_date", "path": "macros/calendar_date/today.sql", "original_file_path": "macros/calendar_date/today.sql", "name": "today", "macro_sql": "{%- macro today(tz=None) -%}\ncast({{ dbt_date.now(tz) }} as date)\n{%- endmacro -%}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_date.now"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600953.130799}, "macro.dbt_date.last_month": {"unique_id": "macro.dbt_date.last_month", "package_name": "dbt_date", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/dbt_date", "path": "macros/calendar_date/last_month.sql", "original_file_path": "macros/calendar_date/last_month.sql", "name": "last_month", "macro_sql": "{%- macro last_month(tz=None) -%}\n{{ dbt_date.n_months_ago(1, tz) }}\n{%- endmacro -%}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_date.n_months_ago"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600953.131032}, "macro.dbt_date.day_of_year": {"unique_id": "macro.dbt_date.day_of_year", "package_name": "dbt_date", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/dbt_date", "path": "macros/calendar_date/day_of_year.sql", "original_file_path": "macros/calendar_date/day_of_year.sql", "name": "day_of_year", "macro_sql": "{%- macro day_of_year(date) -%}\n{{ adapter.dispatch('day_of_year', 'dbt_date') (date) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_date.default__day_of_year"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600953.131393}, "macro.dbt_date.default__day_of_year": {"unique_id": "macro.dbt_date.default__day_of_year", "package_name": "dbt_date", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/dbt_date", "path": "macros/calendar_date/day_of_year.sql", "original_file_path": "macros/calendar_date/day_of_year.sql", "name": "default__day_of_year", "macro_sql": "\n\n{%- macro default__day_of_year(date) -%}\n {{ dbt_date.date_part('dayofyear', date) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_date.date_part"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600953.131525}, "macro.dbt_date.postgres__day_of_year": {"unique_id": "macro.dbt_date.postgres__day_of_year", "package_name": "dbt_date", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/dbt_date", "path": "macros/calendar_date/day_of_year.sql", "original_file_path": "macros/calendar_date/day_of_year.sql", "name": "postgres__day_of_year", "macro_sql": "\n\n{%- macro postgres__day_of_year(date) -%}\n {{ dbt_date.date_part('doy', date) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_date.date_part"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600953.131655}, "macro.dbt_date.redshift__day_of_year": {"unique_id": "macro.dbt_date.redshift__day_of_year", "package_name": "dbt_date", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/dbt_date", "path": "macros/calendar_date/day_of_year.sql", "original_file_path": "macros/calendar_date/day_of_year.sql", "name": "redshift__day_of_year", "macro_sql": "\n\n{%- macro redshift__day_of_year(date) -%}\n cast({{ dbt_date.date_part('dayofyear', date) }} as {{ dbt_utils.type_bigint() }})\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_date.date_part", "macro.dbt_utils.type_bigint"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600953.131828}, "macro.dbt_date.from_unixtimestamp": {"unique_id": "macro.dbt_date.from_unixtimestamp", "package_name": "dbt_date", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/dbt_date", "path": "macros/calendar_date/from_unixtimestamp.sql", "original_file_path": "macros/calendar_date/from_unixtimestamp.sql", "name": "from_unixtimestamp", "macro_sql": "{%- macro from_unixtimestamp(epochs, format=\"seconds\") -%}\n {{ adapter.dispatch('from_unixtimestamp', 'dbt_date') (epochs, format) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_date.bigquery__from_unixtimestamp"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600953.133046}, "macro.dbt_date.default__from_unixtimestamp": {"unique_id": "macro.dbt_date.default__from_unixtimestamp", "package_name": "dbt_date", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/dbt_date", "path": "macros/calendar_date/from_unixtimestamp.sql", "original_file_path": "macros/calendar_date/from_unixtimestamp.sql", "name": "default__from_unixtimestamp", "macro_sql": "\n\n{%- macro default__from_unixtimestamp(epochs, format=\"seconds\") -%}\n {%- if format != \"seconds\" -%}\n {{ exceptions.raise_compiler_error(\n \"value \" ~ format ~ \" for `format` for from_unixtimestamp is not supported.\"\n )\n }}\n {% endif -%}\n to_timestamp({{ epochs }})\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600953.133302}, "macro.dbt_date.postgres__from_unixtimestamp": {"unique_id": "macro.dbt_date.postgres__from_unixtimestamp", "package_name": "dbt_date", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/dbt_date", "path": "macros/calendar_date/from_unixtimestamp.sql", "original_file_path": "macros/calendar_date/from_unixtimestamp.sql", "name": "postgres__from_unixtimestamp", "macro_sql": "\n\n{%- macro postgres__from_unixtimestamp(epochs, format=\"seconds\") -%}\n {%- if format != \"seconds\" -%}\n {{ exceptions.raise_compiler_error(\n \"value \" ~ format ~ \" for `format` for from_unixtimestamp is not supported.\"\n )\n }}\n {% endif -%}\n cast(to_timestamp({{ epochs }}) at time zone 'UTC' as timestamp)\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600953.133555}, "macro.dbt_date.snowflake__from_unixtimestamp": {"unique_id": "macro.dbt_date.snowflake__from_unixtimestamp", "package_name": "dbt_date", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/dbt_date", "path": "macros/calendar_date/from_unixtimestamp.sql", "original_file_path": "macros/calendar_date/from_unixtimestamp.sql", "name": "snowflake__from_unixtimestamp", "macro_sql": "\n\n{%- macro snowflake__from_unixtimestamp(epochs, format) -%}\n {%- if format == \"seconds\" -%}\n {%- set scale = 0 -%}\n {%- elif format == \"milliseconds\" -%}\n {%- set scale = 3 -%}\n {%- elif format == \"microseconds\" -%}\n {%- set scale = 6 -%}\n {%- else -%}\n {{ exceptions.raise_compiler_error(\n \"value \" ~ format ~ \" for `format` for from_unixtimestamp is not supported.\"\n )\n }}\n {% endif -%}\n to_timestamp_ntz({{ epochs }}, {{ scale }})\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600953.134006}, "macro.dbt_date.bigquery__from_unixtimestamp": {"unique_id": "macro.dbt_date.bigquery__from_unixtimestamp", "package_name": "dbt_date", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/dbt_date", "path": "macros/calendar_date/from_unixtimestamp.sql", "original_file_path": "macros/calendar_date/from_unixtimestamp.sql", "name": "bigquery__from_unixtimestamp", "macro_sql": "\n\n{%- macro bigquery__from_unixtimestamp(epochs, format) -%}\n {%- if format == \"seconds\" -%}\n timestamp_seconds({{ epochs }})\n {%- elif format == \"milliseconds\" -%}\n timestamp_millis({{ epochs }})\n {%- elif format == \"microseconds\" -%}\n timestamp_micros({{ epochs }})\n {%- else -%}\n {{ exceptions.raise_compiler_error(\n \"value \" ~ format ~ \" for `format` for from_unixtimestamp is not supported.\"\n )\n }}\n {% endif -%}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600953.134389}, "macro.dbt_date.n_months_ago": {"unique_id": "macro.dbt_date.n_months_ago", "package_name": "dbt_date", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/dbt_date", "path": "macros/calendar_date/n_months_ago.sql", "original_file_path": "macros/calendar_date/n_months_ago.sql", "name": "n_months_ago", "macro_sql": "{%- macro n_months_ago(n, tz=None) -%}\n{%- set n = n|int -%}\n{{ dbt_utils.date_trunc('month', \n dbt_utils.dateadd('month', -1 * n, \n dbt_date.today(tz)\n )\n ) }}\n{%- endmacro -%}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.date_trunc", "macro.dbt_utils.dateadd", "macro.dbt_date.today"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600953.134814}, "macro.dbt_date.date_part": {"unique_id": "macro.dbt_date.date_part", "package_name": "dbt_date", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/dbt_date", "path": "macros/calendar_date/date_part.sql", "original_file_path": "macros/calendar_date/date_part.sql", "name": "date_part", "macro_sql": "{% macro date_part(datepart, date) -%}\n {{ adapter.dispatch('date_part', 'dbt_date') (datepart, date) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_date.bigquery__date_part"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600953.135162}, "macro.dbt_date.default__date_part": {"unique_id": "macro.dbt_date.default__date_part", "package_name": "dbt_date", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/dbt_date", "path": "macros/calendar_date/date_part.sql", "original_file_path": "macros/calendar_date/date_part.sql", "name": "default__date_part", "macro_sql": "{% macro default__date_part(datepart, date) -%}\n date_part('{{ datepart }}', {{ date }})\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600953.135294}, "macro.dbt_date.bigquery__date_part": {"unique_id": "macro.dbt_date.bigquery__date_part", "package_name": "dbt_date", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/dbt_date", "path": "macros/calendar_date/date_part.sql", "original_file_path": "macros/calendar_date/date_part.sql", "name": "bigquery__date_part", "macro_sql": "{% macro bigquery__date_part(datepart, date) -%}\n extract({{ datepart }} from {{ date }})\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600953.135422}, "macro.dbt_date.n_weeks_away": {"unique_id": "macro.dbt_date.n_weeks_away", "package_name": "dbt_date", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/dbt_date", "path": "macros/calendar_date/n_weeks_away.sql", "original_file_path": "macros/calendar_date/n_weeks_away.sql", "name": "n_weeks_away", "macro_sql": "{%- macro n_weeks_away(n, tz=None) -%}\n{%- set n = n|int -%}\n{{ dbt_utils.date_trunc('week', \n dbt_utils.dateadd('week', n, \n dbt_date.today(tz)\n )\n ) }}\n{%- endmacro -%}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.date_trunc", "macro.dbt_utils.dateadd", "macro.dbt_date.today"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600953.135825}, "macro.dbt_date.day_of_month": {"unique_id": "macro.dbt_date.day_of_month", "package_name": "dbt_date", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/dbt_date", "path": "macros/calendar_date/day_of_month.sql", "original_file_path": "macros/calendar_date/day_of_month.sql", "name": "day_of_month", "macro_sql": "{%- macro day_of_month(date) -%}\n{{ dbt_date.date_part('day', date) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_date.date_part"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600953.136092}, "macro.dbt_date.redshift__day_of_month": {"unique_id": "macro.dbt_date.redshift__day_of_month", "package_name": "dbt_date", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/dbt_date", "path": "macros/calendar_date/day_of_month.sql", "original_file_path": "macros/calendar_date/day_of_month.sql", "name": "redshift__day_of_month", "macro_sql": "\n\n{%- macro redshift__day_of_month(date) -%}\ncast({{ dbt_date.date_part('day', date) }} as {{ dbt_utils.type_bigint() }})\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_date.date_part", "macro.dbt_utils.type_bigint"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600953.136269}, "macro.dbt_date.yesterday": {"unique_id": "macro.dbt_date.yesterday", "package_name": "dbt_date", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/dbt_date", "path": "macros/calendar_date/yesterday.sql", "original_file_path": "macros/calendar_date/yesterday.sql", "name": "yesterday", "macro_sql": "{%- macro yesterday(date=None, tz=None) -%}\n{{ dbt_date.n_days_ago(1, date, tz) }}\n{%- endmacro -%}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_date.n_days_ago"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600953.1365418}, "macro.dbt_date.day_of_week": {"unique_id": "macro.dbt_date.day_of_week", "package_name": "dbt_date", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/dbt_date", "path": "macros/calendar_date/day_of_week.sql", "original_file_path": "macros/calendar_date/day_of_week.sql", "name": "day_of_week", "macro_sql": "{%- macro day_of_week(date, isoweek=true) -%}\n{{ adapter.dispatch('day_of_week', 'dbt_date') (date, isoweek) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_date.bigquery__day_of_week"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600953.138171}, "macro.dbt_date.default__day_of_week": {"unique_id": "macro.dbt_date.default__day_of_week", "package_name": "dbt_date", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/dbt_date", "path": "macros/calendar_date/day_of_week.sql", "original_file_path": "macros/calendar_date/day_of_week.sql", "name": "default__day_of_week", "macro_sql": "\n\n{%- macro default__day_of_week(date, isoweek) -%}\n\n {%- set dow = dbt_date.date_part('dayofweek', date) -%}\n\n {%- if isoweek -%}\n case\n -- Shift start of week from Sunday (0) to Monday (1)\n when {{ dow }} = 0 then 7\n else {{ dow }}\n end\n {%- else -%}\n {{ dow }} + 1\n {%- endif -%}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_date.date_part"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600953.138453}, "macro.dbt_date.snowflake__day_of_week": {"unique_id": "macro.dbt_date.snowflake__day_of_week", "package_name": "dbt_date", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/dbt_date", "path": "macros/calendar_date/day_of_week.sql", "original_file_path": "macros/calendar_date/day_of_week.sql", "name": "snowflake__day_of_week", "macro_sql": "\n\n{%- macro snowflake__day_of_week(date, isoweek) -%}\n\n {%- if isoweek -%}\n {%- set dow_part = 'dayofweekiso' -%}\n {{ dbt_date.date_part(dow_part, date) }}\n {%- else -%}\n {%- set dow_part = 'dayofweek' -%}\n case\n when {{ dbt_date.date_part(dow_part, date) }} = 7 then 1\n else {{ dbt_date.date_part(dow_part, date) }} + 1\n end\n {%- endif -%}\n\n\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_date.date_part"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600953.138844}, "macro.dbt_date.bigquery__day_of_week": {"unique_id": "macro.dbt_date.bigquery__day_of_week", "package_name": "dbt_date", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/dbt_date", "path": "macros/calendar_date/day_of_week.sql", "original_file_path": "macros/calendar_date/day_of_week.sql", "name": "bigquery__day_of_week", "macro_sql": "\n\n{%- macro bigquery__day_of_week(date, isoweek) -%}\n\n {%- set dow = dbt_date.date_part('dayofweek', date) -%}\n\n {%- if isoweek -%}\n case\n -- Shift start of week from Sunday (1) to Monday (2)\n when {{ dow }} = 1 then 7\n else {{ dow }} - 1\n end\n {%- else -%}\n {{ dow }}\n {%- endif -%}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_date.date_part"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600953.139124}, "macro.dbt_date.postgres__day_of_week": {"unique_id": "macro.dbt_date.postgres__day_of_week", "package_name": "dbt_date", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/dbt_date", "path": "macros/calendar_date/day_of_week.sql", "original_file_path": "macros/calendar_date/day_of_week.sql", "name": "postgres__day_of_week", "macro_sql": "\n\n\n{%- macro postgres__day_of_week(date, isoweek) -%}\n\n {%- if isoweek -%}\n {%- set dow_part = 'isodow' -%}\n -- Monday(1) to Sunday (7)\n cast({{ dbt_date.date_part(dow_part, date) }} as {{ dbt_utils.type_int() }})\n {%- else -%}\n {%- set dow_part = 'dow' -%}\n -- Sunday(1) to Saturday (7)\n cast({{ dbt_date.date_part(dow_part, date) }} + 1 as {{ dbt_utils.type_int() }})\n {%- endif -%}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_date.date_part", "macro.dbt_utils.type_int"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600953.139531}, "macro.dbt_date.redshift__day_of_week": {"unique_id": "macro.dbt_date.redshift__day_of_week", "package_name": "dbt_date", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/dbt_date", "path": "macros/calendar_date/day_of_week.sql", "original_file_path": "macros/calendar_date/day_of_week.sql", "name": "redshift__day_of_week", "macro_sql": "\n\n\n{%- macro redshift__day_of_week(date, isoweek) -%}\n\n {%- set dow = dbt_date.date_part('dayofweek', date) -%}\n\n {%- if isoweek -%}\n case\n -- Shift start of week from Sunday (0) to Monday (1)\n when {{ dow }} = 0 then 7\n else cast({{ dow }} as {{ dbt_utils.type_bigint() }})\n end\n {%- else -%}\n cast({{ dow }} + 1 as {{ dbt_utils.type_bigint() }})\n {%- endif -%}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_date.date_part", "macro.dbt_utils.type_bigint"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600953.139947}, "macro.dbt_date.iso_week_end": {"unique_id": "macro.dbt_date.iso_week_end", "package_name": "dbt_date", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/dbt_date", "path": "macros/calendar_date/iso_week_end.sql", "original_file_path": "macros/calendar_date/iso_week_end.sql", "name": "iso_week_end", "macro_sql": "{%- macro iso_week_end(date=None, tz=None) -%}\n{%-set dt = date if date else dbt_date.today(tz) -%}\n{{ adapter.dispatch('iso_week_end', 'dbt_date') (dt) }}\n{%- endmacro -%}\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_date.today", "macro.dbt_date.default__iso_week_end"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600953.1404421}, "macro.dbt_date._iso_week_end": {"unique_id": "macro.dbt_date._iso_week_end", "package_name": "dbt_date", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/dbt_date", "path": "macros/calendar_date/iso_week_end.sql", "original_file_path": "macros/calendar_date/iso_week_end.sql", "name": "_iso_week_end", "macro_sql": "{%- macro _iso_week_end(date, week_type) -%}\n{%- set dt = dbt_date.iso_week_start(date) -%}\n{{ dbt_date.n_days_away(6, dt) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_date.iso_week_start", "macro.dbt_date.n_days_away"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600953.140645}, "macro.dbt_date.default__iso_week_end": {"unique_id": "macro.dbt_date.default__iso_week_end", "package_name": "dbt_date", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/dbt_date", "path": "macros/calendar_date/iso_week_end.sql", "original_file_path": "macros/calendar_date/iso_week_end.sql", "name": "default__iso_week_end", "macro_sql": "\n\n{%- macro default__iso_week_end(date) -%}\n{{ dbt_date._iso_week_end(date, 'isoweek') }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_date._iso_week_end"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600953.140779}, "macro.dbt_date.snowflake__iso_week_end": {"unique_id": "macro.dbt_date.snowflake__iso_week_end", "package_name": "dbt_date", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/dbt_date", "path": "macros/calendar_date/iso_week_end.sql", "original_file_path": "macros/calendar_date/iso_week_end.sql", "name": "snowflake__iso_week_end", "macro_sql": "\n\n{%- macro snowflake__iso_week_end(date) -%}\n{{ dbt_date._iso_week_end(date, 'weekiso') }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_date._iso_week_end"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600953.140911}, "macro.dbt_date.n_weeks_ago": {"unique_id": "macro.dbt_date.n_weeks_ago", "package_name": "dbt_date", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/dbt_date", "path": "macros/calendar_date/n_weeks_ago.sql", "original_file_path": "macros/calendar_date/n_weeks_ago.sql", "name": "n_weeks_ago", "macro_sql": "{%- macro n_weeks_ago(n, tz=None) -%}\n{%- set n = n|int -%}\n{{ dbt_utils.date_trunc('week', \n dbt_utils.dateadd('week', -1 * n, \n dbt_date.today(tz)\n )\n ) }}\n{%- endmacro -%}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.date_trunc", "macro.dbt_utils.dateadd", "macro.dbt_date.today"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600953.141333}, "macro.dbt_date.month_name": {"unique_id": "macro.dbt_date.month_name", "package_name": "dbt_date", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/dbt_date", "path": "macros/calendar_date/month_name.sql", "original_file_path": "macros/calendar_date/month_name.sql", "name": "month_name", "macro_sql": "{%- macro month_name(date, short=True) -%}\n {{ adapter.dispatch('month_name', 'dbt_date') (date, short) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_date.bigquery__month_name"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600953.141836}, "macro.dbt_date.default__month_name": {"unique_id": "macro.dbt_date.default__month_name", "package_name": "dbt_date", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/dbt_date", "path": "macros/calendar_date/month_name.sql", "original_file_path": "macros/calendar_date/month_name.sql", "name": "default__month_name", "macro_sql": "\n\n{%- macro default__month_name(date, short) -%}\n{%- set f = 'MON' if short else 'MONTH' -%}\n to_char({{ date }}, '{{ f }}')\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600953.1420329}, "macro.dbt_date.bigquery__month_name": {"unique_id": "macro.dbt_date.bigquery__month_name", "package_name": "dbt_date", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/dbt_date", "path": "macros/calendar_date/month_name.sql", "original_file_path": "macros/calendar_date/month_name.sql", "name": "bigquery__month_name", "macro_sql": "\n\n{%- macro bigquery__month_name(date, short) -%}\n{%- set f = '%b' if short else '%B' -%}\n format_date('{{ f }}', cast({{ date }} as date))\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600953.1422248}, "macro.dbt_date.snowflake__month_name": {"unique_id": "macro.dbt_date.snowflake__month_name", "package_name": "dbt_date", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/dbt_date", "path": "macros/calendar_date/month_name.sql", "original_file_path": "macros/calendar_date/month_name.sql", "name": "snowflake__month_name", "macro_sql": "\n\n{%- macro snowflake__month_name(date, short) -%}\n{%- set f = 'MON' if short else 'MMMM' -%}\n to_char({{ date }}, '{{ f }}')\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600953.1424189}, "macro.dbt_date.postgres__month_name": {"unique_id": "macro.dbt_date.postgres__month_name", "package_name": "dbt_date", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/dbt_date", "path": "macros/calendar_date/month_name.sql", "original_file_path": "macros/calendar_date/month_name.sql", "name": "postgres__month_name", "macro_sql": "\n\n{%- macro postgres__month_name(date, short) -%}\n{# FM = Fill mode, which suppresses padding blanks #}\n{%- set f = 'FMMon' if short else 'FMMonth' -%}\n to_char({{ date }}, '{{ f }}')\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600953.142612}, "macro.dbt_date.last_month_name": {"unique_id": "macro.dbt_date.last_month_name", "package_name": "dbt_date", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/dbt_date", "path": "macros/calendar_date/last_month_name.sql", "original_file_path": "macros/calendar_date/last_month_name.sql", "name": "last_month_name", "macro_sql": "{%- macro last_month_name(short=True, tz=None) -%}\n{{ dbt_date.month_name(dbt_date.last_month(1, tz), short=short) }}\n{%- endmacro -%}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_date.month_name", "macro.dbt_date.last_month"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600953.142923}, "macro.dbt_date.week_of_year": {"unique_id": "macro.dbt_date.week_of_year", "package_name": "dbt_date", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/dbt_date", "path": "macros/calendar_date/week_of_year.sql", "original_file_path": "macros/calendar_date/week_of_year.sql", "name": "week_of_year", "macro_sql": "{%- macro week_of_year(date=None, tz=None) -%}\n{%-set dt = date if date else dbt_date.today(tz) -%}\n{{ adapter.dispatch('week_of_year', 'dbt_date') (dt) }}\n{%- endmacro -%}\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_date.today", "macro.dbt_date.default__week_of_year"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600953.143384}, "macro.dbt_date.default__week_of_year": {"unique_id": "macro.dbt_date.default__week_of_year", "package_name": "dbt_date", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/dbt_date", "path": "macros/calendar_date/week_of_year.sql", "original_file_path": "macros/calendar_date/week_of_year.sql", "name": "default__week_of_year", "macro_sql": "{%- macro default__week_of_year(date) -%}\ncast({{ dbt_date.date_part('week', date) }} as {{ dbt_utils.type_int() }})\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_date.date_part", "macro.dbt_utils.type_int"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600953.143562}, "macro.dbt_date.postgres__week_of_year": {"unique_id": "macro.dbt_date.postgres__week_of_year", "package_name": "dbt_date", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/dbt_date", "path": "macros/calendar_date/week_of_year.sql", "original_file_path": "macros/calendar_date/week_of_year.sql", "name": "postgres__week_of_year", "macro_sql": "\n\n{%- macro postgres__week_of_year(date) -%}\n{# postgresql 'week' returns isoweek. Use to_char instead.\n WW = the first week starts on the first day of the year #}\ncast(to_char({{ date }}, 'WW') as {{ dbt_utils.type_int() }})\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.type_int"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600953.143706}, "macro.dbt_date.convert_timezone": {"unique_id": "macro.dbt_date.convert_timezone", "package_name": "dbt_date", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/dbt_date", "path": "macros/calendar_date/convert_timezone.sql", "original_file_path": "macros/calendar_date/convert_timezone.sql", "name": "convert_timezone", "macro_sql": "{%- macro convert_timezone(column, target_tz=None, source_tz=None) -%}\n{%- set source_tz = \"UTC\" if not source_tz else source_tz -%}\n{%- set target_tz = var(\"dbt_date:time_zone\") if not target_tz else target_tz -%}\n{{ adapter.dispatch('convert_timezone', 'dbt_date') (column, target_tz, source_tz) }}\n{%- endmacro -%}\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_date.bigquery__convert_timezone"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600953.144844}, "macro.dbt_date.default__convert_timezone": {"unique_id": "macro.dbt_date.default__convert_timezone", "package_name": "dbt_date", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/dbt_date", "path": "macros/calendar_date/convert_timezone.sql", "original_file_path": "macros/calendar_date/convert_timezone.sql", "name": "default__convert_timezone", "macro_sql": "{% macro default__convert_timezone(column, target_tz, source_tz) -%}\n{%- if not source_tz -%}\ncast(convert_timezone('{{ target_tz }}', {{ column }}) as {{ dbt_utils.type_timestamp() }})\n{%- else -%}\ncast(convert_timezone('{{ source_tz }}', '{{ target_tz }}', {{ column }}) as {{ dbt_utils.type_timestamp() }})\n{%- endif -%}\n{%- endmacro -%}\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.type_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600953.14517}, "macro.dbt_date.bigquery__convert_timezone": {"unique_id": "macro.dbt_date.bigquery__convert_timezone", "package_name": "dbt_date", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/dbt_date", "path": "macros/calendar_date/convert_timezone.sql", "original_file_path": "macros/calendar_date/convert_timezone.sql", "name": "bigquery__convert_timezone", "macro_sql": "{%- macro bigquery__convert_timezone(column, target_tz, source_tz=None) -%}\ntimestamp(datetime({{ column }}, '{{ target_tz}}'))\n{%- endmacro -%}\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600953.145321}, "macro.dbt_date.spark__convert_timezone": {"unique_id": "macro.dbt_date.spark__convert_timezone", "package_name": "dbt_date", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/dbt_date", "path": "macros/calendar_date/convert_timezone.sql", "original_file_path": "macros/calendar_date/convert_timezone.sql", "name": "spark__convert_timezone", "macro_sql": "{%- macro spark__convert_timezone(column, target_tz, source_tz) -%}\nfrom_utc_timestamp(\n to_utc_timestamp({{ column }}, '{{ source_tz }}'),\n '{{ target_tz }}'\n )\n{%- endmacro -%}\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600953.1454751}, "macro.dbt_date.postgres__convert_timezone": {"unique_id": "macro.dbt_date.postgres__convert_timezone", "package_name": "dbt_date", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/dbt_date", "path": "macros/calendar_date/convert_timezone.sql", "original_file_path": "macros/calendar_date/convert_timezone.sql", "name": "postgres__convert_timezone", "macro_sql": "{% macro postgres__convert_timezone(column, target_tz, source_tz) -%}\n{%- if source_tz -%}\ncast({{ column }} at time zone '{{ source_tz }}' at time zone '{{ target_tz }}' as {{ dbt_utils.type_timestamp() }})\n{%- else -%}\ncast({{ column }} at time zone '{{ target_tz }}' as {{ dbt_utils.type_timestamp() }})\n{%- endif -%}\n{%- endmacro -%}\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.type_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600953.1458502}, "macro.dbt_date.redshift__convert_timezone": {"unique_id": "macro.dbt_date.redshift__convert_timezone", "package_name": "dbt_date", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/dbt_date", "path": "macros/calendar_date/convert_timezone.sql", "original_file_path": "macros/calendar_date/convert_timezone.sql", "name": "redshift__convert_timezone", "macro_sql": "{%- macro redshift__convert_timezone(column, target_tz, source_tz) -%}\n{{ return(dbt_date.default__convert_timezone(column, target_tz, source_tz)) }}\n{%- endmacro -%}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_date.default__convert_timezone"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600953.146035}, "macro.dbt_date.n_months_away": {"unique_id": "macro.dbt_date.n_months_away", "package_name": "dbt_date", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/dbt_date", "path": "macros/calendar_date/n_months_away.sql", "original_file_path": "macros/calendar_date/n_months_away.sql", "name": "n_months_away", "macro_sql": "{%- macro n_months_away(n, tz=None) -%}\n{%- set n = n|int -%}\n{{ dbt_utils.date_trunc('month', \n dbt_utils.dateadd('month', n, \n dbt_date.today(tz)\n )\n ) }}\n{%- endmacro -%}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.date_trunc", "macro.dbt_utils.dateadd", "macro.dbt_date.today"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600953.1464372}, "macro.dbt_date.iso_week_of_year": {"unique_id": "macro.dbt_date.iso_week_of_year", "package_name": "dbt_date", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/dbt_date", "path": "macros/calendar_date/iso_week_of_year.sql", "original_file_path": "macros/calendar_date/iso_week_of_year.sql", "name": "iso_week_of_year", "macro_sql": "{%- macro iso_week_of_year(date=None, tz=None) -%}\n{%-set dt = date if date else dbt_date.today(tz) -%}\n{{ adapter.dispatch('iso_week_of_year', 'dbt_date') (dt) }}\n{%- endmacro -%}\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_date.today", "macro.dbt_date.default__iso_week_of_year"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600953.147001}, "macro.dbt_date._iso_week_of_year": {"unique_id": "macro.dbt_date._iso_week_of_year", "package_name": "dbt_date", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/dbt_date", "path": "macros/calendar_date/iso_week_of_year.sql", "original_file_path": "macros/calendar_date/iso_week_of_year.sql", "name": "_iso_week_of_year", "macro_sql": "{%- macro _iso_week_of_year(date, week_type) -%}\ncast({{ dbt_date.date_part(week_type, date) }} as {{ dbt_utils.type_int() }})\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_date.date_part", "macro.dbt_utils.type_int"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600953.147192}, "macro.dbt_date.default__iso_week_of_year": {"unique_id": "macro.dbt_date.default__iso_week_of_year", "package_name": "dbt_date", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/dbt_date", "path": "macros/calendar_date/iso_week_of_year.sql", "original_file_path": "macros/calendar_date/iso_week_of_year.sql", "name": "default__iso_week_of_year", "macro_sql": "\n\n{%- macro default__iso_week_of_year(date) -%}\n{{ dbt_date._iso_week_of_year(date, 'isoweek') }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_date._iso_week_of_year"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600953.147326}, "macro.dbt_date.snowflake__iso_week_of_year": {"unique_id": "macro.dbt_date.snowflake__iso_week_of_year", "package_name": "dbt_date", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/dbt_date", "path": "macros/calendar_date/iso_week_of_year.sql", "original_file_path": "macros/calendar_date/iso_week_of_year.sql", "name": "snowflake__iso_week_of_year", "macro_sql": "\n\n{%- macro snowflake__iso_week_of_year(date) -%}\n{{ dbt_date._iso_week_of_year(date, 'weekiso') }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_date._iso_week_of_year"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600953.1474571}, "macro.dbt_date.postgres__iso_week_of_year": {"unique_id": "macro.dbt_date.postgres__iso_week_of_year", "package_name": "dbt_date", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/dbt_date", "path": "macros/calendar_date/iso_week_of_year.sql", "original_file_path": "macros/calendar_date/iso_week_of_year.sql", "name": "postgres__iso_week_of_year", "macro_sql": "\n\n{%- macro postgres__iso_week_of_year(date) -%}\n-- postgresql week is isoweek, the first week of a year containing January 4 of that year.\n{{ dbt_date._iso_week_of_year(date, 'week') }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_date._iso_week_of_year"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600953.1475992}, "macro.dbt_date.week_end": {"unique_id": "macro.dbt_date.week_end", "package_name": "dbt_date", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/dbt_date", "path": "macros/calendar_date/week_end.sql", "original_file_path": "macros/calendar_date/week_end.sql", "name": "week_end", "macro_sql": "{%- macro week_end(date=None, tz=None) -%}\n{%-set dt = date if date else dbt_date.today(tz) -%}\n{{ adapter.dispatch('week_end', 'dbt_date') (dt) }}\n{%- endmacro -%}\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_date.today", "macro.dbt_date.default__week_end"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600953.1480992}, "macro.dbt_date.default__week_end": {"unique_id": "macro.dbt_date.default__week_end", "package_name": "dbt_date", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/dbt_date", "path": "macros/calendar_date/week_end.sql", "original_file_path": "macros/calendar_date/week_end.sql", "name": "default__week_end", "macro_sql": "{%- macro default__week_end(date) -%}\n{{ dbt_utils.last_day(date, 'week') }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.last_day"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600953.148234}, "macro.dbt_date.snowflake__week_end": {"unique_id": "macro.dbt_date.snowflake__week_end", "package_name": "dbt_date", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/dbt_date", "path": "macros/calendar_date/week_end.sql", "original_file_path": "macros/calendar_date/week_end.sql", "name": "snowflake__week_end", "macro_sql": "\n\n{%- macro snowflake__week_end(date) -%}\n{%- set dt = dbt_date.week_start(date) -%}\n{{ dbt_date.n_days_away(6, dt) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_date.week_start", "macro.dbt_date.n_days_away"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600953.148428}, "macro.dbt_date.postgres__week_end": {"unique_id": "macro.dbt_date.postgres__week_end", "package_name": "dbt_date", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/dbt_date", "path": "macros/calendar_date/week_end.sql", "original_file_path": "macros/calendar_date/week_end.sql", "name": "postgres__week_end", "macro_sql": "\n\n{%- macro postgres__week_end(date) -%}\n{%- set dt = dbt_date.week_start(date) -%}\n{{ dbt_date.n_days_away(6, dt) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_date.week_start", "macro.dbt_date.n_days_away"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600953.148621}, "macro.dbt_date.next_month_number": {"unique_id": "macro.dbt_date.next_month_number", "package_name": "dbt_date", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/dbt_date", "path": "macros/calendar_date/next_month_number.sql", "original_file_path": "macros/calendar_date/next_month_number.sql", "name": "next_month_number", "macro_sql": "{%- macro next_month_number(tz=None) -%}\n{{ dbt_date.date_part('month', dbt_date.next_month(1, tz)) }}\n{%- endmacro -%}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_date.date_part", "macro.dbt_date.next_month"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600953.148909}, "macro.dbt_date.last_month_number": {"unique_id": "macro.dbt_date.last_month_number", "package_name": "dbt_date", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/dbt_date", "path": "macros/calendar_date/last_month_number.sql", "original_file_path": "macros/calendar_date/last_month_number.sql", "name": "last_month_number", "macro_sql": "{%- macro last_month_number(tz=None) -%}\n{{ dbt_date.date_part('month', dbt_date.last_month(1, tz)) }}\n{%- endmacro -%}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_date.date_part", "macro.dbt_date.last_month"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600953.1491919}, "macro.fivetran_utils.enabled_vars": {"unique_id": "macro.fivetran_utils.enabled_vars", "package_name": "fivetran_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/fivetran_utils", "path": "macros/enabled_vars.sql", "original_file_path": "macros/enabled_vars.sql", "name": "enabled_vars", "macro_sql": "{% macro enabled_vars(vars) %}\n\n{% for v in vars %}\n \n {% if var(v, True) == False %}\n {{ return(False) }}\n {% endif %}\n\n{% endfor %}\n\n{{ return(True) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600953.149636}, "macro.fivetran_utils.percentile": {"unique_id": "macro.fivetran_utils.percentile", "package_name": "fivetran_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/fivetran_utils", "path": "macros/percentile.sql", "original_file_path": "macros/percentile.sql", "name": "percentile", "macro_sql": "{% macro percentile(percentile_field, partition_field, percent) -%}\n\n{{ adapter.dispatch('percentile', 'fivetran_utils') (percentile_field, partition_field, percent) }}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.fivetran_utils.bigquery__percentile"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600953.150542}, "macro.fivetran_utils.default__percentile": {"unique_id": "macro.fivetran_utils.default__percentile", "package_name": "fivetran_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/fivetran_utils", "path": "macros/percentile.sql", "original_file_path": "macros/percentile.sql", "name": "default__percentile", "macro_sql": "{% macro default__percentile(percentile_field, partition_field, percent) %}\n\n percentile_cont( \n {{ percent }} )\n within group ( order by {{ percentile_field }} )\n over ( partition by {{ partition_field }} )\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600953.1507049}, "macro.fivetran_utils.redshift__percentile": {"unique_id": "macro.fivetran_utils.redshift__percentile", "package_name": "fivetran_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/fivetran_utils", "path": "macros/percentile.sql", "original_file_path": "macros/percentile.sql", "name": "redshift__percentile", "macro_sql": "{% macro redshift__percentile(percentile_field, partition_field, percent) %}\n\n percentile_cont( \n {{ percent }} )\n within group ( order by {{ percentile_field }} )\n over ( partition by {{ partition_field }} )\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600953.1508648}, "macro.fivetran_utils.bigquery__percentile": {"unique_id": "macro.fivetran_utils.bigquery__percentile", "package_name": "fivetran_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/fivetran_utils", "path": "macros/percentile.sql", "original_file_path": "macros/percentile.sql", "name": "bigquery__percentile", "macro_sql": "{% macro bigquery__percentile(percentile_field, partition_field, percent) %}\n\n percentile_cont( \n {{ percentile_field }}, \n {{ percent }}) \n over (partition by {{ partition_field }} \n )\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600953.15102}, "macro.fivetran_utils.postgres__percentile": {"unique_id": "macro.fivetran_utils.postgres__percentile", "package_name": "fivetran_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/fivetran_utils", "path": "macros/percentile.sql", "original_file_path": "macros/percentile.sql", "name": "postgres__percentile", "macro_sql": "{% macro postgres__percentile(percentile_field, partition_field, percent) %}\n\n percentile_cont( \n {{ percent }} )\n within group ( order by {{ percentile_field }} )\n /* have to group by partition field */\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600953.151158}, "macro.fivetran_utils.spark__percentile": {"unique_id": "macro.fivetran_utils.spark__percentile", "package_name": "fivetran_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/fivetran_utils", "path": "macros/percentile.sql", "original_file_path": "macros/percentile.sql", "name": "spark__percentile", "macro_sql": "{% macro spark__percentile(percentile_field, partition_field, percent) %}\n\n percentile( \n {{ percentile_field }}, \n {{ percent }}) \n over (partition by {{ partition_field }} \n )\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600953.1513228}, "macro.fivetran_utils.pivot_json_extract": {"unique_id": "macro.fivetran_utils.pivot_json_extract", "package_name": "fivetran_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/fivetran_utils", "path": "macros/pivot_json_extract.sql", "original_file_path": "macros/pivot_json_extract.sql", "name": "pivot_json_extract", "macro_sql": "{% macro pivot_json_extract(string, list_of_properties) %}\n\n{%- for property in list_of_properties -%}\n\nreplace( {{ fivetran_utils.json_extract(string, property) }}, '\"', '') as {{ property | replace(' ', '_') | lower }}\n\n{%- if not loop.last -%},{%- endif %}\n{% endfor -%}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.fivetran_utils.json_extract"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600953.1518562}, "macro.fivetran_utils.persist_pass_through_columns": {"unique_id": "macro.fivetran_utils.persist_pass_through_columns", "package_name": "fivetran_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/fivetran_utils", "path": "macros/persist_pass_through_columns.sql", "original_file_path": "macros/persist_pass_through_columns.sql", "name": "persist_pass_through_columns", "macro_sql": "{% macro persist_pass_through_columns(pass_through_variable, identifier=none, transform='') %}\n\n{% if var(pass_through_variable, none) %}\n {% for field in var(pass_through_variable) %}\n , {{ transform ~ '(' ~ (identifier ~ '.' if identifier else '') ~ (field.alias if field.alias else field.name) ~ ')' }} as {{ field.alias if field.alias else field.name }}\n {% endfor %}\n{% endif %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600953.152537}, "macro.fivetran_utils.json_parse": {"unique_id": "macro.fivetran_utils.json_parse", "package_name": "fivetran_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/fivetran_utils", "path": "macros/json_parse.sql", "original_file_path": "macros/json_parse.sql", "name": "json_parse", "macro_sql": "{% macro json_parse(string, string_path) -%}\n\n{{ adapter.dispatch('json_parse', 'fivetran_utils') (string, string_path) }}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.fivetran_utils.bigquery__json_parse"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600953.1535811}, "macro.fivetran_utils.default__json_parse": {"unique_id": "macro.fivetran_utils.default__json_parse", "package_name": "fivetran_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/fivetran_utils", "path": "macros/json_parse.sql", "original_file_path": "macros/json_parse.sql", "name": "default__json_parse", "macro_sql": "{% macro default__json_parse(string, string_path) %}\n\n json_extract_path_text({{string}}, {%- for s in string_path -%}'{{ s }}'{%- if not loop.last -%},{%- endif -%}{%- endfor -%} )\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600953.153821}, "macro.fivetran_utils.redshift__json_parse": {"unique_id": "macro.fivetran_utils.redshift__json_parse", "package_name": "fivetran_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/fivetran_utils", "path": "macros/json_parse.sql", "original_file_path": "macros/json_parse.sql", "name": "redshift__json_parse", "macro_sql": "{% macro redshift__json_parse(string, string_path) %}\n\n json_extract_path_text({{string}}, {%- for s in string_path -%}'{{ s }}'{%- if not loop.last -%},{%- endif -%}{%- endfor -%} )\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600953.154057}, "macro.fivetran_utils.bigquery__json_parse": {"unique_id": "macro.fivetran_utils.bigquery__json_parse", "package_name": "fivetran_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/fivetran_utils", "path": "macros/json_parse.sql", "original_file_path": "macros/json_parse.sql", "name": "bigquery__json_parse", "macro_sql": "{% macro bigquery__json_parse(string, string_path) %}\n\n \n json_extract_scalar({{string}}, '$.{%- for s in string_path -%}{{ s }}{%- if not loop.last -%}.{%- endif -%}{%- endfor -%} ')\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600953.154298}, "macro.fivetran_utils.postgres__json_parse": {"unique_id": "macro.fivetran_utils.postgres__json_parse", "package_name": "fivetran_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/fivetran_utils", "path": "macros/json_parse.sql", "original_file_path": "macros/json_parse.sql", "name": "postgres__json_parse", "macro_sql": "{% macro postgres__json_parse(string, string_path) %}\n\n {{string}}::json #>> '{ {%- for s in string_path -%}{{ s }}{%- if not loop.last -%},{%- endif -%}{%- endfor -%} }'\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600953.1545339}, "macro.fivetran_utils.snowflake__json_parse": {"unique_id": "macro.fivetran_utils.snowflake__json_parse", "package_name": "fivetran_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/fivetran_utils", "path": "macros/json_parse.sql", "original_file_path": "macros/json_parse.sql", "name": "snowflake__json_parse", "macro_sql": "{% macro snowflake__json_parse(string, string_path) %}\n\n parse_json( {{string}} ) {%- for s in string_path -%}{% if s is number %}[{{ s }}]{% else %}['{{ s }}']{% endif %}{%- endfor -%}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600953.1547961}, "macro.fivetran_utils.spark__json_parse": {"unique_id": "macro.fivetran_utils.spark__json_parse", "package_name": "fivetran_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/fivetran_utils", "path": "macros/json_parse.sql", "original_file_path": "macros/json_parse.sql", "name": "spark__json_parse", "macro_sql": "{% macro spark__json_parse(string, string_path) %}\n\n {{string}} : {%- for s in string_path -%}{% if s is number %}[{{ s }}]{% else %}['{{ s }}']{% endif %}{%- endfor -%}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600953.155058}, "macro.fivetran_utils.max_bool": {"unique_id": "macro.fivetran_utils.max_bool", "package_name": "fivetran_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/fivetran_utils", "path": "macros/max_bool.sql", "original_file_path": "macros/max_bool.sql", "name": "max_bool", "macro_sql": "{% macro max_bool(boolean_field) -%}\n\n{{ adapter.dispatch('max_bool', 'fivetran_utils') (boolean_field) }}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.fivetran_utils.bigquery__max_bool"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600953.155426}, "macro.fivetran_utils.default__max_bool": {"unique_id": "macro.fivetran_utils.default__max_bool", "package_name": "fivetran_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/fivetran_utils", "path": "macros/max_bool.sql", "original_file_path": "macros/max_bool.sql", "name": "default__max_bool", "macro_sql": "{% macro default__max_bool(boolean_field) %}\n\n bool_or( {{ boolean_field }} )\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600953.1555252}, "macro.fivetran_utils.snowflake__max_bool": {"unique_id": "macro.fivetran_utils.snowflake__max_bool", "package_name": "fivetran_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/fivetran_utils", "path": "macros/max_bool.sql", "original_file_path": "macros/max_bool.sql", "name": "snowflake__max_bool", "macro_sql": "{% macro snowflake__max_bool(boolean_field) %}\n\n max( {{ boolean_field }} )\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600953.15562}, "macro.fivetran_utils.bigquery__max_bool": {"unique_id": "macro.fivetran_utils.bigquery__max_bool", "package_name": "fivetran_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/fivetran_utils", "path": "macros/max_bool.sql", "original_file_path": "macros/max_bool.sql", "name": "bigquery__max_bool", "macro_sql": "{% macro bigquery__max_bool(boolean_field) %}\n\n max( {{ boolean_field }} )\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600953.1557171}, "macro.fivetran_utils.calculated_fields": {"unique_id": "macro.fivetran_utils.calculated_fields", "package_name": "fivetran_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/fivetran_utils", "path": "macros/calculated_fields.sql", "original_file_path": "macros/calculated_fields.sql", "name": "calculated_fields", "macro_sql": "{% macro calculated_fields(variable) -%}\n\n{% if var(variable, none) %}\n {% for field in var(variable) %}\n , {{ field.transform_sql }} as {{ field.name }} \n {% endfor %}\n{% endif %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600953.156132}, "macro.fivetran_utils.seed_data_helper": {"unique_id": "macro.fivetran_utils.seed_data_helper", "package_name": "fivetran_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/fivetran_utils", "path": "macros/seed_data_helper.sql", "original_file_path": "macros/seed_data_helper.sql", "name": "seed_data_helper", "macro_sql": "{% macro seed_data_helper(seed_name, warehouses) %}\n\n{% if target.type in warehouses %}\n {% for w in warehouses %}\n {% if target.type == w %}\n {{ return(ref(seed_name ~ \"_\" ~ w ~ \"\")) }}\n {% endif %}\n {% endfor %}\n{% else %}\n{{ return(ref(seed_name)) }}\n{% endif %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600953.156746}, "macro.fivetran_utils.fill_pass_through_columns": {"unique_id": "macro.fivetran_utils.fill_pass_through_columns", "package_name": "fivetran_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/fivetran_utils", "path": "macros/fill_pass_through_columns.sql", "original_file_path": "macros/fill_pass_through_columns.sql", "name": "fill_pass_through_columns", "macro_sql": "{% macro fill_pass_through_columns(pass_through_variable) %}\n\n{% if var(pass_through_variable) %}\n {% for field in var(pass_through_variable) %}\n {% if field.transform_sql %}\n , {{ field.transform_sql }} as {{ field.alias if field.alias else field.name }}\n {% else %}\n , {{ field.alias if field.alias else field.name }}\n {% endif %}\n {% endfor %}\n{% endif %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600953.157395}, "macro.fivetran_utils.string_agg": {"unique_id": "macro.fivetran_utils.string_agg", "package_name": "fivetran_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/fivetran_utils", "path": "macros/string_agg.sql", "original_file_path": "macros/string_agg.sql", "name": "string_agg", "macro_sql": "{% macro string_agg(field_to_agg, delimiter) -%}\n\n{{ adapter.dispatch('string_agg', 'fivetran_utils') (field_to_agg, delimiter) }}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.fivetran_utils.default__string_agg"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600953.1578948}, "macro.fivetran_utils.default__string_agg": {"unique_id": "macro.fivetran_utils.default__string_agg", "package_name": "fivetran_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/fivetran_utils", "path": "macros/string_agg.sql", "original_file_path": "macros/string_agg.sql", "name": "default__string_agg", "macro_sql": "{% macro default__string_agg(field_to_agg, delimiter) %}\n string_agg({{ field_to_agg }}, {{ delimiter }})\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600953.158022}, "macro.fivetran_utils.snowflake__string_agg": {"unique_id": "macro.fivetran_utils.snowflake__string_agg", "package_name": "fivetran_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/fivetran_utils", "path": "macros/string_agg.sql", "original_file_path": "macros/string_agg.sql", "name": "snowflake__string_agg", "macro_sql": "{% macro snowflake__string_agg(field_to_agg, delimiter) %}\n listagg({{ field_to_agg }}, {{ delimiter }})\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600953.1581461}, "macro.fivetran_utils.redshift__string_agg": {"unique_id": "macro.fivetran_utils.redshift__string_agg", "package_name": "fivetran_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/fivetran_utils", "path": "macros/string_agg.sql", "original_file_path": "macros/string_agg.sql", "name": "redshift__string_agg", "macro_sql": "{% macro redshift__string_agg(field_to_agg, delimiter) %}\n listagg({{ field_to_agg }}, {{ delimiter }})\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600953.158272}, "macro.fivetran_utils.spark__string_agg": {"unique_id": "macro.fivetran_utils.spark__string_agg", "package_name": "fivetran_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/fivetran_utils", "path": "macros/string_agg.sql", "original_file_path": "macros/string_agg.sql", "name": "spark__string_agg", "macro_sql": "{% macro spark__string_agg(field_to_agg, delimiter) %}\n -- collect set will remove duplicates\n replace(replace(replace(cast( collect_set({{ field_to_agg }}) as string), '[', ''), ']', ''), ', ', {{ delimiter }} )\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600953.15846}, "macro.fivetran_utils.timestamp_diff": {"unique_id": "macro.fivetran_utils.timestamp_diff", "package_name": "fivetran_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/fivetran_utils", "path": "macros/timestamp_diff.sql", "original_file_path": "macros/timestamp_diff.sql", "name": "timestamp_diff", "macro_sql": "{% macro timestamp_diff(first_date, second_date, datepart) %}\n {{ adapter.dispatch('timestamp_diff', 'fivetran_utils')(first_date, second_date, datepart) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.fivetran_utils.bigquery__timestamp_diff"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600953.1611142}, "macro.fivetran_utils.default__timestamp_diff": {"unique_id": "macro.fivetran_utils.default__timestamp_diff", "package_name": "fivetran_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/fivetran_utils", "path": "macros/timestamp_diff.sql", "original_file_path": "macros/timestamp_diff.sql", "name": "default__timestamp_diff", "macro_sql": "{% macro default__timestamp_diff(first_date, second_date, datepart) %}\n\n datediff(\n {{ datepart }},\n {{ first_date }},\n {{ second_date }}\n )\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600953.161275}, "macro.fivetran_utils.redshift__timestamp_diff": {"unique_id": "macro.fivetran_utils.redshift__timestamp_diff", "package_name": "fivetran_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/fivetran_utils", "path": "macros/timestamp_diff.sql", "original_file_path": "macros/timestamp_diff.sql", "name": "redshift__timestamp_diff", "macro_sql": "{% macro redshift__timestamp_diff(first_date, second_date, datepart) %}\n\n datediff(\n {{ datepart }},\n {{ first_date }},\n {{ second_date }}\n )\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600953.161428}, "macro.fivetran_utils.bigquery__timestamp_diff": {"unique_id": "macro.fivetran_utils.bigquery__timestamp_diff", "package_name": "fivetran_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/fivetran_utils", "path": "macros/timestamp_diff.sql", "original_file_path": "macros/timestamp_diff.sql", "name": "bigquery__timestamp_diff", "macro_sql": "{% macro bigquery__timestamp_diff(first_date, second_date, datepart) %}\n\n timestamp_diff(\n {{second_date}},\n {{first_date}},\n {{datepart}}\n )\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600953.161577}, "macro.fivetran_utils.postgres__timestamp_diff": {"unique_id": "macro.fivetran_utils.postgres__timestamp_diff", "package_name": "fivetran_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/fivetran_utils", "path": "macros/timestamp_diff.sql", "original_file_path": "macros/timestamp_diff.sql", "name": "postgres__timestamp_diff", "macro_sql": "{% macro postgres__timestamp_diff(first_date, second_date, datepart) %}\n\n {% if datepart == 'year' %}\n (date_part('year', ({{second_date}})::date) - date_part('year', ({{first_date}})::date))\n {% elif datepart == 'quarter' %}\n ({{ dbt_utils.datediff(first_date, second_date, 'year') }} * 4 + date_part('quarter', ({{second_date}})::date) - date_part('quarter', ({{first_date}})::date))\n {% elif datepart == 'month' %}\n ({{ dbt_utils.datediff(first_date, second_date, 'year') }} * 12 + date_part('month', ({{second_date}})::date) - date_part('month', ({{first_date}})::date))\n {% elif datepart == 'day' %}\n (({{second_date}})::date - ({{first_date}})::date)\n {% elif datepart == 'week' %}\n ({{ dbt_utils.datediff(first_date, second_date, 'day') }} / 7 + case\n when date_part('dow', ({{first_date}})::timestamp) <= date_part('dow', ({{second_date}})::timestamp) then\n case when {{first_date}} <= {{second_date}} then 0 else -1 end\n else\n case when {{first_date}} <= {{second_date}} then 1 else 0 end\n end)\n {% elif datepart == 'hour' %}\n ({{ dbt_utils.datediff(first_date, second_date, 'day') }} * 24 + date_part('hour', ({{second_date}})::timestamp) - date_part('hour', ({{first_date}})::timestamp))\n {% elif datepart == 'minute' %}\n ({{ dbt_utils.datediff(first_date, second_date, 'hour') }} * 60 + date_part('minute', ({{second_date}})::timestamp) - date_part('minute', ({{first_date}})::timestamp))\n {% elif datepart == 'second' %}\n ({{ dbt_utils.datediff(first_date, second_date, 'minute') }} * 60 + floor(date_part('second', ({{second_date}})::timestamp)) - floor(date_part('second', ({{first_date}})::timestamp)))\n {% elif datepart == 'millisecond' %}\n ({{ dbt_utils.datediff(first_date, second_date, 'minute') }} * 60000 + floor(date_part('millisecond', ({{second_date}})::timestamp)) - floor(date_part('millisecond', ({{first_date}})::timestamp)))\n {% elif datepart == 'microsecond' %}\n ({{ dbt_utils.datediff(first_date, second_date, 'minute') }} * 60000000 + floor(date_part('microsecond', ({{second_date}})::timestamp)) - floor(date_part('microsecond', ({{first_date}})::timestamp)))\n {% else %}\n {{ exceptions.raise_compiler_error(\"Unsupported datepart for macro datediff in postgres: {!r}\".format(datepart)) }}\n {% endif %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.datediff"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600953.1632352}, "macro.fivetran_utils.try_cast": {"unique_id": "macro.fivetran_utils.try_cast", "package_name": "fivetran_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/fivetran_utils", "path": "macros/try_cast.sql", "original_file_path": "macros/try_cast.sql", "name": "try_cast", "macro_sql": "{% macro try_cast(field, type) %}\n {{ adapter.dispatch('try_cast', 'fivetran_utils') (field, type) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.fivetran_utils.bigquery__try_cast"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600953.164078}, "macro.fivetran_utils.default__safe_cast": {"unique_id": "macro.fivetran_utils.default__safe_cast", "package_name": "fivetran_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/fivetran_utils", "path": "macros/try_cast.sql", "original_file_path": "macros/try_cast.sql", "name": "default__safe_cast", "macro_sql": "{% macro default__safe_cast(field, type) %}\n {# most databases don't support this function yet\n so we just need to use cast #}\n cast({{field}} as {{type}})\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600953.164215}, "macro.fivetran_utils.redshift__try_cast": {"unique_id": "macro.fivetran_utils.redshift__try_cast", "package_name": "fivetran_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/fivetran_utils", "path": "macros/try_cast.sql", "original_file_path": "macros/try_cast.sql", "name": "redshift__try_cast", "macro_sql": "{% macro redshift__try_cast(field, type) %}\n{%- if type == 'numeric' -%}\n\n case\n when trim({{field}}) ~ '^(0|[1-9][0-9]*)$' then trim({{field}})\n else null\n end::{{type}}\n\n{% else %}\n {{ exceptions.raise_compiler_error(\n \"non-numeric datatypes are not currently supported\") }}\n\n{% endif %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600953.164487}, "macro.fivetran_utils.postgres__try_cast": {"unique_id": "macro.fivetran_utils.postgres__try_cast", "package_name": "fivetran_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/fivetran_utils", "path": "macros/try_cast.sql", "original_file_path": "macros/try_cast.sql", "name": "postgres__try_cast", "macro_sql": "{% macro postgres__try_cast(field, type) %}\n{%- if type == 'numeric' -%}\n\n case\n when replace(cast({{field}} as varchar),cast(' ' as varchar),cast('' as varchar)) ~ '^(0|[1-9][0-9]*)$' \n then replace(cast({{field}} as varchar),cast(' ' as varchar),cast('' as varchar))\n else null\n end::{{type}}\n\n{% else %}\n {{ exceptions.raise_compiler_error(\n \"non-numeric datatypes are not currently supported\") }}\n\n{% endif %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600953.164765}, "macro.fivetran_utils.snowflake__try_cast": {"unique_id": "macro.fivetran_utils.snowflake__try_cast", "package_name": "fivetran_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/fivetran_utils", "path": "macros/try_cast.sql", "original_file_path": "macros/try_cast.sql", "name": "snowflake__try_cast", "macro_sql": "{% macro snowflake__try_cast(field, type) %}\n try_cast(cast({{field}} as varchar) as {{type}})\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600953.164893}, "macro.fivetran_utils.bigquery__try_cast": {"unique_id": "macro.fivetran_utils.bigquery__try_cast", "package_name": "fivetran_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/fivetran_utils", "path": "macros/try_cast.sql", "original_file_path": "macros/try_cast.sql", "name": "bigquery__try_cast", "macro_sql": "{% macro bigquery__try_cast(field, type) %}\n safe_cast({{field}} as {{type}})\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600953.165014}, "macro.fivetran_utils.spark__try_cast": {"unique_id": "macro.fivetran_utils.spark__try_cast", "package_name": "fivetran_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/fivetran_utils", "path": "macros/try_cast.sql", "original_file_path": "macros/try_cast.sql", "name": "spark__try_cast", "macro_sql": "{% macro spark__try_cast(field, type) %}\n try_cast({{field}} as {{type}})\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600953.1651342}, "macro.fivetran_utils.source_relation": {"unique_id": "macro.fivetran_utils.source_relation", "package_name": "fivetran_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/fivetran_utils", "path": "macros/source_relation.sql", "original_file_path": "macros/source_relation.sql", "name": "source_relation", "macro_sql": "{% macro source_relation(union_schema_variable='union_schemas', union_database_variable='union_databases') -%}\n\n{{ adapter.dispatch('source_relation', 'fivetran_utils') (union_schema_variable, union_database_variable) }}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.fivetran_utils.default__source_relation"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600953.16565}, "macro.fivetran_utils.default__source_relation": {"unique_id": "macro.fivetran_utils.default__source_relation", "package_name": "fivetran_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/fivetran_utils", "path": "macros/source_relation.sql", "original_file_path": "macros/source_relation.sql", "name": "default__source_relation", "macro_sql": "{% macro default__source_relation(union_schema_variable, union_database_variable) %}\n\n{% if var(union_schema_variable, none) %}\n, case\n {% for schema in var(union_schema_variable) %}\n when lower(replace(replace(_dbt_source_relation,'\"',''),'`','')) like '%.{{ schema|lower }}.%' then '{{ schema|lower }}'\n {% endfor %}\n end as source_relation\n{% elif var(union_database_variable, none) %}\n, case\n {% for database in var(union_database_variable) %}\n when lower(replace(replace(_dbt_source_relation,'\"',''),'`','')) like '%{{ database|lower }}.%' then '{{ database|lower }}'\n {% endfor %}\n end as source_relation\n{% else %}\n, cast('' as {{ dbt_utils.type_string() }}) as source_relation\n{% endif %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.type_string"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600953.166214}, "macro.fivetran_utils.first_value": {"unique_id": "macro.fivetran_utils.first_value", "package_name": "fivetran_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/fivetran_utils", "path": "macros/first_value.sql", "original_file_path": "macros/first_value.sql", "name": "first_value", "macro_sql": "{% macro first_value(first_value_field, partition_field, order_by_field, order=\"asc\") -%}\n\n{{ adapter.dispatch('first_value', 'fivetran_utils') (first_value_field, partition_field, order_by_field, order) }}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.fivetran_utils.default__first_value"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600953.166742}, "macro.fivetran_utils.default__first_value": {"unique_id": "macro.fivetran_utils.default__first_value", "package_name": "fivetran_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/fivetran_utils", "path": "macros/first_value.sql", "original_file_path": "macros/first_value.sql", "name": "default__first_value", "macro_sql": "{% macro default__first_value(first_value_field, partition_field, order_by_field, order=\"asc\") %}\n\n first_value( {{ first_value_field }} ignore nulls ) over (partition by {{ partition_field }} order by {{ order_by_field }} {{ order }} )\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600953.16694}, "macro.fivetran_utils.redshift__first_value": {"unique_id": "macro.fivetran_utils.redshift__first_value", "package_name": "fivetran_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/fivetran_utils", "path": "macros/first_value.sql", "original_file_path": "macros/first_value.sql", "name": "redshift__first_value", "macro_sql": "{% macro redshift__first_value(first_value_field, partition_field, order_by_field, order=\"asc\") %}\n\n first_value( {{ first_value_field }} ignore nulls ) over (partition by {{ partition_field }} order by {{ order_by_field }} {{ order }} , {{ partition_field }} rows unbounded preceding )\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600953.167153}, "macro.fivetran_utils.add_dbt_source_relation": {"unique_id": "macro.fivetran_utils.add_dbt_source_relation", "package_name": "fivetran_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/fivetran_utils", "path": "macros/add_dbt_source_relation.sql", "original_file_path": "macros/add_dbt_source_relation.sql", "name": "add_dbt_source_relation", "macro_sql": "{% macro add_dbt_source_relation() %}\n\n{% if var('union_schemas', none) or var('union_databases', none) %}\n, _dbt_source_relation\n{% endif %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600953.1674619}, "macro.fivetran_utils.add_pass_through_columns": {"unique_id": "macro.fivetran_utils.add_pass_through_columns", "package_name": "fivetran_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/fivetran_utils", "path": "macros/add_pass_through_columns.sql", "original_file_path": "macros/add_pass_through_columns.sql", "name": "add_pass_through_columns", "macro_sql": "{% macro add_pass_through_columns(base_columns, pass_through_var) %}\n\n {% if pass_through_var %}\n\n {% for column in pass_through_var %}\n\n {% if column.alias %}\n\n {% do base_columns.append({ \"name\": column.name, \"alias\": column.alias, \"datatype\": column.datatype if column.datatype else dbt_utils.type_string()}) %}\n\n {% else %}\n\n {% do base_columns.append({ \"name\": column.name, \"datatype\": column.datatype if column.datatype else dbt_utils.type_string()}) %}\n \n {% endif %}\n\n {% endfor %}\n\n {% endif %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.type_string"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600953.168385}, "macro.fivetran_utils.union_relations": {"unique_id": "macro.fivetran_utils.union_relations", "package_name": "fivetran_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/fivetran_utils", "path": "macros/union_relations.sql", "original_file_path": "macros/union_relations.sql", "name": "union_relations", "macro_sql": "{%- macro union_relations(relations, aliases=none, column_override=none, include=[], exclude=[], source_column_name=none) -%}\n\n {%- if exclude and include -%}\n {{ exceptions.raise_compiler_error(\"Both an exclude and include list were provided to the `union` macro. Only one is allowed\") }}\n {%- endif -%}\n\n {#-- Prevent querying of db in parsing mode. This works because this macro does not create any new refs. -#}\n {%- if not execute %}\n {{ return('') }}\n {% endif -%}\n\n {%- set column_override = column_override if column_override is not none else {} -%}\n {%- set source_column_name = source_column_name if source_column_name is not none else '_dbt_source_relation' -%}\n\n {%- set relation_columns = {} -%}\n {%- set column_superset = {} -%}\n\n {%- for relation in relations -%}\n\n {%- do relation_columns.update({relation: []}) -%}\n\n {%- do dbt_utils._is_relation(relation, 'union_relations') -%}\n {%- set cols = adapter.get_columns_in_relation(relation) -%}\n {%- for col in cols -%}\n\n {#- If an exclude list was provided and the column is in the list, do nothing -#}\n {%- if exclude and col.column in exclude -%}\n\n {#- If an include list was provided and the column is not in the list, do nothing -#}\n {%- elif include and col.column not in include -%}\n\n {#- Otherwise add the column to the column superset -#}\n {%- else -%}\n\n {#- update the list of columns in this relation -#}\n {%- do relation_columns[relation].append(col.column) -%}\n\n {%- if col.column in column_superset -%}\n\n {%- set stored = column_superset[col.column] -%}\n {%- if col.is_string() and stored.is_string() and col.string_size() > stored.string_size() -%}\n\n {%- do column_superset.update({col.column: col}) -%}\n\n {%- endif %}\n\n {%- else -%}\n\n {%- do column_superset.update({col.column: col}) -%}\n\n {%- endif -%}\n\n {%- endif -%}\n\n {%- endfor -%}\n {%- endfor -%}\n\n {%- set ordered_column_names = column_superset.keys() -%}\n\n {%- for relation in relations %}\n\n (\n select\n\n cast({{ dbt_utils.string_literal(relation) }} as {{ dbt_utils.type_string() }}) as {{ source_column_name }},\n {% for col_name in ordered_column_names -%}\n\n {%- set col = column_superset[col_name] %}\n {%- set col_type = column_override.get(col.column, col.data_type) %}\n {%- set col_name = adapter.quote(col_name) if col_name in relation_columns[relation] else 'null' %}\n cast({{ col_name }} as {{ col_type }}) as {{ col.quoted }} {% if not loop.last %},{% endif -%}\n\n {%- endfor %}\n\n from {{ aliases[loop.index0] if aliases else relation }}\n )\n\n {% if not loop.last -%}\n union all\n {% endif -%}\n\n {%- endfor -%}\n\n{%- endmacro -%}\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils._is_relation", "macro.dbt_utils.string_literal", "macro.dbt_utils.type_string"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600953.172158}, "macro.fivetran_utils.union_tables": {"unique_id": "macro.fivetran_utils.union_tables", "package_name": "fivetran_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/fivetran_utils", "path": "macros/union_relations.sql", "original_file_path": "macros/union_relations.sql", "name": "union_tables", "macro_sql": "{%- macro union_tables(tables, column_override=none, include=[], exclude=[], source_column_name='_dbt_source_table') -%}\n\n {%- do exceptions.warn(\"Warning: the `union_tables` macro is no longer supported and will be deprecated in a future release of dbt-utils. Use the `union_relations` macro instead\") -%}\n\n {{ return(dbt_utils.union_relations(tables, column_override, include, exclude, source_column_name)) }}\n\n{%- endmacro -%}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.union_relations"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600953.17251}, "macro.fivetran_utils.snowflake_seed_data": {"unique_id": "macro.fivetran_utils.snowflake_seed_data", "package_name": "fivetran_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/fivetran_utils", "path": "macros/snowflake_seed_data.sql", "original_file_path": "macros/snowflake_seed_data.sql", "name": "snowflake_seed_data", "macro_sql": "{% macro snowflake_seed_data(seed_name) %}\n\n{% if target.type == 'snowflake' %}\n{{ return(ref(seed_name ~ '_snowflake')) }}\n{% else %}\n{{ return(ref(seed_name)) }}\n{% endif %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600953.1729379}, "macro.fivetran_utils.fill_staging_columns": {"unique_id": "macro.fivetran_utils.fill_staging_columns", "package_name": "fivetran_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/fivetran_utils", "path": "macros/fill_staging_columns.sql", "original_file_path": "macros/fill_staging_columns.sql", "name": "fill_staging_columns", "macro_sql": "{% macro fill_staging_columns(source_columns, staging_columns) -%}\n\n{%- set source_column_names = source_columns|map(attribute='name')|map('lower')|list -%}\n\n{%- for column in staging_columns %}\n {% if column.name|lower in source_column_names -%}\n {{ fivetran_utils.quote_column(column) }} as \n {%- if 'alias' in column %} {{ column.alias }} {% else %} {{ fivetran_utils.quote_column(column) }} {%- endif -%}\n {%- else -%}\n cast(null as {{ column.datatype }})\n {%- if 'alias' in column %} as {{ column.alias }} {% else %} as {{ fivetran_utils.quote_column(column) }} {% endif -%}\n {%- endif -%}\n {%- if not loop.last -%} , {% endif -%}\n{% endfor %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.fivetran_utils.quote_column"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600953.17445}, "macro.fivetran_utils.quote_column": {"unique_id": "macro.fivetran_utils.quote_column", "package_name": "fivetran_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/fivetran_utils", "path": "macros/fill_staging_columns.sql", "original_file_path": "macros/fill_staging_columns.sql", "name": "quote_column", "macro_sql": "{% macro quote_column(column) %}\n {% if 'quote' in column %}\n {% if column.quote %}\n {% if target.type in ('bigquery', 'spark') %}\n `{{ column.name }}`\n {% elif target.type == 'snowflake' %}\n \"{{ column.name | upper }}\"\n {% else %}\n \"{{ column.name }}\"\n {% endif %}\n {% else %}\n {{ column.name }}\n {% endif %}\n {% else %}\n {{ column.name }}\n {% endif %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600953.1749911}, "macro.fivetran_utils.json_extract": {"unique_id": "macro.fivetran_utils.json_extract", "package_name": "fivetran_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/fivetran_utils", "path": "macros/json_extract.sql", "original_file_path": "macros/json_extract.sql", "name": "json_extract", "macro_sql": "{% macro json_extract(string, string_path) -%}\n\n{{ adapter.dispatch('json_extract', 'fivetran_utils') (string, string_path) }}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.fivetran_utils.bigquery__json_extract"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600953.175581}, "macro.fivetran_utils.default__json_extract": {"unique_id": "macro.fivetran_utils.default__json_extract", "package_name": "fivetran_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/fivetran_utils", "path": "macros/json_extract.sql", "original_file_path": "macros/json_extract.sql", "name": "default__json_extract", "macro_sql": "{% macro default__json_extract(string, string_path) %}\n\n json_extract_path_text({{string}}, {{ \"'\" ~ string_path ~ \"'\" }} )\n \n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600953.175734}, "macro.fivetran_utils.snowflake__json_extract": {"unique_id": "macro.fivetran_utils.snowflake__json_extract", "package_name": "fivetran_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/fivetran_utils", "path": "macros/json_extract.sql", "original_file_path": "macros/json_extract.sql", "name": "snowflake__json_extract", "macro_sql": "{% macro snowflake__json_extract(string, string_path) %}\n\n json_extract_path_text(try_parse_json( {{string}} ), {{ \"'\" ~ string_path ~ \"'\" }} )\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600953.175882}, "macro.fivetran_utils.redshift__json_extract": {"unique_id": "macro.fivetran_utils.redshift__json_extract", "package_name": "fivetran_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/fivetran_utils", "path": "macros/json_extract.sql", "original_file_path": "macros/json_extract.sql", "name": "redshift__json_extract", "macro_sql": "{% macro redshift__json_extract(string, string_path) %}\n\n case when is_valid_json( {{string}} ) then json_extract_path_text({{string}}, {{ \"'\" ~ string_path ~ \"'\" }} ) else null end\n \n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600953.176045}, "macro.fivetran_utils.bigquery__json_extract": {"unique_id": "macro.fivetran_utils.bigquery__json_extract", "package_name": "fivetran_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/fivetran_utils", "path": "macros/json_extract.sql", "original_file_path": "macros/json_extract.sql", "name": "bigquery__json_extract", "macro_sql": "{% macro bigquery__json_extract(string, string_path) %}\n\n json_extract_scalar({{string}}, {{ \"'$.\" ~ string_path ~ \"'\" }} )\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600953.176192}, "macro.fivetran_utils.postgres__json_extract": {"unique_id": "macro.fivetran_utils.postgres__json_extract", "package_name": "fivetran_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/fivetran_utils", "path": "macros/json_extract.sql", "original_file_path": "macros/json_extract.sql", "name": "postgres__json_extract", "macro_sql": "{% macro postgres__json_extract(string, string_path) %}\n\n {{string}}::json->>{{\"'\" ~ string_path ~ \"'\" }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600953.176351}, "macro.fivetran_utils.collect_freshness": {"unique_id": "macro.fivetran_utils.collect_freshness", "package_name": "fivetran_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/fivetran_utils", "path": "macros/collect_freshness.sql", "original_file_path": "macros/collect_freshness.sql", "name": "collect_freshness", "macro_sql": "{% macro collect_freshness(source, loaded_at_field, filter) %}\n {{ return(adapter.dispatch('collect_freshness')(source, loaded_at_field, filter))}}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.fivetran_utils.default__collect_freshness"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600953.1770601}, "macro.fivetran_utils.default__collect_freshness": {"unique_id": "macro.fivetran_utils.default__collect_freshness", "package_name": "fivetran_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/fivetran_utils", "path": "macros/collect_freshness.sql", "original_file_path": "macros/collect_freshness.sql", "name": "default__collect_freshness", "macro_sql": "{% macro default__collect_freshness(source, loaded_at_field, filter) %}\n {% call statement('collect_freshness', fetch_result=True, auto_begin=False) -%}\n\n {%- set enabled_array = [] -%}\n {% for node in graph.sources.values() %}\n {% if node.identifier == source.identifier %}\n {% if (node.meta['is_enabled'] | default(true)) %}\n {%- do enabled_array.append(1) -%}\n {% endif %}\n {% endif %}\n {% endfor %}\n {% set is_enabled = (enabled_array != []) %}\n\n select\n {% if is_enabled %}\n max({{ loaded_at_field }})\n {% else %} \n {{ current_timestamp() }} {% endif %} as max_loaded_at,\n {{ current_timestamp() }} as snapshotted_at\n\n {% if is_enabled %}\n from {{ source }}\n {% if filter %}\n where {{ filter }}\n {% endif %}\n {% endif %}\n\n {% endcall %}\n {{ return(load_result('collect_freshness').table) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.statement", "macro.dbt_utils.current_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600953.178008}, "macro.fivetran_utils.timestamp_add": {"unique_id": "macro.fivetran_utils.timestamp_add", "package_name": "fivetran_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/fivetran_utils", "path": "macros/timestamp_add.sql", "original_file_path": "macros/timestamp_add.sql", "name": "timestamp_add", "macro_sql": "{% macro timestamp_add(datepart, interval, from_timestamp) -%}\n\n{{ adapter.dispatch('timestamp_add', 'fivetran_utils') (datepart, interval, from_timestamp) }}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.fivetran_utils.bigquery__timestamp_add"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600953.178715}, "macro.fivetran_utils.default__timestamp_add": {"unique_id": "macro.fivetran_utils.default__timestamp_add", "package_name": "fivetran_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/fivetran_utils", "path": "macros/timestamp_add.sql", "original_file_path": "macros/timestamp_add.sql", "name": "default__timestamp_add", "macro_sql": "{% macro default__timestamp_add(datepart, interval, from_timestamp) %}\n\n timestampadd(\n {{ datepart }},\n {{ interval }},\n {{ from_timestamp }}\n )\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600953.1788769}, "macro.fivetran_utils.bigquery__timestamp_add": {"unique_id": "macro.fivetran_utils.bigquery__timestamp_add", "package_name": "fivetran_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/fivetran_utils", "path": "macros/timestamp_add.sql", "original_file_path": "macros/timestamp_add.sql", "name": "bigquery__timestamp_add", "macro_sql": "{% macro bigquery__timestamp_add(datepart, interval, from_timestamp) %}\n\n timestamp_add({{ from_timestamp }}, interval {{ interval }} {{ datepart }})\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600953.179028}, "macro.fivetran_utils.redshift__timestamp_add": {"unique_id": "macro.fivetran_utils.redshift__timestamp_add", "package_name": "fivetran_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/fivetran_utils", "path": "macros/timestamp_add.sql", "original_file_path": "macros/timestamp_add.sql", "name": "redshift__timestamp_add", "macro_sql": "{% macro redshift__timestamp_add(datepart, interval, from_timestamp) %}\n\n dateadd(\n {{ datepart }},\n {{ interval }},\n {{ from_timestamp }}\n )\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600953.179185}, "macro.fivetran_utils.postgres__timestamp_add": {"unique_id": "macro.fivetran_utils.postgres__timestamp_add", "package_name": "fivetran_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/fivetran_utils", "path": "macros/timestamp_add.sql", "original_file_path": "macros/timestamp_add.sql", "name": "postgres__timestamp_add", "macro_sql": "{% macro postgres__timestamp_add(datepart, interval, from_timestamp) %}\n\n {{ from_timestamp }} + ((interval '1 {{ datepart }}') * ({{ interval }}))\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600953.1793349}, "macro.fivetran_utils.spark__timestamp_add": {"unique_id": "macro.fivetran_utils.spark__timestamp_add", "package_name": "fivetran_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/fivetran_utils", "path": "macros/timestamp_add.sql", "original_file_path": "macros/timestamp_add.sql", "name": "spark__timestamp_add", "macro_sql": "{% macro spark__timestamp_add(datepart, interval, from_timestamp) %}\n\n {{ dbt_utils.dateadd(datepart, interval, from_timestamp) }}\n \n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.dateadd"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600953.179672}, "macro.fivetran_utils.ceiling": {"unique_id": "macro.fivetran_utils.ceiling", "package_name": "fivetran_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/fivetran_utils", "path": "macros/ceiling.sql", "original_file_path": "macros/ceiling.sql", "name": "ceiling", "macro_sql": "{% macro ceiling(num) -%}\n\n{{ adapter.dispatch('ceiling', 'fivetran_utils') (num) }}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.fivetran_utils.default__ceiling"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600953.179976}, "macro.fivetran_utils.default__ceiling": {"unique_id": "macro.fivetran_utils.default__ceiling", "package_name": "fivetran_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/fivetran_utils", "path": "macros/ceiling.sql", "original_file_path": "macros/ceiling.sql", "name": "default__ceiling", "macro_sql": "{% macro default__ceiling(num) %}\n ceiling({{ num }})\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600953.1800718}, "macro.fivetran_utils.snowflake__ceiling": {"unique_id": "macro.fivetran_utils.snowflake__ceiling", "package_name": "fivetran_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/fivetran_utils", "path": "macros/ceiling.sql", "original_file_path": "macros/ceiling.sql", "name": "snowflake__ceiling", "macro_sql": "{% macro snowflake__ceiling(num) %}\n ceil({{ num }})\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600953.180166}, "macro.fivetran_utils.remove_prefix_from_columns": {"unique_id": "macro.fivetran_utils.remove_prefix_from_columns", "package_name": "fivetran_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/fivetran_utils", "path": "macros/remove_prefix_from_columns.sql", "original_file_path": "macros/remove_prefix_from_columns.sql", "name": "remove_prefix_from_columns", "macro_sql": "{% macro remove_prefix_from_columns(columns, prefix='', exclude=[]) %}\n\n {%- for col in columns if col.name not in exclude -%}\n {%- if col.name[:prefix|length]|lower == prefix -%}\n {{ col.name }} as {{ col.name[prefix|length:] }}\n {%- else -%}\n {{ col.name }}\n {%- endif -%}\n {%- if not loop.last -%},{%- endif %}\n {% endfor -%}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600953.180846}, "macro.fivetran_utils.union_data": {"unique_id": "macro.fivetran_utils.union_data", "package_name": "fivetran_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/fivetran_utils", "path": "macros/union_data.sql", "original_file_path": "macros/union_data.sql", "name": "union_data", "macro_sql": "{% macro union_data(table_identifier, database_variable, schema_variable, default_database, default_schema, default_variable, union_schema_variable='union_schemas', union_database_variable='union_databases') -%}\n\n{{ adapter.dispatch('union_data', 'fivetran_utils') (\n table_identifier, \n database_variable, \n schema_variable, \n default_database, \n default_schema, \n default_variable,\n union_schema_variable,\n union_database_variable\n ) }}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.fivetran_utils.default__union_data"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600953.182034}, "macro.fivetran_utils.default__union_data": {"unique_id": "macro.fivetran_utils.default__union_data", "package_name": "fivetran_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/fivetran_utils", "path": "macros/union_data.sql", "original_file_path": "macros/union_data.sql", "name": "default__union_data", "macro_sql": "{% macro default__union_data(\n table_identifier, \n database_variable, \n schema_variable, \n default_database, \n default_schema, \n default_variable,\n union_schema_variable,\n union_database_variable\n ) %}\n\n{% if var(union_schema_variable, none) %}\n\n {% set relations = [] %}\n \n {% if var(union_schema_variable) is string %}\n {% set trimmed = var(union_schema_variable)|trim('[')|trim(']') %}\n {% set schemas = trimmed.split(',')|map('trim',\" \")|map('trim','\"')|map('trim',\"'\") %}\n {% else %}\n {% set schemas = var(union_schema_variable) %}\n {% endif %}\n\n {% for schema in var(union_schema_variable) %}\n\n {% set relation=adapter.get_relation(\n database=var(database_variable, default_database),\n schema=schema,\n identifier=table_identifier\n ) -%}\n \n {% set relation_exists=relation is not none %}\n\n {% if relation_exists %}\n\n {% do relations.append(relation) %}\n \n {% endif %}\n\n {% endfor %}\n\n {{ dbt_utils.union_relations(relations) }}\n\n{% elif var(union_database_variable, none) %}\n\n {% set relations = [] %}\n\n {% for database in var(union_database_variable) %}\n\n {% set relation=adapter.get_relation(\n database=database,\n schema=var(schema_variable, default_schema),\n identifier=table_identifier\n ) -%}\n\n {% set relation_exists=relation is not none %}\n\n {% if relation_exists %}\n\n {% do relations.append(relation) %}\n \n {% endif %}\n\n {% endfor %}\n\n {{ dbt_utils.union_relations(relations) }}\n\n{% else %}\n\n select * \n from {{ var(default_variable) }}\n\n{% endif %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.union_relations"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600953.183723}, "macro.fivetran_utils.dummy_coalesce_value": {"unique_id": "macro.fivetran_utils.dummy_coalesce_value", "package_name": "fivetran_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/fivetran_utils", "path": "macros/dummy_coalesce_value.sql", "original_file_path": "macros/dummy_coalesce_value.sql", "name": "dummy_coalesce_value", "macro_sql": "{% macro dummy_coalesce_value(column) %}\n\n{% set coalesce_value = {\n 'STRING': \"'DUMMY_STRING'\",\n 'BOOLEAN': 'null',\n 'INT': 999999999,\n 'FLOAT': 999999999.99,\n 'TIMESTAMP': 'cast(\"2099-12-31\" as timestamp)',\n 'DATE': 'cast(\"2099-12-31\" as date)',\n} %}\n\n{% if column.is_float() %}\n{{ return(coalesce_value['FLOAT']) }}\n\n{% elif column.is_numeric() %}\n{{ return(coalesce_value['INT']) }}\n\n{% elif column.is_string() %}\n{{ return(coalesce_value['STRING']) }}\n\n{% elif column.data_type|lower == 'boolean' %}\n{{ return(coalesce_value['BOOLEAN']) }}\n\n{% elif 'timestamp' in column.data_type|lower %}\n{{ return(coalesce_value['TIMESTAMP']) }}\n\n{% elif 'date' in column.data_type|lower %}\n{{ return(coalesce_value['DATE']) }}\n\n{% elif 'int' in column.data_type|lower %}\n{{ return(coalesce_value['INT']) }}\n\n{% endif %}\n\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600953.185139}, "macro.fivetran_utils.array_agg": {"unique_id": "macro.fivetran_utils.array_agg", "package_name": "fivetran_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/fivetran_utils", "path": "macros/array_agg.sql", "original_file_path": "macros/array_agg.sql", "name": "array_agg", "macro_sql": "{% macro array_agg(field_to_agg) -%}\n\n{{ adapter.dispatch('array_agg', 'fivetran_utils') (field_to_agg) }}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.fivetran_utils.default__array_agg"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600953.185462}, "macro.fivetran_utils.default__array_agg": {"unique_id": "macro.fivetran_utils.default__array_agg", "package_name": "fivetran_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/fivetran_utils", "path": "macros/array_agg.sql", "original_file_path": "macros/array_agg.sql", "name": "default__array_agg", "macro_sql": "{% macro default__array_agg(field_to_agg) %}\n array_agg({{ field_to_agg }})\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600953.18556}, "macro.fivetran_utils.redshift__array_agg": {"unique_id": "macro.fivetran_utils.redshift__array_agg", "package_name": "fivetran_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/fivetran_utils", "path": "macros/array_agg.sql", "original_file_path": "macros/array_agg.sql", "name": "redshift__array_agg", "macro_sql": "{% macro redshift__array_agg(field_to_agg) %}\n listagg({{ field_to_agg }}, ',')\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600953.185659}, "macro.fivetran_utils.empty_variable_warning": {"unique_id": "macro.fivetran_utils.empty_variable_warning", "package_name": "fivetran_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/fivetran_utils", "path": "macros/empty_variable_warning.sql", "original_file_path": "macros/empty_variable_warning.sql", "name": "empty_variable_warning", "macro_sql": "{% macro empty_variable_warning(variable, downstream_model) %}\n\n{% if not var(variable) %}\n{{ log(\n \"\"\"\n Warning: You have passed an empty list to the \"\"\" ~ variable ~ \"\"\".\n As a result, you won't see the history of any columns in the \"\"\" ~ downstream_model ~ \"\"\" model.\n \"\"\",\n info=True\n) }}\n{% endif %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600953.186101}, "macro.fivetran_utils.enabled_vars_one_true": {"unique_id": "macro.fivetran_utils.enabled_vars_one_true", "package_name": "fivetran_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/fivetran_utils", "path": "macros/enabled_vars_one_true.sql", "original_file_path": "macros/enabled_vars_one_true.sql", "name": "enabled_vars_one_true", "macro_sql": "{% macro enabled_vars_one_true(vars) %}\n\n{% for v in vars %}\n \n {% if var(v, False) == True %}\n {{ return(True) }}\n {% endif %}\n\n{% endfor %}\n\n{{ return(False) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1663600953.1865442}}, "docs": {"dbt.__overview__": {"unique_id": "dbt.__overview__", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.2.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "overview.md", "original_file_path": "docs/overview.md", "name": "__overview__", "block_contents": "### Welcome!\n\nWelcome to the auto-generated documentation for your dbt project!\n\n### Navigation\n\nYou can use the `Project` and `Database` navigation tabs on the left side of the window to explore the models\nin your project.\n\n#### Project Tab\nThe `Project` tab mirrors the directory structure of your dbt project. In this tab, you can see all of the\nmodels defined in your dbt project, as well as models imported from dbt packages.\n\n#### Database Tab\nThe `Database` tab also exposes your models, but in a format that looks more like a database explorer. This view\nshows relations (tables and views) grouped into database schemas. Note that ephemeral models are _not_ shown\nin this interface, as they do not exist in the database.\n\n### Graph Exploration\nYou can click the blue icon on the bottom-right corner of the page to view the lineage graph of your models.\n\nOn model pages, you'll see the immediate parents and children of the model you're exploring. By clicking the `Expand`\nbutton at the top-right of this lineage pane, you'll be able to see all of the models that are used to build,\nor are built from, the model you're exploring.\n\nOnce expanded, you'll be able to use the `--select` and `--exclude` model selection syntax to filter the\nmodels in the graph. For more information on model selection, check out the [dbt docs](https://docs.getdbt.com/docs/model-selection-syntax).\n\nNote that you can also right-click on models to interactively filter and explore the graph.\n\n---\n\n### More information\n\n- [What is dbt](https://docs.getdbt.com/docs/introduction)?\n- Read the [dbt viewpoint](https://docs.getdbt.com/docs/viewpoint)\n- [Installation](https://docs.getdbt.com/docs/installation)\n- Join the [dbt Community](https://www.getdbt.com/community/) for questions and discussion"}}, "exposures": {}, "metrics": {}, "selectors": {}, "disabled": {}, "parent_map": {"seed.asana_integration_tests.project_task_data": [], "seed.asana_integration_tests.story_data": [], "seed.asana_integration_tests.task_tag_data": [], "seed.asana_integration_tests.task_section_data": [], "seed.asana_integration_tests.task_data": [], "seed.asana_integration_tests.task_follower_data": [], "seed.asana_integration_tests.tag_data": [], "seed.asana_integration_tests.project_data": [], "seed.asana_integration_tests.user_data": [], "seed.asana_integration_tests.team_data": [], "seed.asana_integration_tests.section_data": [], "model.asana_source.stg_asana__user": ["model.asana_source.stg_asana__user_tmp", "model.asana_source.stg_asana__user_tmp"], "model.asana_source.stg_asana__task": ["model.asana_source.stg_asana__task_tmp", "model.asana_source.stg_asana__task_tmp"], "model.asana_source.stg_asana__task_section": ["model.asana_source.stg_asana__task_section_tmp", "model.asana_source.stg_asana__task_section_tmp"], "model.asana_source.stg_asana__section": ["model.asana_source.stg_asana__section_tmp", "model.asana_source.stg_asana__section_tmp"], "model.asana_source.stg_asana__team": ["model.asana_source.stg_asana__team_tmp", "model.asana_source.stg_asana__team_tmp"], "model.asana_source.stg_asana__task_tag": ["model.asana_source.stg_asana__task_tag_tmp", "model.asana_source.stg_asana__task_tag_tmp"], "model.asana_source.stg_asana__story": ["model.asana_source.stg_asana__story_tmp", "model.asana_source.stg_asana__story_tmp"], "model.asana_source.stg_asana__tag": ["model.asana_source.stg_asana__tag_tmp", "model.asana_source.stg_asana__tag_tmp"], "model.asana_source.stg_asana__project_task": ["model.asana_source.stg_asana__project_task_tmp", "model.asana_source.stg_asana__project_task_tmp"], "model.asana_source.stg_asana__project": ["model.asana_source.stg_asana__project_tmp", "model.asana_source.stg_asana__project_tmp"], "model.asana_source.stg_asana__task_follower": ["model.asana_source.stg_asana__task_follower_tmp", "model.asana_source.stg_asana__task_follower_tmp"], "model.asana_source.stg_asana__story_tmp": ["source.asana_source.asana.story"], "model.asana_source.stg_asana__team_tmp": ["source.asana_source.asana.team"], "model.asana_source.stg_asana__task_tmp": ["source.asana_source.asana.task"], "model.asana_source.stg_asana__task_follower_tmp": ["source.asana_source.asana.task_follower"], "model.asana_source.stg_asana__tag_tmp": ["source.asana_source.asana.tag"], "model.asana_source.stg_asana__task_section_tmp": ["source.asana_source.asana.task_section"], "model.asana_source.stg_asana__task_tag_tmp": ["source.asana_source.asana.task_tag"], "model.asana_source.stg_asana__user_tmp": ["source.asana_source.asana.user"], "model.asana_source.stg_asana__section_tmp": ["source.asana_source.asana.section"], "model.asana_source.stg_asana__project_tmp": ["source.asana_source.asana.project"], "model.asana_source.stg_asana__project_task_tmp": ["source.asana_source.asana.project_task"], "model.asana.asana__daily_metrics": ["model.asana.asana__task"], "model.asana.asana__user": ["model.asana.int_asana__project_user", "model.asana.int_asana__user_task_metrics", "model.asana_source.stg_asana__user"], "model.asana.asana__task": ["model.asana.int_asana__subtask_parent", "model.asana.int_asana__task_assignee", "model.asana.int_asana__task_comments", "model.asana.int_asana__task_first_modifier", "model.asana.int_asana__task_followers", "model.asana.int_asana__task_open_length", "model.asana.int_asana__task_projects", "model.asana.int_asana__task_tags", "model.asana_source.stg_asana__task"], "model.asana.asana__team": ["model.asana.asana__project", "model.asana_source.stg_asana__team"], "model.asana.asana__project": ["model.asana.int_asana__project_task_metrics", "model.asana.int_asana__project_user", "model.asana_source.stg_asana__project", "model.asana_source.stg_asana__section", "model.asana_source.stg_asana__team", "model.asana_source.stg_asana__user"], "model.asana.asana__tag": ["model.asana.asana__task", "model.asana_source.stg_asana__tag", "model.asana_source.stg_asana__task_tag"], "model.asana.int_asana__task_comments": ["model.asana.int_asana__task_story"], "model.asana.int_asana__project_task_metrics": ["model.asana.asana__task", "model.asana_source.stg_asana__project", "model.asana_source.stg_asana__project_task"], "model.asana.int_asana__user_task_metrics": ["model.asana.asana__task"], "model.asana.int_asana__task_tags": ["model.asana_source.stg_asana__tag", "model.asana_source.stg_asana__task_tag"], "model.asana.int_asana__task_open_length": ["model.asana.int_asana__task_story", "model.asana_source.stg_asana__task"], "model.asana.int_asana__task_followers": ["model.asana_source.stg_asana__task_follower", "model.asana_source.stg_asana__user"], "model.asana.int_asana__project_user": ["model.asana.int_asana__task_assignee", "model.asana_source.stg_asana__project", "model.asana_source.stg_asana__project_task"], "model.asana.int_asana__task_first_modifier": ["model.asana.int_asana__task_story"], "model.asana.int_asana__task_projects": ["model.asana_source.stg_asana__project", "model.asana_source.stg_asana__project_task", "model.asana_source.stg_asana__section", "model.asana_source.stg_asana__task_section"], "model.asana.int_asana__task_assignee": ["model.asana_source.stg_asana__task", "model.asana_source.stg_asana__user"], "model.asana.int_asana__subtask_parent": ["model.asana.int_asana__task_assignee"], "model.asana.int_asana__task_story": ["model.asana_source.stg_asana__story", "model.asana_source.stg_asana__user"], "test.asana_source.unique_stg_asana__project_project_id.67bfab1228": ["model.asana_source.stg_asana__project"], "test.asana_source.not_null_stg_asana__project_project_id.d27dae84fa": ["model.asana_source.stg_asana__project"], "test.asana_source.not_null_stg_asana__project_task_project_id.e2450d16b1": ["model.asana_source.stg_asana__project_task"], "test.asana_source.not_null_stg_asana__project_task_task_id.9479566014": ["model.asana_source.stg_asana__project_task"], "test.asana_source.unique_stg_asana__section_section_id.0495dd3d2f": ["model.asana_source.stg_asana__section"], "test.asana_source.not_null_stg_asana__section_section_id.389ebce958": ["model.asana_source.stg_asana__section"], "test.asana_source.unique_stg_asana__story_story_id.414f25bb84": ["model.asana_source.stg_asana__story"], "test.asana_source.not_null_stg_asana__story_story_id.ca847d0848": ["model.asana_source.stg_asana__story"], "test.asana_source.not_null_stg_asana__story_target_task_id.3f971de06e": ["model.asana_source.stg_asana__story"], "test.asana_source.unique_stg_asana__tag_tag_id.fd78b190c7": ["model.asana_source.stg_asana__tag"], "test.asana_source.not_null_stg_asana__tag_tag_id.c6a8187ca2": ["model.asana_source.stg_asana__tag"], "test.asana_source.unique_stg_asana__task_task_id.a5271275a5": ["model.asana_source.stg_asana__task"], "test.asana_source.not_null_stg_asana__task_task_id.924cc69000": ["model.asana_source.stg_asana__task"], "test.asana_source.not_null_stg_asana__task_follower_task_id.5af35f322c": ["model.asana_source.stg_asana__task_follower"], "test.asana_source.not_null_stg_asana__task_follower_user_id.e0aea0b15e": ["model.asana_source.stg_asana__task_follower"], "test.asana_source.not_null_stg_asana__task_section_task_id.ab81301de8": ["model.asana_source.stg_asana__task_section"], "test.asana_source.not_null_stg_asana__task_section_section_id.b0977a4cfe": ["model.asana_source.stg_asana__task_section"], "test.asana_source.not_null_stg_asana__task_tag_tag_id.d523de41d8": ["model.asana_source.stg_asana__task_tag"], "test.asana_source.not_null_stg_asana__task_tag_task_id.9d27624748": ["model.asana_source.stg_asana__task_tag"], "test.asana_source.unique_stg_asana__team_team_id.111fe15873": ["model.asana_source.stg_asana__team"], "test.asana_source.not_null_stg_asana__team_team_id.e12b563474": ["model.asana_source.stg_asana__team"], "test.asana_source.unique_stg_asana__user_user_id.73808d6267": ["model.asana_source.stg_asana__user"], "test.asana_source.not_null_stg_asana__user_user_id.4e900e8ec6": ["model.asana_source.stg_asana__user"], "test.asana.unique_asana__task_task_id.ebfe331df1": ["model.asana.asana__task"], "test.asana.not_null_asana__task_task_id.6d36eb2cd0": ["model.asana.asana__task"], "test.asana.unique_asana__user_user_id.3c4b63387e": ["model.asana.asana__user"], "test.asana.not_null_asana__user_user_id.eb9cd93a43": ["model.asana.asana__user"], "test.asana.unique_asana__project_project_id.66a76364ef": ["model.asana.asana__project"], "test.asana.not_null_asana__project_project_id.78420e1b45": ["model.asana.asana__project"], "test.asana.unique_asana__team_team_id.ada6b5e093": ["model.asana.asana__team"], "test.asana.not_null_asana__team_team_id.cd6b6c88bf": ["model.asana.asana__team"], "test.asana.unique_asana__tag_tag_id.46c0d2510f": ["model.asana.asana__tag"], "test.asana.not_null_asana__tag_tag_id.593d626953": ["model.asana.asana__tag"], "test.asana.unique_asana__daily_metrics_date_day.e8d67f545d": ["model.asana.asana__daily_metrics"], "test.asana.not_null_asana__daily_metrics_date_day.363a2a09cf": ["model.asana.asana__daily_metrics"], "test.asana.unique_int_asana__project_task_metrics_project_id.049cc9b8a6": ["model.asana.int_asana__project_task_metrics"], "test.asana.not_null_int_asana__project_task_metrics_project_id.804fd1daf3": ["model.asana.int_asana__project_task_metrics"], "test.asana.dbt_utils_unique_combination_of_columns_int_asana__project_user_project_id__user_id__role__currently_working_on.f9493098e0": ["model.asana.int_asana__project_user"], "test.asana.unique_int_asana__subtask_parent_subtask_id.641dfb3c8f": ["model.asana.int_asana__subtask_parent"], "test.asana.not_null_int_asana__subtask_parent_subtask_id.024565c768": ["model.asana.int_asana__subtask_parent"], "test.asana.unique_int_asana__task_assignee_task_id.b4e2ea04e1": ["model.asana.int_asana__task_assignee"], "test.asana.not_null_int_asana__task_assignee_task_id.a9c81bd443": ["model.asana.int_asana__task_assignee"], "test.asana.unique_int_asana__task_comments_task_id.f012fa6a04": ["model.asana.int_asana__task_comments"], "test.asana.not_null_int_asana__task_comments_task_id.6986f1d77f": ["model.asana.int_asana__task_comments"], "test.asana.unique_int_asana__task_first_modifier_task_id.59583c6dc2": ["model.asana.int_asana__task_first_modifier"], "test.asana.not_null_int_asana__task_first_modifier_task_id.495738ff52": ["model.asana.int_asana__task_first_modifier"], "test.asana.unique_int_asana__task_followers_task_id.eeb3667df9": ["model.asana.int_asana__task_followers"], "test.asana.not_null_int_asana__task_followers_task_id.6791bf2573": ["model.asana.int_asana__task_followers"], "test.asana.unique_int_asana__task_open_length_task_id.f26c49b044": ["model.asana.int_asana__task_open_length"], "test.asana.not_null_int_asana__task_open_length_task_id.23bb23b2e9": ["model.asana.int_asana__task_open_length"], "test.asana.unique_int_asana__task_projects_task_id.8a6b2f262d": ["model.asana.int_asana__task_projects"], "test.asana.not_null_int_asana__task_projects_task_id.322519ee10": ["model.asana.int_asana__task_projects"], "test.asana.unique_int_asana__task_story_story_id.92d7adbcf6": ["model.asana.int_asana__task_story"], "test.asana.not_null_int_asana__task_story_story_id.1ffdb99927": ["model.asana.int_asana__task_story"], "test.asana.unique_int_asana__task_tags_task_id.f28aff2685": ["model.asana.int_asana__task_tags"], "test.asana.not_null_int_asana__task_tags_task_id.34eec2b834": ["model.asana.int_asana__task_tags"], "test.asana.unique_int_asana__user_task_metrics_user_id.06a6a270b8": ["model.asana.int_asana__user_task_metrics"], "test.asana.not_null_int_asana__user_task_metrics_user_id.54eae7d721": ["model.asana.int_asana__user_task_metrics"], "source.asana_source.asana.user": [], "source.asana_source.asana.task": [], "source.asana_source.asana.project": [], "source.asana_source.asana.story": [], "source.asana_source.asana.team": [], "source.asana_source.asana.tag": [], "source.asana_source.asana.section": [], "source.asana_source.asana.project_task": [], "source.asana_source.asana.task_follower": [], "source.asana_source.asana.task_tag": [], "source.asana_source.asana.task_section": []}, "child_map": {"seed.asana_integration_tests.project_task_data": [], "seed.asana_integration_tests.story_data": [], "seed.asana_integration_tests.task_tag_data": [], "seed.asana_integration_tests.task_section_data": [], "seed.asana_integration_tests.task_data": [], "seed.asana_integration_tests.task_follower_data": [], "seed.asana_integration_tests.tag_data": [], "seed.asana_integration_tests.project_data": [], "seed.asana_integration_tests.user_data": [], "seed.asana_integration_tests.team_data": [], "seed.asana_integration_tests.section_data": [], "model.asana_source.stg_asana__user": ["model.asana.asana__project", "model.asana.asana__user", "model.asana.int_asana__task_assignee", "model.asana.int_asana__task_followers", "model.asana.int_asana__task_story", "test.asana_source.not_null_stg_asana__user_user_id.4e900e8ec6", "test.asana_source.unique_stg_asana__user_user_id.73808d6267"], "model.asana_source.stg_asana__task": ["model.asana.asana__task", "model.asana.int_asana__task_assignee", "model.asana.int_asana__task_open_length", "test.asana_source.not_null_stg_asana__task_task_id.924cc69000", "test.asana_source.unique_stg_asana__task_task_id.a5271275a5"], "model.asana_source.stg_asana__task_section": ["model.asana.int_asana__task_projects", "test.asana_source.not_null_stg_asana__task_section_section_id.b0977a4cfe", "test.asana_source.not_null_stg_asana__task_section_task_id.ab81301de8"], "model.asana_source.stg_asana__section": ["model.asana.asana__project", "model.asana.int_asana__task_projects", "test.asana_source.not_null_stg_asana__section_section_id.389ebce958", "test.asana_source.unique_stg_asana__section_section_id.0495dd3d2f"], "model.asana_source.stg_asana__team": ["model.asana.asana__project", "model.asana.asana__team", "test.asana_source.not_null_stg_asana__team_team_id.e12b563474", "test.asana_source.unique_stg_asana__team_team_id.111fe15873"], "model.asana_source.stg_asana__task_tag": ["model.asana.asana__tag", "model.asana.int_asana__task_tags", "test.asana_source.not_null_stg_asana__task_tag_tag_id.d523de41d8", "test.asana_source.not_null_stg_asana__task_tag_task_id.9d27624748"], "model.asana_source.stg_asana__story": ["model.asana.int_asana__task_story", "test.asana_source.not_null_stg_asana__story_story_id.ca847d0848", "test.asana_source.not_null_stg_asana__story_target_task_id.3f971de06e", "test.asana_source.unique_stg_asana__story_story_id.414f25bb84"], "model.asana_source.stg_asana__tag": ["model.asana.asana__tag", "model.asana.int_asana__task_tags", "test.asana_source.not_null_stg_asana__tag_tag_id.c6a8187ca2", "test.asana_source.unique_stg_asana__tag_tag_id.fd78b190c7"], "model.asana_source.stg_asana__project_task": ["model.asana.int_asana__project_task_metrics", "model.asana.int_asana__project_user", "model.asana.int_asana__task_projects", "test.asana_source.not_null_stg_asana__project_task_project_id.e2450d16b1", "test.asana_source.not_null_stg_asana__project_task_task_id.9479566014"], "model.asana_source.stg_asana__project": ["model.asana.asana__project", "model.asana.int_asana__project_task_metrics", "model.asana.int_asana__project_user", "model.asana.int_asana__task_projects", "test.asana_source.not_null_stg_asana__project_project_id.d27dae84fa", "test.asana_source.unique_stg_asana__project_project_id.67bfab1228"], "model.asana_source.stg_asana__task_follower": ["model.asana.int_asana__task_followers", "test.asana_source.not_null_stg_asana__task_follower_task_id.5af35f322c", "test.asana_source.not_null_stg_asana__task_follower_user_id.e0aea0b15e"], "model.asana_source.stg_asana__story_tmp": ["model.asana_source.stg_asana__story", "model.asana_source.stg_asana__story"], "model.asana_source.stg_asana__team_tmp": ["model.asana_source.stg_asana__team", "model.asana_source.stg_asana__team"], "model.asana_source.stg_asana__task_tmp": ["model.asana_source.stg_asana__task", "model.asana_source.stg_asana__task"], "model.asana_source.stg_asana__task_follower_tmp": ["model.asana_source.stg_asana__task_follower", "model.asana_source.stg_asana__task_follower"], "model.asana_source.stg_asana__tag_tmp": ["model.asana_source.stg_asana__tag", "model.asana_source.stg_asana__tag"], "model.asana_source.stg_asana__task_section_tmp": ["model.asana_source.stg_asana__task_section", "model.asana_source.stg_asana__task_section"], "model.asana_source.stg_asana__task_tag_tmp": ["model.asana_source.stg_asana__task_tag", "model.asana_source.stg_asana__task_tag"], "model.asana_source.stg_asana__user_tmp": ["model.asana_source.stg_asana__user", "model.asana_source.stg_asana__user"], "model.asana_source.stg_asana__section_tmp": ["model.asana_source.stg_asana__section", "model.asana_source.stg_asana__section"], "model.asana_source.stg_asana__project_tmp": ["model.asana_source.stg_asana__project", "model.asana_source.stg_asana__project"], "model.asana_source.stg_asana__project_task_tmp": ["model.asana_source.stg_asana__project_task", "model.asana_source.stg_asana__project_task"], "model.asana.asana__daily_metrics": ["test.asana.not_null_asana__daily_metrics_date_day.363a2a09cf", "test.asana.unique_asana__daily_metrics_date_day.e8d67f545d"], "model.asana.asana__user": ["test.asana.not_null_asana__user_user_id.eb9cd93a43", "test.asana.unique_asana__user_user_id.3c4b63387e"], "model.asana.asana__task": ["model.asana.asana__daily_metrics", "model.asana.asana__tag", "model.asana.int_asana__project_task_metrics", "model.asana.int_asana__user_task_metrics", "test.asana.not_null_asana__task_task_id.6d36eb2cd0", "test.asana.unique_asana__task_task_id.ebfe331df1"], "model.asana.asana__team": ["test.asana.not_null_asana__team_team_id.cd6b6c88bf", "test.asana.unique_asana__team_team_id.ada6b5e093"], "model.asana.asana__project": ["model.asana.asana__team", "test.asana.not_null_asana__project_project_id.78420e1b45", "test.asana.unique_asana__project_project_id.66a76364ef"], "model.asana.asana__tag": ["test.asana.not_null_asana__tag_tag_id.593d626953", "test.asana.unique_asana__tag_tag_id.46c0d2510f"], "model.asana.int_asana__task_comments": ["model.asana.asana__task", "test.asana.not_null_int_asana__task_comments_task_id.6986f1d77f", "test.asana.unique_int_asana__task_comments_task_id.f012fa6a04"], "model.asana.int_asana__project_task_metrics": ["model.asana.asana__project", "test.asana.not_null_int_asana__project_task_metrics_project_id.804fd1daf3", "test.asana.unique_int_asana__project_task_metrics_project_id.049cc9b8a6"], "model.asana.int_asana__user_task_metrics": ["model.asana.asana__user", "test.asana.not_null_int_asana__user_task_metrics_user_id.54eae7d721", "test.asana.unique_int_asana__user_task_metrics_user_id.06a6a270b8"], "model.asana.int_asana__task_tags": ["model.asana.asana__task", "test.asana.not_null_int_asana__task_tags_task_id.34eec2b834", "test.asana.unique_int_asana__task_tags_task_id.f28aff2685"], "model.asana.int_asana__task_open_length": ["model.asana.asana__task", "test.asana.not_null_int_asana__task_open_length_task_id.23bb23b2e9", "test.asana.unique_int_asana__task_open_length_task_id.f26c49b044"], "model.asana.int_asana__task_followers": ["model.asana.asana__task", "test.asana.not_null_int_asana__task_followers_task_id.6791bf2573", "test.asana.unique_int_asana__task_followers_task_id.eeb3667df9"], "model.asana.int_asana__project_user": ["model.asana.asana__project", "model.asana.asana__user", "test.asana.dbt_utils_unique_combination_of_columns_int_asana__project_user_project_id__user_id__role__currently_working_on.f9493098e0"], "model.asana.int_asana__task_first_modifier": ["model.asana.asana__task", "test.asana.not_null_int_asana__task_first_modifier_task_id.495738ff52", "test.asana.unique_int_asana__task_first_modifier_task_id.59583c6dc2"], "model.asana.int_asana__task_projects": ["model.asana.asana__task", "test.asana.not_null_int_asana__task_projects_task_id.322519ee10", "test.asana.unique_int_asana__task_projects_task_id.8a6b2f262d"], "model.asana.int_asana__task_assignee": ["model.asana.asana__task", "model.asana.int_asana__project_user", "model.asana.int_asana__subtask_parent", "test.asana.not_null_int_asana__task_assignee_task_id.a9c81bd443", "test.asana.unique_int_asana__task_assignee_task_id.b4e2ea04e1"], "model.asana.int_asana__subtask_parent": ["model.asana.asana__task", "test.asana.not_null_int_asana__subtask_parent_subtask_id.024565c768", "test.asana.unique_int_asana__subtask_parent_subtask_id.641dfb3c8f"], "model.asana.int_asana__task_story": ["model.asana.int_asana__task_comments", "model.asana.int_asana__task_first_modifier", "model.asana.int_asana__task_open_length", "test.asana.not_null_int_asana__task_story_story_id.1ffdb99927", "test.asana.unique_int_asana__task_story_story_id.92d7adbcf6"], "test.asana_source.unique_stg_asana__project_project_id.67bfab1228": [], "test.asana_source.not_null_stg_asana__project_project_id.d27dae84fa": [], "test.asana_source.not_null_stg_asana__project_task_project_id.e2450d16b1": [], "test.asana_source.not_null_stg_asana__project_task_task_id.9479566014": [], "test.asana_source.unique_stg_asana__section_section_id.0495dd3d2f": [], "test.asana_source.not_null_stg_asana__section_section_id.389ebce958": [], "test.asana_source.unique_stg_asana__story_story_id.414f25bb84": [], "test.asana_source.not_null_stg_asana__story_story_id.ca847d0848": [], "test.asana_source.not_null_stg_asana__story_target_task_id.3f971de06e": [], "test.asana_source.unique_stg_asana__tag_tag_id.fd78b190c7": [], "test.asana_source.not_null_stg_asana__tag_tag_id.c6a8187ca2": [], "test.asana_source.unique_stg_asana__task_task_id.a5271275a5": [], "test.asana_source.not_null_stg_asana__task_task_id.924cc69000": [], "test.asana_source.not_null_stg_asana__task_follower_task_id.5af35f322c": [], "test.asana_source.not_null_stg_asana__task_follower_user_id.e0aea0b15e": [], "test.asana_source.not_null_stg_asana__task_section_task_id.ab81301de8": [], "test.asana_source.not_null_stg_asana__task_section_section_id.b0977a4cfe": [], "test.asana_source.not_null_stg_asana__task_tag_tag_id.d523de41d8": [], "test.asana_source.not_null_stg_asana__task_tag_task_id.9d27624748": [], "test.asana_source.unique_stg_asana__team_team_id.111fe15873": [], "test.asana_source.not_null_stg_asana__team_team_id.e12b563474": [], "test.asana_source.unique_stg_asana__user_user_id.73808d6267": [], "test.asana_source.not_null_stg_asana__user_user_id.4e900e8ec6": [], "test.asana.unique_asana__task_task_id.ebfe331df1": [], "test.asana.not_null_asana__task_task_id.6d36eb2cd0": [], "test.asana.unique_asana__user_user_id.3c4b63387e": [], "test.asana.not_null_asana__user_user_id.eb9cd93a43": [], "test.asana.unique_asana__project_project_id.66a76364ef": [], "test.asana.not_null_asana__project_project_id.78420e1b45": [], "test.asana.unique_asana__team_team_id.ada6b5e093": [], "test.asana.not_null_asana__team_team_id.cd6b6c88bf": [], "test.asana.unique_asana__tag_tag_id.46c0d2510f": [], "test.asana.not_null_asana__tag_tag_id.593d626953": [], "test.asana.unique_asana__daily_metrics_date_day.e8d67f545d": [], "test.asana.not_null_asana__daily_metrics_date_day.363a2a09cf": [], "test.asana.unique_int_asana__project_task_metrics_project_id.049cc9b8a6": [], "test.asana.not_null_int_asana__project_task_metrics_project_id.804fd1daf3": [], "test.asana.dbt_utils_unique_combination_of_columns_int_asana__project_user_project_id__user_id__role__currently_working_on.f9493098e0": [], "test.asana.unique_int_asana__subtask_parent_subtask_id.641dfb3c8f": [], "test.asana.not_null_int_asana__subtask_parent_subtask_id.024565c768": [], "test.asana.unique_int_asana__task_assignee_task_id.b4e2ea04e1": [], "test.asana.not_null_int_asana__task_assignee_task_id.a9c81bd443": [], "test.asana.unique_int_asana__task_comments_task_id.f012fa6a04": [], "test.asana.not_null_int_asana__task_comments_task_id.6986f1d77f": [], "test.asana.unique_int_asana__task_first_modifier_task_id.59583c6dc2": [], "test.asana.not_null_int_asana__task_first_modifier_task_id.495738ff52": [], "test.asana.unique_int_asana__task_followers_task_id.eeb3667df9": [], "test.asana.not_null_int_asana__task_followers_task_id.6791bf2573": [], "test.asana.unique_int_asana__task_open_length_task_id.f26c49b044": [], "test.asana.not_null_int_asana__task_open_length_task_id.23bb23b2e9": [], "test.asana.unique_int_asana__task_projects_task_id.8a6b2f262d": [], "test.asana.not_null_int_asana__task_projects_task_id.322519ee10": [], "test.asana.unique_int_asana__task_story_story_id.92d7adbcf6": [], "test.asana.not_null_int_asana__task_story_story_id.1ffdb99927": [], "test.asana.unique_int_asana__task_tags_task_id.f28aff2685": [], "test.asana.not_null_int_asana__task_tags_task_id.34eec2b834": [], "test.asana.unique_int_asana__user_task_metrics_user_id.06a6a270b8": [], "test.asana.not_null_int_asana__user_task_metrics_user_id.54eae7d721": [], "source.asana_source.asana.user": ["model.asana_source.stg_asana__user_tmp"], "source.asana_source.asana.task": ["model.asana_source.stg_asana__task_tmp"], "source.asana_source.asana.project": ["model.asana_source.stg_asana__project_tmp"], "source.asana_source.asana.story": ["model.asana_source.stg_asana__story_tmp"], "source.asana_source.asana.team": ["model.asana_source.stg_asana__team_tmp"], "source.asana_source.asana.tag": ["model.asana_source.stg_asana__tag_tmp"], "source.asana_source.asana.section": ["model.asana_source.stg_asana__section_tmp"], "source.asana_source.asana.project_task": ["model.asana_source.stg_asana__project_task_tmp"], "source.asana_source.asana.task_follower": ["model.asana_source.stg_asana__task_follower_tmp"], "source.asana_source.asana.task_tag": ["model.asana_source.stg_asana__task_tag_tmp"], "source.asana_source.asana.task_section": ["model.asana_source.stg_asana__task_section_tmp"]}} \ No newline at end of file +{"metadata": {"dbt_schema_version": "https://schemas.getdbt.com/dbt/manifest/v7.json", "dbt_version": "1.3.0", "generated_at": "2022-12-19T20:30:17.031670Z", "invocation_id": "5399ad9a-7e64-4cd8-8664-6d244aa13f8f", "env": {}, "project_id": "eb4f71033fe45cc065e80cddb4b06583", "user_id": "8929baf0-9bc1-477e-9a57-eb8b0db4da62", "send_anonymous_usage_stats": true, "adapter_type": "postgres"}, "nodes": {"seed.asana_integration_tests.project_task_data": {"compiled": true, "resource_type": "seed", "depends_on": {"macros": [], "nodes": []}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"_fivetran_synced": "timestamp", "project_id": "bigint", "task_id": "bigint"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "quote_columns": false, "post-hook": [], "pre-hook": []}, "database": "postgres", "schema": "asana_integrations_tests", "fqn": ["asana_integration_tests", "project_task_data"], "unique_id": "seed.asana_integration_tests.project_task_data", "raw_code": "", "language": "sql", "package_name": "asana_integration_tests", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/asana/dbt_asana/integration_tests", "path": "project_task_data.csv", "original_file_path": "seeds/project_task_data.csv", "name": "project_task_data", "alias": "project_task_data", "checksum": {"name": "sha256", "checksum": "b8ae363c3ab40609f8b5b0eee30e198bd124d781198ecda72e5409178aab17cd"}, "tags": [], "refs": [], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": null, "build_path": null, "deferred": false, "unrendered_config": {"quote_columns": "{{ true if target.type == 'redshift' else false }}", "column_types": {"project_id": "{{ 'int64' if target.type == 'bigquery' else 'bigint' }}", "task_id": "{{ 'int64' if target.type == 'bigquery' else 'bigint' }}"}}, "created_at": 1671481804.388288, "compiled_code": "", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "\"postgres\".\"asana_integrations_tests\".\"project_task_data\""}, "seed.asana_integration_tests.story_data": {"compiled": true, "resource_type": "seed", "depends_on": {"macros": [], "nodes": []}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"_fivetran_synced": "timestamp", "id": "bigint", "created_by_id": "bigint", "target_id": "bigint"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "quote_columns": false, "post-hook": [], "pre-hook": []}, "database": "postgres", "schema": "asana_integrations_tests", "fqn": ["asana_integration_tests", "story_data"], "unique_id": "seed.asana_integration_tests.story_data", "raw_code": "", "language": "sql", "package_name": "asana_integration_tests", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/asana/dbt_asana/integration_tests", "path": "story_data.csv", "original_file_path": "seeds/story_data.csv", "name": "story_data", "alias": "story_data", "checksum": {"name": "sha256", "checksum": "207847a91c60ba0de1269fd0aef2a0e1f9d2c3e2b0fbae231ce69fce909dd15a"}, "tags": [], "refs": [], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": null, "build_path": null, "deferred": false, "unrendered_config": {"quote_columns": "{{ true if target.type == 'redshift' else false }}", "column_types": {"id": "{{ 'int64' if target.type == 'bigquery' else 'bigint' }}", "created_by_id": "{{ 'int64' if target.type == 'bigquery' else 'bigint' }}", "target_id": "{{ 'int64' if target.type == 'bigquery' else 'bigint' }}"}}, "created_at": 1671481804.3948102, "compiled_code": "", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "\"postgres\".\"asana_integrations_tests\".\"story_data\""}, "seed.asana_integration_tests.task_tag_data": {"compiled": true, "resource_type": "seed", "depends_on": {"macros": [], "nodes": []}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"_fivetran_synced": "timestamp", "tag_id": "bigint", "task_id": "bigint"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "quote_columns": false, "post-hook": [], "pre-hook": []}, "database": "postgres", "schema": "asana_integrations_tests", "fqn": ["asana_integration_tests", "task_tag_data"], "unique_id": "seed.asana_integration_tests.task_tag_data", "raw_code": "", "language": "sql", "package_name": "asana_integration_tests", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/asana/dbt_asana/integration_tests", "path": "task_tag_data.csv", "original_file_path": "seeds/task_tag_data.csv", "name": "task_tag_data", "alias": "task_tag_data", "checksum": {"name": "sha256", "checksum": "0209673eda201e499fc6c588fbc799e08b44a60168cabaa4dc3cee39bb250cbd"}, "tags": [], "refs": [], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": null, "build_path": null, "deferred": false, "unrendered_config": {"quote_columns": "{{ true if target.type == 'redshift' else false }}", "column_types": {"tag_id": "{{ 'int64' if target.type == 'bigquery' else 'bigint' }}", "task_id": "{{ 'int64' if target.type == 'bigquery' else 'bigint' }}"}}, "created_at": 1671481804.3962119, "compiled_code": "", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "\"postgres\".\"asana_integrations_tests\".\"task_tag_data\""}, "seed.asana_integration_tests.task_section_data": {"compiled": true, "resource_type": "seed", "depends_on": {"macros": [], "nodes": []}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"_fivetran_synced": "timestamp", "section_id": "bigint", "task_id": "bigint"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "quote_columns": false, "post-hook": [], "pre-hook": []}, "database": "postgres", "schema": "asana_integrations_tests", "fqn": ["asana_integration_tests", "task_section_data"], "unique_id": "seed.asana_integration_tests.task_section_data", "raw_code": "", "language": "sql", "package_name": "asana_integration_tests", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/asana/dbt_asana/integration_tests", "path": "task_section_data.csv", "original_file_path": "seeds/task_section_data.csv", "name": "task_section_data", "alias": "task_section_data", "checksum": {"name": "sha256", "checksum": "d0aab9b6565fdb541b9ed5122d66cc9fad61287d3374d8af41c25eaf9bcd5805"}, "tags": [], "refs": [], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": null, "build_path": null, "deferred": false, "unrendered_config": {"quote_columns": "{{ true if target.type == 'redshift' else false }}", "column_types": {"section_id": "{{ 'int64' if target.type == 'bigquery' else 'bigint' }}", "task_id": "{{ 'int64' if target.type == 'bigquery' else 'bigint' }}"}}, "created_at": 1671481804.397522, "compiled_code": "", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "\"postgres\".\"asana_integrations_tests\".\"task_section_data\""}, "seed.asana_integration_tests.task_data": {"compiled": true, "resource_type": "seed", "depends_on": {"macros": [], "nodes": []}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"_fivetran_synced": "timestamp", "id": "bigint", "assignee_id": "bigint", "completed_by_id": "bigint", "parent_id": "bigint", "workspace_id": "bigint", "completed_at": "timestamp", "created_at": "timestamp", "due_on": "timestamp", "due_at": "timestamp", "modified_at": "timestamp", "start_on": "timestamp"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "quote_columns": false, "post-hook": [], "pre-hook": []}, "database": "postgres", "schema": "asana_integrations_tests", "fqn": ["asana_integration_tests", "task_data"], "unique_id": "seed.asana_integration_tests.task_data", "raw_code": "", "language": "sql", "package_name": "asana_integration_tests", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/asana/dbt_asana/integration_tests", "path": "task_data.csv", "original_file_path": "seeds/task_data.csv", "name": "task_data", "alias": "task_data", "checksum": {"name": "sha256", "checksum": "dc304269ae0d5003e65aa0b8f5be6093ec114874b7bca0bf4784ffed187338cd"}, "tags": [], "refs": [], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": null, "build_path": null, "deferred": false, "unrendered_config": {"quote_columns": "{{ true if target.type == 'redshift' else false }}", "column_types": {"id": "{{ 'int64' if target.type == 'bigquery' else 'bigint' }}", "assignee_id": "{{ 'int64' if target.type == 'bigquery' else 'bigint' }}", "completed_by_id": "{{ 'int64' if target.type == 'bigquery' else 'bigint' }}", "parent_id": "{{ 'int64' if target.type == 'bigquery' else 'bigint' }}", "workspace_id": "{{ 'int64' if target.type == 'bigquery' else 'bigint' }}", "completed_at": "timestamp", "created_at": "timestamp", "due_on": "timestamp", "due_at": "timestamp", "modified_at": "timestamp", "start_on": "timestamp", "_fivetran_synced": "timestamp"}}, "created_at": 1671481804.398931, "compiled_code": "", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "\"postgres\".\"asana_integrations_tests\".\"task_data\""}, "seed.asana_integration_tests.task_follower_data": {"compiled": true, "resource_type": "seed", "depends_on": {"macros": [], "nodes": []}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"_fivetran_synced": "timestamp", "user_id": "bigint", "task_id": "bigint"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "quote_columns": false, "post-hook": [], "pre-hook": []}, "database": "postgres", "schema": "asana_integrations_tests", "fqn": ["asana_integration_tests", "task_follower_data"], "unique_id": "seed.asana_integration_tests.task_follower_data", "raw_code": "", "language": "sql", "package_name": "asana_integration_tests", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/asana/dbt_asana/integration_tests", "path": "task_follower_data.csv", "original_file_path": "seeds/task_follower_data.csv", "name": "task_follower_data", "alias": "task_follower_data", "checksum": {"name": "sha256", "checksum": "6171210df6abad2ffba8ff8d10c1feb73c13c41c8e86b32e59f5aa29a4571678"}, "tags": [], "refs": [], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": null, "build_path": null, "deferred": false, "unrendered_config": {"quote_columns": "{{ true if target.type == 'redshift' else false }}", "column_types": {"user_id": "{{ 'int64' if target.type == 'bigquery' else 'bigint' }}", "task_id": "{{ 'int64' if target.type == 'bigquery' else 'bigint' }}"}}, "created_at": 1671481804.4002151, "compiled_code": "", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "\"postgres\".\"asana_integrations_tests\".\"task_follower_data\""}, "seed.asana_integration_tests.tag_data": {"compiled": true, "resource_type": "seed", "depends_on": {"macros": [], "nodes": []}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"_fivetran_synced": "timestamp", "id": "bigint", "workspace_id": "bigint"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "quote_columns": false, "post-hook": [], "pre-hook": []}, "database": "postgres", "schema": "asana_integrations_tests", "fqn": ["asana_integration_tests", "tag_data"], "unique_id": "seed.asana_integration_tests.tag_data", "raw_code": "", "language": "sql", "package_name": "asana_integration_tests", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/asana/dbt_asana/integration_tests", "path": "tag_data.csv", "original_file_path": "seeds/tag_data.csv", "name": "tag_data", "alias": "tag_data", "checksum": {"name": "sha256", "checksum": "e74c86b7fda7a484687ac7e16fd759233a2066632e6dd27acb481b0afa852548"}, "tags": [], "refs": [], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": null, "build_path": null, "deferred": false, "unrendered_config": {"quote_columns": "{{ true if target.type == 'redshift' else false }}", "column_types": {"id": "{{ 'int64' if target.type == 'bigquery' else 'bigint' }}", "workspace_id": "{{ 'int64' if target.type == 'bigquery' else 'bigint' }}"}}, "created_at": 1671481804.4014652, "compiled_code": "", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "\"postgres\".\"asana_integrations_tests\".\"tag_data\""}, "seed.asana_integration_tests.project_data": {"compiled": true, "resource_type": "seed", "depends_on": {"macros": [], "nodes": []}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"_fivetran_synced": "timestamp", "id": "bigint", "owner_id": "bigint", "team_id": "bigint", "workspace_id": "bigint"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "quote_columns": false, "post-hook": [], "pre-hook": []}, "database": "postgres", "schema": "asana_integrations_tests", "fqn": ["asana_integration_tests", "project_data"], "unique_id": "seed.asana_integration_tests.project_data", "raw_code": "", "language": "sql", "package_name": "asana_integration_tests", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/asana/dbt_asana/integration_tests", "path": "project_data.csv", "original_file_path": "seeds/project_data.csv", "name": "project_data", "alias": "project_data", "checksum": {"name": "sha256", "checksum": "cf12cd38b9bdb3ec36cac1757ae4a17e7a8dc4182cb65995ec3fc9b7c2668378"}, "tags": [], "refs": [], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": null, "build_path": null, "deferred": false, "unrendered_config": {"quote_columns": "{{ true if target.type == 'redshift' else false }}", "column_types": {"id": "{{ 'int64' if target.type == 'bigquery' else 'bigint' }}", "owner_id": "{{ 'int64' if target.type == 'bigquery' else 'bigint' }}", "team_id": "{{ 'int64' if target.type == 'bigquery' else 'bigint' }}", "workspace_id": "{{ 'int64' if target.type == 'bigquery' else 'bigint' }}"}}, "created_at": 1671481804.402771, "compiled_code": "", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "\"postgres\".\"asana_integrations_tests\".\"project_data\""}, "seed.asana_integration_tests.user_data": {"compiled": true, "resource_type": "seed", "depends_on": {"macros": [], "nodes": []}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"_fivetran_synced": "timestamp", "id": "bigint"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "quote_columns": false, "post-hook": [], "pre-hook": []}, "database": "postgres", "schema": "asana_integrations_tests", "fqn": ["asana_integration_tests", "user_data"], "unique_id": "seed.asana_integration_tests.user_data", "raw_code": "", "language": "sql", "package_name": "asana_integration_tests", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/asana/dbt_asana/integration_tests", "path": "user_data.csv", "original_file_path": "seeds/user_data.csv", "name": "user_data", "alias": "user_data", "checksum": {"name": "sha256", "checksum": "237db906018d65bbeeb08bd57c3cd23a91428412a882a0b59994658d564a9ad3"}, "tags": [], "refs": [], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": null, "build_path": null, "deferred": false, "unrendered_config": {"quote_columns": "{{ true if target.type == 'redshift' else false }}", "column_types": {"id": "{{ 'int64' if target.type == 'bigquery' else 'bigint' }}"}}, "created_at": 1671481804.404217, "compiled_code": "", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "\"postgres\".\"asana_integrations_tests\".\"user_data\""}, "seed.asana_integration_tests.team_data": {"compiled": true, "resource_type": "seed", "depends_on": {"macros": [], "nodes": []}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"_fivetran_synced": "timestamp", "id": "bigint", "organization_id": "bigint"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "quote_columns": false, "post-hook": [], "pre-hook": []}, "database": "postgres", "schema": "asana_integrations_tests", "fqn": ["asana_integration_tests", "team_data"], "unique_id": "seed.asana_integration_tests.team_data", "raw_code": "", "language": "sql", "package_name": "asana_integration_tests", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/asana/dbt_asana/integration_tests", "path": "team_data.csv", "original_file_path": "seeds/team_data.csv", "name": "team_data", "alias": "team_data", "checksum": {"name": "sha256", "checksum": "96c14731f1382783fd83b114321e23b5c2813b94f96a6e5422a5aca66157a1cd"}, "tags": [], "refs": [], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": null, "build_path": null, "deferred": false, "unrendered_config": {"quote_columns": "{{ true if target.type == 'redshift' else false }}", "column_types": {"id": "{{ 'int64' if target.type == 'bigquery' else 'bigint' }}", "organization_id": "{{ 'int64' if target.type == 'bigquery' else 'bigint' }}"}}, "created_at": 1671481804.405525, "compiled_code": "", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "\"postgres\".\"asana_integrations_tests\".\"team_data\""}, "seed.asana_integration_tests.section_data": {"compiled": true, "resource_type": "seed", "depends_on": {"macros": [], "nodes": []}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"_fivetran_synced": "timestamp", "id": "bigint", "project_id": "bigint"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "quote_columns": false, "post-hook": [], "pre-hook": []}, "database": "postgres", "schema": "asana_integrations_tests", "fqn": ["asana_integration_tests", "section_data"], "unique_id": "seed.asana_integration_tests.section_data", "raw_code": "", "language": "sql", "package_name": "asana_integration_tests", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/asana/dbt_asana/integration_tests", "path": "section_data.csv", "original_file_path": "seeds/section_data.csv", "name": "section_data", "alias": "section_data", "checksum": {"name": "sha256", "checksum": "ca6f6bf502e9d65fcbe59590756a42979e31af8bf1db841a9292b56512252bde"}, "tags": [], "refs": [], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": null, "build_path": null, "deferred": false, "unrendered_config": {"quote_columns": "{{ true if target.type == 'redshift' else false }}", "column_types": {"id": "{{ 'int64' if target.type == 'bigquery' else 'bigint' }}", "project_id": "{{ 'int64' if target.type == 'bigquery' else 'bigint' }}"}}, "created_at": 1671481804.406764, "compiled_code": "", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "\"postgres\".\"asana_integrations_tests\".\"section_data\""}, "model.asana_source.stg_asana__user": {"compiled": true, "resource_type": "model", "depends_on": {"macros": ["macro.asana_source.get_user_columns", "macro.fivetran_utils.fill_staging_columns"], "nodes": ["model.asana_source.stg_asana__user_tmp", "model.asana_source.stg_asana__user_tmp"]}, "config": {"enabled": true, "alias": null, "schema": "stg_asana", "database": null, "tags": [], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "post-hook": [], "pre-hook": []}, "database": "postgres", "schema": "asana_integrations_tests_stg_asana", "fqn": ["asana_source", "stg_asana__user"], "unique_id": "model.asana_source.stg_asana__user", "raw_code": "with base as (\n\n select * \n from {{ ref('stg_asana__user_tmp') }}\n\n),\n\nfields as (\n\n select\n {{\n fivetran_utils.fill_staging_columns(\n source_columns=adapter.get_columns_in_relation(ref('stg_asana__user_tmp')),\n staging_columns=get_user_columns()\n )\n }}\n \n from base\n),\n\nfinal as (\n \n select \n id as user_id,\n email,\n name as user_name\n from fields\n where not coalesce(_fivetran_deleted, false)\n)\n\nselect * \nfrom final", "language": "sql", "package_name": "asana_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/asana_source", "path": "stg_asana__user.sql", "original_file_path": "models/stg_asana__user.sql", "name": "stg_asana__user", "alias": "stg_asana__user", "checksum": {"name": "sha256", "checksum": "4e7279a7f3d7b9754c574de24021781c98bbbc1c0a99e0c7b3495c57a6d33e18"}, "tags": [], "refs": [["stg_asana__user_tmp"], ["stg_asana__user_tmp"]], "sources": [], "metrics": [], "description": "Table of all accounts in the organization", "columns": {"user_id": {"name": "user_id", "description": "System generated unique ID for each user", "meta": {}, "data_type": null, "quote": null, "tags": []}, "email": {"name": "email", "description": "The user's email", "meta": {}, "data_type": null, "quote": null, "tags": []}, "user_name": {"name": "user_name", "description": "The name of the user as it appears in the UI", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "asana_source://models/stg_asana.yml", "compiled_path": "target/compiled/asana_source/models/stg_asana__user.sql", "build_path": null, "deferred": false, "unrendered_config": {"schema": "stg_asana", "materialized": "table"}, "created_at": 1671481804.700981, "compiled_code": "with base as (\n\n select * \n from \"postgres\".\"asana_integrations_tests_stg_asana\".\"stg_asana__user_tmp\"\n\n),\n\nfields as (\n\n select\n \n \n \n _fivetran_deleted\n \n as \n \n _fivetran_deleted\n \n, \n \n \n _fivetran_synced\n \n as \n \n _fivetran_synced\n \n, \n \n \n email\n \n as \n \n email\n \n, \n \n \n id\n \n as \n \n id\n \n, \n \n \n name\n \n as \n \n name\n \n\n\n\n \n from base\n),\n\nfinal as (\n \n select \n id as user_id,\n email,\n name as user_name\n from fields\n where not coalesce(_fivetran_deleted, false)\n)\n\nselect * \nfrom final", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "\"postgres\".\"asana_integrations_tests_stg_asana\".\"stg_asana__user\""}, "model.asana_source.stg_asana__task": {"compiled": true, "resource_type": "model", "depends_on": {"macros": ["macro.asana_source.get_task_columns", "macro.fivetran_utils.fill_staging_columns", "macro.dbt.type_timestamp"], "nodes": ["model.asana_source.stg_asana__task_tmp", "model.asana_source.stg_asana__task_tmp"]}, "config": {"enabled": true, "alias": null, "schema": "stg_asana", "database": null, "tags": [], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "post-hook": [], "pre-hook": []}, "database": "postgres", "schema": "asana_integrations_tests_stg_asana", "fqn": ["asana_source", "stg_asana__task"], "unique_id": "model.asana_source.stg_asana__task", "raw_code": "with base as (\n\n select * \n from {{ ref('stg_asana__task_tmp') }}\n\n),\n\nfields as (\n\n select\n {{\n fivetran_utils.fill_staging_columns(\n source_columns=adapter.get_columns_in_relation(ref('stg_asana__task_tmp')),\n staging_columns=get_task_columns()\n )\n }}\n\n --The below script allows for pass through columns.\n {% if var('task_pass_through_columns') %}\n ,\n {{ var('task_pass_through_columns') | join (\", \") }}\n\n {% endif %}\n\n from base\n),\n\nfinal as (\n \n select \n id as task_id,\n assignee_id as assignee_user_id,\n completed as is_completed,\n cast(completed_at as {{ dbt.type_timestamp() }}) as completed_at,\n completed_by_id as completed_by_user_id,\n cast(created_at as {{ dbt.type_timestamp() }}) as created_at,\n cast(coalesce(due_on, due_at) as {{ dbt.type_timestamp() }}) as due_date,\n cast(modified_at as {{ dbt.type_timestamp() }}) as modified_at,\n name as task_name,\n parent_id as parent_task_id,\n cast(start_on as {{ dbt.type_timestamp() }}) as start_date,\n notes as task_description,\n liked as is_liked,\n num_likes as number_of_likes,\n workspace_id\n\n --The below script allows for pass through columns.\n {% if var('task_pass_through_columns') %}\n ,\n {{ var('task_pass_through_columns') | join (\", \") }}\n\n {% endif %}\n\n from fields\n)\n\nselect * \nfrom final", "language": "sql", "package_name": "asana_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/asana_source", "path": "stg_asana__task.sql", "original_file_path": "models/stg_asana__task.sql", "name": "stg_asana__task", "alias": "stg_asana__task", "checksum": {"name": "sha256", "checksum": "e47fb0deb8252314befe05ea75c1fb10b1a73e483e7bcad705c042eefa2d9a3b"}, "tags": [], "refs": [["stg_asana__task_tmp"], ["stg_asana__task_tmp"]], "sources": [], "metrics": [], "description": "Table containing all created tasks", "columns": {"task_id": {"name": "task_id", "description": "System generated unique ID of the task", "meta": {}, "data_type": null, "quote": null, "tags": []}, "assignee_user_id": {"name": "assignee_user_id", "description": "Foreign key referencing the USER that is currently assigned the task.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "assignee_status": {"name": "assignee_status", "description": "Scheduling status for the assignee that the task is or will eventually be assigned to. This maps to the sections of \"My Tasks\"", "meta": {}, "data_type": null, "quote": null, "tags": []}, "is_completed": {"name": "is_completed", "description": "Boolean that is true if the task is currently marked complete.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "completed_at": {"name": "completed_at", "description": "Timestamp of when the task was marked complete.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "completed_by_user_id": {"name": "completed_by_user_id", "description": "Foreign key referencing the USER who completed the task.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "created_at": {"name": "created_at", "description": "Timestamp of when the task was created", "meta": {}, "data_type": null, "quote": null, "tags": []}, "due_date": {"name": "due_date", "description": "Date the task is due, if provided.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "modified_at": {"name": "modified_at", "description": "Timestamp of when the task was last modified", "meta": {}, "data_type": null, "quote": null, "tags": []}, "task_name": {"name": "task_name", "description": "User-facing name of the task.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "parent_task_id": {"name": "parent_task_id", "description": "Self-referential id of the parent TASK that this is a subtask of.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "start_date": {"name": "start_date", "description": "The start date of the task, if a date range is given.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "task_description": {"name": "task_description", "description": "Free-form text describing the task, as seen in the UI.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "is_liked": {"name": "is_liked", "description": "A boolean that's true if the task has been liked.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "number_of_likes": {"name": "number_of_likes", "description": "An integer indicating the number of likes on a task.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "workspace_id": {"name": "workspace_id", "description": "ID of the organization's Asana workspace. Irrelevant unless working with multiple companies.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "asana_source://models/stg_asana.yml", "compiled_path": "target/compiled/asana_source/models/stg_asana__task.sql", "build_path": null, "deferred": false, "unrendered_config": {"schema": "stg_asana", "materialized": "table"}, "created_at": 1671481804.69787, "compiled_code": "with base as (\n\n select * \n from \"postgres\".\"asana_integrations_tests_stg_asana\".\"stg_asana__task_tmp\"\n\n),\n\nfields as (\n\n select\n \n cast(null as TIMESTAMP) as \n \n _fivetran_synced\n \n , \n \n \n assignee_id\n \n as \n \n assignee_id\n \n, \n \n \n completed\n \n as \n \n completed\n \n, \n \n \n completed_at\n \n as \n \n completed_at\n \n, \n \n \n completed_by_id\n \n as \n \n completed_by_id\n \n, \n \n \n created_at\n \n as \n \n created_at\n \n, \n \n \n due_at\n \n as \n \n due_at\n \n, \n \n \n due_on\n \n as \n \n due_on\n \n, \n \n \n id\n \n as \n \n id\n \n, \n \n \n modified_at\n \n as \n \n modified_at\n \n, \n \n \n name\n \n as \n \n name\n \n, \n \n \n notes\n \n as \n \n notes\n \n, \n cast(null as boolean) as \n \n liked\n \n , \n cast(null as INT) as \n \n num_likes\n \n , \n \n \n parent_id\n \n as \n \n parent_id\n \n, \n \n \n start_on\n \n as \n \n start_on\n \n, \n \n \n workspace_id\n \n as \n \n workspace_id\n \n\n\n\n\n --The below script allows for pass through columns.\n \n\n from base\n),\n\nfinal as (\n \n select \n id as task_id,\n assignee_id as assignee_user_id,\n completed as is_completed,\n cast(completed_at as TIMESTAMP) as completed_at,\n completed_by_id as completed_by_user_id,\n cast(created_at as TIMESTAMP) as created_at,\n cast(coalesce(due_on, due_at) as TIMESTAMP) as due_date,\n cast(modified_at as TIMESTAMP) as modified_at,\n name as task_name,\n parent_id as parent_task_id,\n cast(start_on as TIMESTAMP) as start_date,\n notes as task_description,\n liked as is_liked,\n num_likes as number_of_likes,\n workspace_id\n\n --The below script allows for pass through columns.\n \n\n from fields\n)\n\nselect * \nfrom final", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "\"postgres\".\"asana_integrations_tests_stg_asana\".\"stg_asana__task\""}, "model.asana_source.stg_asana__task_section": {"compiled": true, "resource_type": "model", "depends_on": {"macros": ["macro.asana_source.get_task_section_columns", "macro.fivetran_utils.fill_staging_columns"], "nodes": ["model.asana_source.stg_asana__task_section_tmp", "model.asana_source.stg_asana__task_section_tmp"]}, "config": {"enabled": true, "alias": null, "schema": "stg_asana", "database": null, "tags": [], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "post-hook": [], "pre-hook": []}, "database": "postgres", "schema": "asana_integrations_tests_stg_asana", "fqn": ["asana_source", "stg_asana__task_section"], "unique_id": "model.asana_source.stg_asana__task_section", "raw_code": "with base as (\n\n select * \n from {{ ref('stg_asana__task_section_tmp') }}\n\n),\n\nfields as (\n\n select\n {{\n fivetran_utils.fill_staging_columns(\n source_columns=adapter.get_columns_in_relation(ref('stg_asana__task_section_tmp')),\n staging_columns=get_task_section_columns()\n )\n }}\n \n from base\n),\n\nfinal as (\n \n select \n section_id,\n task_id\n from fields\n)\n\nselect * \nfrom final", "language": "sql", "package_name": "asana_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/asana_source", "path": "stg_asana__task_section.sql", "original_file_path": "models/stg_asana__task_section.sql", "name": "stg_asana__task_section", "alias": "stg_asana__task_section", "checksum": {"name": "sha256", "checksum": "4ead107e3627f57920f45d190c273a0fe706c9f911998f67769818fcd1bb4797"}, "tags": [], "refs": [["stg_asana__task_section_tmp"], ["stg_asana__task_section_tmp"]], "sources": [], "metrics": [], "description": "Table of tasks and the section that they live under. Section-less tasks within projects appear here, but project-less tasks do not", "columns": {"task_id": {"name": "task_id", "description": "Foreign key referencing the ID of the TASK", "meta": {}, "data_type": null, "quote": null, "tags": []}, "section_id": {"name": "section_id", "description": "Foreign key referencing the ID of the SECTION housing the task", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "asana_source://models/stg_asana.yml", "compiled_path": "target/compiled/asana_source/models/stg_asana__task_section.sql", "build_path": null, "deferred": false, "unrendered_config": {"schema": "stg_asana", "materialized": "table"}, "created_at": 1671481804.6990569, "compiled_code": "with base as (\n\n select * \n from \"postgres\".\"asana_integrations_tests_stg_asana\".\"stg_asana__task_section_tmp\"\n\n),\n\nfields as (\n\n select\n \n \n \n _fivetran_synced\n \n as \n \n _fivetran_synced\n \n, \n \n \n section_id\n \n as \n \n section_id\n \n, \n \n \n task_id\n \n as \n \n task_id\n \n\n\n\n \n from base\n),\n\nfinal as (\n \n select \n section_id,\n task_id\n from fields\n)\n\nselect * \nfrom final", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "\"postgres\".\"asana_integrations_tests_stg_asana\".\"stg_asana__task_section\""}, "model.asana_source.stg_asana__section": {"compiled": true, "resource_type": "model", "depends_on": {"macros": ["macro.asana_source.get_section_columns", "macro.fivetran_utils.fill_staging_columns", "macro.dbt.type_timestamp"], "nodes": ["model.asana_source.stg_asana__section_tmp", "model.asana_source.stg_asana__section_tmp"]}, "config": {"enabled": true, "alias": null, "schema": "stg_asana", "database": null, "tags": [], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "post-hook": [], "pre-hook": []}, "database": "postgres", "schema": "asana_integrations_tests_stg_asana", "fqn": ["asana_source", "stg_asana__section"], "unique_id": "model.asana_source.stg_asana__section", "raw_code": "with base as (\n\n select * \n from {{ ref('stg_asana__section_tmp') }}\n\n),\n\nfields as (\n\n select\n {{\n fivetran_utils.fill_staging_columns(\n source_columns=adapter.get_columns_in_relation(ref('stg_asana__section_tmp')),\n staging_columns=get_section_columns()\n )\n }}\n \n from base\n),\n\nfinal as (\n \n select \n id as section_id,\n cast(created_at as {{ dbt.type_timestamp() }}) as created_at,\n name as section_name,\n project_id\n from fields\n)\n\nselect * \nfrom final", "language": "sql", "package_name": "asana_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/asana_source", "path": "stg_asana__section.sql", "original_file_path": "models/stg_asana__section.sql", "name": "stg_asana__section", "alias": "stg_asana__section", "checksum": {"name": "sha256", "checksum": "4c0310af5b1832f35eef93c4ab66969242ffeecc545c6b27510c81534786b2cd"}, "tags": [], "refs": [["stg_asana__section_tmp"], ["stg_asana__section_tmp"]], "sources": [], "metrics": [], "description": "Table of all sections within projects. If tasks in a project are not in an explicit user-made section, a default section called \"(no section)\" is created here", "columns": {"section_id": {"name": "section_id", "description": "System-generated unique ID of the section", "meta": {}, "data_type": null, "quote": null, "tags": []}, "created_at": {"name": "created_at", "description": "Timestamp of when the section was created", "meta": {}, "data_type": null, "quote": null, "tags": []}, "section_name": {"name": "section_name", "description": "User-facing name of the section.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "project_id": {"name": "project_id", "description": "Foreign key referencing the id of the PROJECT the section lives in.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "asana_source://models/stg_asana.yml", "compiled_path": "target/compiled/asana_source/models/stg_asana__section.sql", "build_path": null, "deferred": false, "unrendered_config": {"schema": "stg_asana", "materialized": "table"}, "created_at": 1671481804.693525, "compiled_code": "with base as (\n\n select * \n from \"postgres\".\"asana_integrations_tests_stg_asana\".\"stg_asana__section_tmp\"\n\n),\n\nfields as (\n\n select\n \n \n \n _fivetran_synced\n \n as \n \n _fivetran_synced\n \n, \n \n \n created_at\n \n as \n \n created_at\n \n, \n \n \n id\n \n as \n \n id\n \n, \n \n \n name\n \n as \n \n name\n \n, \n \n \n project_id\n \n as \n \n project_id\n \n\n\n\n \n from base\n),\n\nfinal as (\n \n select \n id as section_id,\n cast(created_at as TIMESTAMP) as created_at,\n name as section_name,\n project_id\n from fields\n)\n\nselect * \nfrom final", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "\"postgres\".\"asana_integrations_tests_stg_asana\".\"stg_asana__section\""}, "model.asana_source.stg_asana__team": {"compiled": true, "resource_type": "model", "depends_on": {"macros": ["macro.asana_source.get_team_columns", "macro.fivetran_utils.fill_staging_columns"], "nodes": ["model.asana_source.stg_asana__team_tmp", "model.asana_source.stg_asana__team_tmp"]}, "config": {"enabled": true, "alias": null, "schema": "stg_asana", "database": null, "tags": [], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "post-hook": [], "pre-hook": []}, "database": "postgres", "schema": "asana_integrations_tests_stg_asana", "fqn": ["asana_source", "stg_asana__team"], "unique_id": "model.asana_source.stg_asana__team", "raw_code": "with base as (\n\n select * \n from {{ ref('stg_asana__team_tmp') }}\n\n),\n\nfields as (\n\n select\n {{\n fivetran_utils.fill_staging_columns(\n source_columns=adapter.get_columns_in_relation(ref('stg_asana__team_tmp')),\n staging_columns=get_team_columns()\n )\n }}\n \n from base\n),\n\nfinal as (\n \n select \n id as team_id,\n name as team_name\n from fields\n where not coalesce(_fivetran_deleted, false)\n)\n\nselect * \nfrom final", "language": "sql", "package_name": "asana_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/asana_source", "path": "stg_asana__team.sql", "original_file_path": "models/stg_asana__team.sql", "name": "stg_asana__team", "alias": "stg_asana__team", "checksum": {"name": "sha256", "checksum": "d2a65dca096a0320f59cc16346eb1854a1bc78135e11eb6b010fcc41fc49e4a0"}, "tags": [], "refs": [["stg_asana__team_tmp"], ["stg_asana__team_tmp"]], "sources": [], "metrics": [], "description": "Table of the teams within the organization", "columns": {"team_id": {"name": "team_id", "description": "System generated unique ID for each team", "meta": {}, "data_type": null, "quote": null, "tags": []}, "team_name": {"name": "team_name", "description": "User-facing name of the team", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "asana_source://models/stg_asana.yml", "compiled_path": "target/compiled/asana_source/models/stg_asana__team.sql", "build_path": null, "deferred": false, "unrendered_config": {"schema": "stg_asana", "materialized": "table"}, "created_at": 1671481804.700244, "compiled_code": "with base as (\n\n select * \n from \"postgres\".\"asana_integrations_tests_stg_asana\".\"stg_asana__team_tmp\"\n\n),\n\nfields as (\n\n select\n \n \n \n _fivetran_deleted\n \n as \n \n _fivetran_deleted\n \n, \n \n \n _fivetran_synced\n \n as \n \n _fivetran_synced\n \n, \n \n \n id\n \n as \n \n id\n \n, \n \n \n name\n \n as \n \n name\n \n, \n \n \n organization_id\n \n as \n \n organization_id\n \n\n\n\n \n from base\n),\n\nfinal as (\n \n select \n id as team_id,\n name as team_name\n from fields\n where not coalesce(_fivetran_deleted, false)\n)\n\nselect * \nfrom final", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "\"postgres\".\"asana_integrations_tests_stg_asana\".\"stg_asana__team\""}, "model.asana_source.stg_asana__task_tag": {"compiled": true, "resource_type": "model", "depends_on": {"macros": ["macro.asana_source.get_task_tag_columns", "macro.fivetran_utils.fill_staging_columns"], "nodes": ["model.asana_source.stg_asana__task_tag_tmp", "model.asana_source.stg_asana__task_tag_tmp"]}, "config": {"enabled": true, "alias": null, "schema": "stg_asana", "database": null, "tags": [], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "post-hook": [], "pre-hook": []}, "database": "postgres", "schema": "asana_integrations_tests_stg_asana", "fqn": ["asana_source", "stg_asana__task_tag"], "unique_id": "model.asana_source.stg_asana__task_tag", "raw_code": "with base as (\n\n select * \n from {{ ref('stg_asana__task_tag_tmp') }}\n\n),\n\nfields as (\n\n select\n {{\n fivetran_utils.fill_staging_columns(\n source_columns=adapter.get_columns_in_relation(ref('stg_asana__task_tag_tmp')),\n staging_columns=get_task_tag_columns()\n )\n }}\n \n from base\n),\n\nfinal as (\n \n select \n tag_id,\n task_id\n from fields\n)\n\nselect * \nfrom final", "language": "sql", "package_name": "asana_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/asana_source", "path": "stg_asana__task_tag.sql", "original_file_path": "models/stg_asana__task_tag.sql", "name": "stg_asana__task_tag", "alias": "stg_asana__task_tag", "checksum": {"name": "sha256", "checksum": "7eba4b0f2dabd68e0a77d515c8406bb57bd6263b9ef551de3f06eded4c085de8"}, "tags": [], "refs": [["stg_asana__task_tag_tmp"], ["stg_asana__task_tag_tmp"]], "sources": [], "metrics": [], "description": "Table of tasks with the tags attached to them. Tasks without tags (and vice versa) do not appear here.", "columns": {"tag_id": {"name": "tag_id", "description": "Foreign key referencing the ID of the TAG attached to the task", "meta": {}, "data_type": null, "quote": null, "tags": []}, "task_id": {"name": "task_id", "description": "Foreign key referencing the ID of the TASK", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "asana_source://models/stg_asana.yml", "compiled_path": "target/compiled/asana_source/models/stg_asana__task_tag.sql", "build_path": null, "deferred": false, "unrendered_config": {"schema": "stg_asana", "materialized": "table"}, "created_at": 1671481804.699716, "compiled_code": "with base as (\n\n select * \n from \"postgres\".\"asana_integrations_tests_stg_asana\".\"stg_asana__task_tag_tmp\"\n\n),\n\nfields as (\n\n select\n \n \n \n _fivetran_synced\n \n as \n \n _fivetran_synced\n \n, \n \n \n tag_id\n \n as \n \n tag_id\n \n, \n \n \n task_id\n \n as \n \n task_id\n \n\n\n\n \n from base\n),\n\nfinal as (\n \n select \n tag_id,\n task_id\n from fields\n)\n\nselect * \nfrom final", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "\"postgres\".\"asana_integrations_tests_stg_asana\".\"stg_asana__task_tag\""}, "model.asana_source.stg_asana__story": {"compiled": true, "resource_type": "model", "depends_on": {"macros": ["macro.asana_source.get_story_columns", "macro.fivetran_utils.fill_staging_columns", "macro.dbt.type_timestamp"], "nodes": ["model.asana_source.stg_asana__story_tmp", "model.asana_source.stg_asana__story_tmp"]}, "config": {"enabled": true, "alias": null, "schema": "stg_asana", "database": null, "tags": [], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "post-hook": [], "pre-hook": []}, "database": "postgres", "schema": "asana_integrations_tests_stg_asana", "fqn": ["asana_source", "stg_asana__story"], "unique_id": "model.asana_source.stg_asana__story", "raw_code": "with base as (\n\n select * \n from {{ ref('stg_asana__story_tmp') }}\n\n),\n\nfields as (\n\n select\n {{\n fivetran_utils.fill_staging_columns(\n source_columns=adapter.get_columns_in_relation(ref('stg_asana__story_tmp')),\n staging_columns=get_story_columns()\n )\n }}\n \n from base\n),\n\nfinal as (\n \n select \n id as story_id,\n cast(created_at as {{ dbt.type_timestamp() }}) as created_at,\n created_by_id as created_by_user_id,\n target_id as target_task_id,\n text as story_content,\n type as event_type\n from fields\n)\n\nselect * \nfrom final", "language": "sql", "package_name": "asana_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/asana_source", "path": "stg_asana__story.sql", "original_file_path": "models/stg_asana__story.sql", "name": "stg_asana__story", "alias": "stg_asana__story", "checksum": {"name": "sha256", "checksum": "099c294f4f7a424d61579bc6cc3ec84860097149701eac404a71c07ca3f0e2b0"}, "tags": [], "refs": [["stg_asana__story_tmp"], ["stg_asana__story_tmp"]], "sources": [], "metrics": [], "description": "Table containing all stories -- stories are actions taken on tasks", "columns": {"story_id": {"name": "story_id", "description": "System generated unique ID of the story/action taken on a task.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "created_at": {"name": "created_at", "description": "Timestamp of when the story occurred.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "created_by_user_id": {"name": "created_by_user_id", "description": "Foreign key referencing the USER who took the action (sometimes null)", "meta": {}, "data_type": null, "quote": null, "tags": []}, "target_task_id": {"name": "target_task_id", "description": "Foreign key referencing the TASK that the action was taken on.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "story_content": {"name": "story_content", "description": "Free-form text that is either the content of a comment (event_type=comment) or the description of an action (event_type=system)", "meta": {}, "data_type": null, "quote": null, "tags": []}, "event_type": {"name": "event_type", "description": "The origin type of the story - a comment or change to the backend (ie altering a task somehow)", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "asana_source://models/stg_asana.yml", "compiled_path": "target/compiled/asana_source/models/stg_asana__story.sql", "build_path": null, "deferred": false, "unrendered_config": {"schema": "stg_asana", "materialized": "table"}, "created_at": 1671481804.6946418, "compiled_code": "with base as (\n\n select * \n from \"postgres\".\"asana_integrations_tests_stg_asana\".\"stg_asana__story_tmp\"\n\n),\n\nfields as (\n\n select\n \n \n \n _fivetran_synced\n \n as \n \n _fivetran_synced\n \n, \n \n \n created_at\n \n as \n \n created_at\n \n, \n \n \n created_by_id\n \n as \n \n created_by_id\n \n, \n \n \n hearted\n \n as \n \n hearted\n \n, \n \n \n id\n \n as \n \n id\n \n, \n \n \n num_hearts\n \n as \n \n num_hearts\n \n, \n \n \n source\n \n as \n \n source\n \n, \n \n \n target_id\n \n as \n \n target_id\n \n, \n \n \n text\n \n as \n \n text\n \n, \n \n \n type\n \n as \n \n type\n \n\n\n\n \n from base\n),\n\nfinal as (\n \n select \n id as story_id,\n cast(created_at as TIMESTAMP) as created_at,\n created_by_id as created_by_user_id,\n target_id as target_task_id,\n text as story_content,\n type as event_type\n from fields\n)\n\nselect * \nfrom final", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "\"postgres\".\"asana_integrations_tests_stg_asana\".\"stg_asana__story\""}, "model.asana_source.stg_asana__tag": {"compiled": true, "resource_type": "model", "depends_on": {"macros": ["macro.asana_source.get_tag_columns", "macro.fivetran_utils.fill_staging_columns", "macro.dbt.type_timestamp"], "nodes": ["model.asana_source.stg_asana__tag_tmp", "model.asana_source.stg_asana__tag_tmp"]}, "config": {"enabled": true, "alias": null, "schema": "stg_asana", "database": null, "tags": [], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "post-hook": [], "pre-hook": []}, "database": "postgres", "schema": "asana_integrations_tests_stg_asana", "fqn": ["asana_source", "stg_asana__tag"], "unique_id": "model.asana_source.stg_asana__tag", "raw_code": "with base as (\n\n select * \n from {{ ref('stg_asana__tag_tmp') }}\n\n),\n\nfields as (\n\n select\n {{\n fivetran_utils.fill_staging_columns(\n source_columns=adapter.get_columns_in_relation(ref('stg_asana__tag_tmp')),\n staging_columns=get_tag_columns()\n )\n }}\n \n from base\n),\n\nfinal as (\n \n select \n id as tag_id,\n name as tag_name,\n cast(created_at as {{ dbt.type_timestamp() }}) as created_at\n from fields\n where not _fivetran_deleted\n)\n\nselect * \nfrom final", "language": "sql", "package_name": "asana_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/asana_source", "path": "stg_asana__tag.sql", "original_file_path": "models/stg_asana__tag.sql", "name": "stg_asana__tag", "alias": "stg_asana__tag", "checksum": {"name": "sha256", "checksum": "5e2b49fc8c3d6c591b03b5c689d05423d6f9b798f79197e398690f9180459f2c"}, "tags": [], "refs": [["stg_asana__tag_tmp"], ["stg_asana__tag_tmp"]], "sources": [], "metrics": [], "description": "Table of the custom tags made in the organization", "columns": {"tag_id": {"name": "tag_id", "description": "System generated unique ID of the tag", "meta": {}, "data_type": null, "quote": null, "tags": []}, "tag_name": {"name": "tag_name", "description": "User-facing name of the tag.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "created_at": {"name": "created_at", "description": "Timestamp of when the tag was created", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "asana_source://models/stg_asana.yml", "compiled_path": "target/compiled/asana_source/models/stg_asana__tag.sql", "build_path": null, "deferred": false, "unrendered_config": {"schema": "stg_asana", "materialized": "table"}, "created_at": 1671481804.695308, "compiled_code": "with base as (\n\n select * \n from \"postgres\".\"asana_integrations_tests_stg_asana\".\"stg_asana__tag_tmp\"\n\n),\n\nfields as (\n\n select\n \n \n \n _fivetran_deleted\n \n as \n \n _fivetran_deleted\n \n, \n \n \n _fivetran_synced\n \n as \n \n _fivetran_synced\n \n, \n \n \n color\n \n as \n \n color\n \n, \n \n \n created_at\n \n as \n \n created_at\n \n, \n \n \n id\n \n as \n \n id\n \n, \n \n \n message\n \n as \n \n message\n \n, \n \n \n name\n \n as \n \n name\n \n, \n \n \n notes\n \n as \n \n notes\n \n, \n \n \n workspace_id\n \n as \n \n workspace_id\n \n\n\n\n \n from base\n),\n\nfinal as (\n \n select \n id as tag_id,\n name as tag_name,\n cast(created_at as TIMESTAMP) as created_at\n from fields\n where not _fivetran_deleted\n)\n\nselect * \nfrom final", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "\"postgres\".\"asana_integrations_tests_stg_asana\".\"stg_asana__tag\""}, "model.asana_source.stg_asana__project_task": {"compiled": true, "resource_type": "model", "depends_on": {"macros": ["macro.asana_source.get_project_task_columns", "macro.fivetran_utils.fill_staging_columns"], "nodes": ["model.asana_source.stg_asana__project_task_tmp", "model.asana_source.stg_asana__project_task_tmp"]}, "config": {"enabled": true, "alias": null, "schema": "stg_asana", "database": null, "tags": [], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "post-hook": [], "pre-hook": []}, "database": "postgres", "schema": "asana_integrations_tests_stg_asana", "fqn": ["asana_source", "stg_asana__project_task"], "unique_id": "model.asana_source.stg_asana__project_task", "raw_code": "with base as (\n\n select * \n from {{ ref('stg_asana__project_task_tmp') }}\n\n),\n\nfields as (\n\n select\n {{\n fivetran_utils.fill_staging_columns(\n source_columns=adapter.get_columns_in_relation(ref('stg_asana__project_task_tmp')),\n staging_columns=get_project_task_columns()\n )\n }}\n \n from base\n),\n\nfinal as (\n \n select \n project_id,\n task_id\n from fields\n)\n\nselect * \nfrom final", "language": "sql", "package_name": "asana_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/asana_source", "path": "stg_asana__project_task.sql", "original_file_path": "models/stg_asana__project_task.sql", "name": "stg_asana__project_task", "alias": "stg_asana__project_task", "checksum": {"name": "sha256", "checksum": "95153bcb4c7e9ccc7302710d14cf8d8120817eece7378f1f7c26f27b48129469"}, "tags": [], "refs": [["stg_asana__project_task_tmp"], ["stg_asana__project_task_tmp"]], "sources": [], "metrics": [], "description": "Table of tasks and the project(s) they each belong to. If a project doesn't have a task, it won't be in here (and vice versa)", "columns": {"project_id": {"name": "project_id", "description": "Foreign key referencing the ID of the PROJECT", "meta": {}, "data_type": null, "quote": null, "tags": []}, "task_id": {"name": "task_id", "description": "Foreign key referencing the ID of the TASK", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "asana_source://models/stg_asana.yml", "compiled_path": "target/compiled/asana_source/models/stg_asana__project_task.sql", "build_path": null, "deferred": false, "unrendered_config": {"schema": "stg_asana", "materialized": "table"}, "created_at": 1671481804.6926148, "compiled_code": "with base as (\n\n select * \n from \"postgres\".\"asana_integrations_tests_stg_asana\".\"stg_asana__project_task_tmp\"\n\n),\n\nfields as (\n\n select\n \n \n \n _fivetran_synced\n \n as \n \n _fivetran_synced\n \n, \n \n \n project_id\n \n as \n \n project_id\n \n, \n \n \n task_id\n \n as \n \n task_id\n \n\n\n\n \n from base\n),\n\nfinal as (\n \n select \n project_id,\n task_id\n from fields\n)\n\nselect * \nfrom final", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "\"postgres\".\"asana_integrations_tests_stg_asana\".\"stg_asana__project_task\""}, "model.asana_source.stg_asana__project": {"compiled": true, "resource_type": "model", "depends_on": {"macros": ["macro.asana_source.get_project_columns", "macro.fivetran_utils.fill_staging_columns", "macro.dbt.type_timestamp"], "nodes": ["model.asana_source.stg_asana__project_tmp", "model.asana_source.stg_asana__project_tmp"]}, "config": {"enabled": true, "alias": null, "schema": "stg_asana", "database": null, "tags": [], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "post-hook": [], "pre-hook": []}, "database": "postgres", "schema": "asana_integrations_tests_stg_asana", "fqn": ["asana_source", "stg_asana__project"], "unique_id": "model.asana_source.stg_asana__project", "raw_code": "with base as (\n\n select * \n from {{ ref('stg_asana__project_tmp') }}\n\n),\n\nfields as (\n\n select\n {{\n fivetran_utils.fill_staging_columns(\n source_columns=adapter.get_columns_in_relation(ref('stg_asana__project_tmp')),\n staging_columns=get_project_columns()\n )\n }}\n \n from base\n),\n\nfinal as (\n \n select \n id as project_id,\n archived as is_archived,\n cast(created_at as {{ dbt.type_timestamp() }}) as created_at,\n current_status,\n cast(due_date as {{ dbt.type_timestamp() }}) as due_date,\n cast(modified_at as {{ dbt.type_timestamp() }}) as modified_at,\n name as project_name,\n owner_id as owner_user_id,\n public as is_public,\n team_id,\n workspace_id,\n notes\n from fields\n)\n\nselect * \nfrom final", "language": "sql", "package_name": "asana_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/asana_source", "path": "stg_asana__project.sql", "original_file_path": "models/stg_asana__project.sql", "name": "stg_asana__project", "alias": "stg_asana__project", "checksum": {"name": "sha256", "checksum": "650704717a66d2223ae458831cbcfdfa0a1045be4e365f0731a1a88f1fc77162"}, "tags": [], "refs": [["stg_asana__project_tmp"], ["stg_asana__project_tmp"]], "sources": [], "metrics": [], "description": "Table containing all projects", "columns": {"project_id": {"name": "project_id", "description": "System-generated unique ID of the project", "meta": {}, "data_type": null, "quote": null, "tags": []}, "is_archived": {"name": "is_archived", "description": "Boolean representing if the project has been archived in the UI", "meta": {}, "data_type": null, "quote": null, "tags": []}, "created_at": {"name": "created_at", "description": "Timestamp of when the project was created", "meta": {}, "data_type": null, "quote": null, "tags": []}, "current_status": {"name": "current_status", "description": "The most recent progress status update for the project (free-form string)", "meta": {}, "data_type": null, "quote": null, "tags": []}, "due_date": {"name": "due_date", "description": "The date the project is due on, if given", "meta": {}, "data_type": null, "quote": null, "tags": []}, "modified_at": {"name": "modified_at", "description": "Timestamp of when the project was last modified (doesn't include comments or tasks)", "meta": {}, "data_type": null, "quote": null, "tags": []}, "project_name": {"name": "project_name", "description": "The user-facing name of the project", "meta": {}, "data_type": null, "quote": null, "tags": []}, "owner_user_id": {"name": "owner_user_id", "description": "Foreign key referencing the USER who owns the project.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "is_public": {"name": "is_public", "description": "Boolean that is true if the project is public to all users in the organization", "meta": {}, "data_type": null, "quote": null, "tags": []}, "team_id": {"name": "team_id", "description": "Foreign key referencing the TEAM that the project is shared with.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "workspace_id": {"name": "workspace_id", "description": "The ID of the organization's entire Asana workspace. Not relevant unless you're looking at multiple orgs", "meta": {}, "data_type": null, "quote": null, "tags": []}, "notes": {"name": "notes", "description": "Free-form textual notes associated with the project.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "asana_source://models/stg_asana.yml", "compiled_path": "target/compiled/asana_source/models/stg_asana__project.sql", "build_path": null, "deferred": false, "unrendered_config": {"schema": "stg_asana", "materialized": "table"}, "created_at": 1671481804.691991, "compiled_code": "with base as (\n\n select * \n from \"postgres\".\"asana_integrations_tests_stg_asana\".\"stg_asana__project_tmp\"\n\n),\n\nfields as (\n\n select\n \n \n \n _fivetran_deleted\n \n as \n \n _fivetran_deleted\n \n, \n \n \n _fivetran_synced\n \n as \n \n _fivetran_synced\n \n, \n \n \n archived\n \n as \n \n archived\n \n, \n \n \n color\n \n as \n \n color\n \n, \n \n \n created_at\n \n as \n \n created_at\n \n, \n \n \n current_status\n \n as \n \n current_status\n \n, \n \n \n due_date\n \n as \n \n due_date\n \n, \n \n \n id\n \n as \n \n id\n \n, \n \n \n modified_at\n \n as \n \n modified_at\n \n, \n \n \n name\n \n as \n \n name\n \n, \n \n \n notes\n \n as \n \n notes\n \n, \n \n \n owner_id\n \n as \n \n owner_id\n \n, \n \n \n public\n \n as \n \n public\n \n, \n \n \n team_id\n \n as \n \n team_id\n \n, \n \n \n workspace_id\n \n as \n \n workspace_id\n \n\n\n\n \n from base\n),\n\nfinal as (\n \n select \n id as project_id,\n archived as is_archived,\n cast(created_at as TIMESTAMP) as created_at,\n current_status,\n cast(due_date as TIMESTAMP) as due_date,\n cast(modified_at as TIMESTAMP) as modified_at,\n name as project_name,\n owner_id as owner_user_id,\n public as is_public,\n team_id,\n workspace_id,\n notes\n from fields\n)\n\nselect * \nfrom final", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "\"postgres\".\"asana_integrations_tests_stg_asana\".\"stg_asana__project\""}, "model.asana_source.stg_asana__task_follower": {"compiled": true, "resource_type": "model", "depends_on": {"macros": ["macro.asana_source.get_task_follower_columns", "macro.fivetran_utils.fill_staging_columns"], "nodes": ["model.asana_source.stg_asana__task_follower_tmp", "model.asana_source.stg_asana__task_follower_tmp"]}, "config": {"enabled": true, "alias": null, "schema": "stg_asana", "database": null, "tags": [], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "post-hook": [], "pre-hook": []}, "database": "postgres", "schema": "asana_integrations_tests_stg_asana", "fqn": ["asana_source", "stg_asana__task_follower"], "unique_id": "model.asana_source.stg_asana__task_follower", "raw_code": "with base as (\n\n select * \n from {{ ref('stg_asana__task_follower_tmp') }}\n\n),\n\nfields as (\n\n select\n {{\n fivetran_utils.fill_staging_columns(\n source_columns=adapter.get_columns_in_relation(ref('stg_asana__task_follower_tmp')),\n staging_columns=get_task_follower_columns()\n )\n }}\n \n from base\n),\n\nfinal as (\n \n select \n task_id,\n user_id\n from fields\n)\n\nselect * \nfrom final", "language": "sql", "package_name": "asana_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/asana_source", "path": "stg_asana__task_follower.sql", "original_file_path": "models/stg_asana__task_follower.sql", "name": "stg_asana__task_follower", "alias": "stg_asana__task_follower", "checksum": {"name": "sha256", "checksum": "8eb6b3969960cac92d44612ecb9f7486545bb7e92bcf1c96064a4f384ffed3e4"}, "tags": [], "refs": [["stg_asana__task_follower_tmp"], ["stg_asana__task_follower_tmp"]], "sources": [], "metrics": [], "description": "Table of tasks with the users that are following them. Tasks without users do not appear here.", "columns": {"task_id": {"name": "task_id", "description": "Foreign key referencing the ID of the TASK being followed.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "user_id": {"name": "user_id", "description": "Foreign key referencing the ID of the USER following the task.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "asana_source://models/stg_asana.yml", "compiled_path": "target/compiled/asana_source/models/stg_asana__task_follower.sql", "build_path": null, "deferred": false, "unrendered_config": {"schema": "stg_asana", "materialized": "table"}, "created_at": 1671481804.698498, "compiled_code": "with base as (\n\n select * \n from \"postgres\".\"asana_integrations_tests_stg_asana\".\"stg_asana__task_follower_tmp\"\n\n),\n\nfields as (\n\n select\n \n \n \n _fivetran_synced\n \n as \n \n _fivetran_synced\n \n, \n \n \n task_id\n \n as \n \n task_id\n \n, \n \n \n user_id\n \n as \n \n user_id\n \n\n\n\n \n from base\n),\n\nfinal as (\n \n select \n task_id,\n user_id\n from fields\n)\n\nselect * \nfrom final", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "\"postgres\".\"asana_integrations_tests_stg_asana\".\"stg_asana__task_follower\""}, "model.asana_source.stg_asana__story_tmp": {"compiled": true, "resource_type": "model", "depends_on": {"macros": [], "nodes": ["source.asana_source.asana.story"]}, "config": {"enabled": true, "alias": null, "schema": "stg_asana", "database": null, "tags": [], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "post-hook": [], "pre-hook": []}, "database": "postgres", "schema": "asana_integrations_tests_stg_asana", "fqn": ["asana_source", "tmp", "stg_asana__story_tmp"], "unique_id": "model.asana_source.stg_asana__story_tmp", "raw_code": "select * \nfrom {{ var('story') }}", "language": "sql", "package_name": "asana_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/asana_source", "path": "tmp/stg_asana__story_tmp.sql", "original_file_path": "models/tmp/stg_asana__story_tmp.sql", "name": "stg_asana__story_tmp", "alias": "stg_asana__story_tmp", "checksum": {"name": "sha256", "checksum": "699a08f0282626b405f0b4e5216cdbaa879e399314594a61b63ff4a7b042f677"}, "tags": [], "refs": [], "sources": [["asana", "story"]], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/asana_source/models/tmp/stg_asana__story_tmp.sql", "build_path": null, "deferred": false, "unrendered_config": {"schema": "stg_asana", "materialized": "table"}, "created_at": 1671481804.513869, "compiled_code": "select * \nfrom \"postgres\".\"asana_integrations_tests\".\"story_data\"", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "\"postgres\".\"asana_integrations_tests_stg_asana\".\"stg_asana__story_tmp\""}, "model.asana_source.stg_asana__team_tmp": {"compiled": true, "resource_type": "model", "depends_on": {"macros": [], "nodes": ["source.asana_source.asana.team"]}, "config": {"enabled": true, "alias": null, "schema": "stg_asana", "database": null, "tags": [], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "post-hook": [], "pre-hook": []}, "database": "postgres", "schema": "asana_integrations_tests_stg_asana", "fqn": ["asana_source", "tmp", "stg_asana__team_tmp"], "unique_id": "model.asana_source.stg_asana__team_tmp", "raw_code": "select * \nfrom {{ var('team') }}", "language": "sql", "package_name": "asana_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/asana_source", "path": "tmp/stg_asana__team_tmp.sql", "original_file_path": "models/tmp/stg_asana__team_tmp.sql", "name": "stg_asana__team_tmp", "alias": "stg_asana__team_tmp", "checksum": {"name": "sha256", "checksum": "8c107692c9394962da82e0c2460045e6686d962c1eefe0cff564c618aed7a17d"}, "tags": [], "refs": [], "sources": [["asana", "team"]], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/asana_source/models/tmp/stg_asana__team_tmp.sql", "build_path": null, "deferred": false, "unrendered_config": {"schema": "stg_asana", "materialized": "table"}, "created_at": 1671481804.518919, "compiled_code": "select * \nfrom \"postgres\".\"asana_integrations_tests\".\"team_data\"", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "\"postgres\".\"asana_integrations_tests_stg_asana\".\"stg_asana__team_tmp\""}, "model.asana_source.stg_asana__task_tmp": {"compiled": true, "resource_type": "model", "depends_on": {"macros": [], "nodes": ["source.asana_source.asana.task"]}, "config": {"enabled": true, "alias": null, "schema": "stg_asana", "database": null, "tags": [], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "post-hook": [], "pre-hook": []}, "database": "postgres", "schema": "asana_integrations_tests_stg_asana", "fqn": ["asana_source", "tmp", "stg_asana__task_tmp"], "unique_id": "model.asana_source.stg_asana__task_tmp", "raw_code": "select * \nfrom {{ var('task') }}", "language": "sql", "package_name": "asana_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/asana_source", "path": "tmp/stg_asana__task_tmp.sql", "original_file_path": "models/tmp/stg_asana__task_tmp.sql", "name": "stg_asana__task_tmp", "alias": "stg_asana__task_tmp", "checksum": {"name": "sha256", "checksum": "ffb26301a2c952951441cf068b916101fb5cbb9841242e3511499262ffabd879"}, "tags": [], "refs": [], "sources": [["asana", "task"]], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/asana_source/models/tmp/stg_asana__task_tmp.sql", "build_path": null, "deferred": false, "unrendered_config": {"schema": "stg_asana", "materialized": "table"}, "created_at": 1671481804.522231, "compiled_code": "select * \nfrom \"postgres\".\"asana_integrations_tests\".\"task_data\"", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "\"postgres\".\"asana_integrations_tests_stg_asana\".\"stg_asana__task_tmp\""}, "model.asana_source.stg_asana__task_follower_tmp": {"compiled": true, "resource_type": "model", "depends_on": {"macros": [], "nodes": ["source.asana_source.asana.task_follower"]}, "config": {"enabled": true, "alias": null, "schema": "stg_asana", "database": null, "tags": [], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "post-hook": [], "pre-hook": []}, "database": "postgres", "schema": "asana_integrations_tests_stg_asana", "fqn": ["asana_source", "tmp", "stg_asana__task_follower_tmp"], "unique_id": "model.asana_source.stg_asana__task_follower_tmp", "raw_code": "select * \nfrom {{ var('task_follower') }}", "language": "sql", "package_name": "asana_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/asana_source", "path": "tmp/stg_asana__task_follower_tmp.sql", "original_file_path": "models/tmp/stg_asana__task_follower_tmp.sql", "name": "stg_asana__task_follower_tmp", "alias": "stg_asana__task_follower_tmp", "checksum": {"name": "sha256", "checksum": "d03af085dd9a99b6a0d491b3729504de132fe2a3c8b930f72cb6d6774f714896"}, "tags": [], "refs": [], "sources": [["asana", "task_follower"]], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/asana_source/models/tmp/stg_asana__task_follower_tmp.sql", "build_path": null, "deferred": false, "unrendered_config": {"schema": "stg_asana", "materialized": "table"}, "created_at": 1671481804.525449, "compiled_code": "select * \nfrom \"postgres\".\"asana_integrations_tests\".\"task_follower_data\"", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "\"postgres\".\"asana_integrations_tests_stg_asana\".\"stg_asana__task_follower_tmp\""}, "model.asana_source.stg_asana__tag_tmp": {"compiled": true, "resource_type": "model", "depends_on": {"macros": [], "nodes": ["source.asana_source.asana.tag"]}, "config": {"enabled": true, "alias": null, "schema": "stg_asana", "database": null, "tags": [], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "post-hook": [], "pre-hook": []}, "database": "postgres", "schema": "asana_integrations_tests_stg_asana", "fqn": ["asana_source", "tmp", "stg_asana__tag_tmp"], "unique_id": "model.asana_source.stg_asana__tag_tmp", "raw_code": "select * \nfrom {{ var('tag') }}", "language": "sql", "package_name": "asana_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/asana_source", "path": "tmp/stg_asana__tag_tmp.sql", "original_file_path": "models/tmp/stg_asana__tag_tmp.sql", "name": "stg_asana__tag_tmp", "alias": "stg_asana__tag_tmp", "checksum": {"name": "sha256", "checksum": "c394a64eb436d4592c23e4c1876d4e001907bdf6de6fa1267f9bd47c83678711"}, "tags": [], "refs": [], "sources": [["asana", "tag"]], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/asana_source/models/tmp/stg_asana__tag_tmp.sql", "build_path": null, "deferred": false, "unrendered_config": {"schema": "stg_asana", "materialized": "table"}, "created_at": 1671481804.528646, "compiled_code": "select * \nfrom \"postgres\".\"asana_integrations_tests\".\"tag_data\"", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "\"postgres\".\"asana_integrations_tests_stg_asana\".\"stg_asana__tag_tmp\""}, "model.asana_source.stg_asana__task_section_tmp": {"compiled": true, "resource_type": "model", "depends_on": {"macros": [], "nodes": ["source.asana_source.asana.task_section"]}, "config": {"enabled": true, "alias": null, "schema": "stg_asana", "database": null, "tags": [], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "post-hook": [], "pre-hook": []}, "database": "postgres", "schema": "asana_integrations_tests_stg_asana", "fqn": ["asana_source", "tmp", "stg_asana__task_section_tmp"], "unique_id": "model.asana_source.stg_asana__task_section_tmp", "raw_code": "select * \nfrom {{ var('task_section') }}", "language": "sql", "package_name": "asana_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/asana_source", "path": "tmp/stg_asana__task_section_tmp.sql", "original_file_path": "models/tmp/stg_asana__task_section_tmp.sql", "name": "stg_asana__task_section_tmp", "alias": "stg_asana__task_section_tmp", "checksum": {"name": "sha256", "checksum": "453db03084996d17e88a0f1ffda90ee349df4f262db7a3523578f5d4c6a4e5e6"}, "tags": [], "refs": [], "sources": [["asana", "task_section"]], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/asana_source/models/tmp/stg_asana__task_section_tmp.sql", "build_path": null, "deferred": false, "unrendered_config": {"schema": "stg_asana", "materialized": "table"}, "created_at": 1671481804.531862, "compiled_code": "select * \nfrom \"postgres\".\"asana_integrations_tests\".\"task_section_data\"", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "\"postgres\".\"asana_integrations_tests_stg_asana\".\"stg_asana__task_section_tmp\""}, "model.asana_source.stg_asana__task_tag_tmp": {"compiled": true, "resource_type": "model", "depends_on": {"macros": [], "nodes": ["source.asana_source.asana.task_tag"]}, "config": {"enabled": true, "alias": null, "schema": "stg_asana", "database": null, "tags": [], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "post-hook": [], "pre-hook": []}, "database": "postgres", "schema": "asana_integrations_tests_stg_asana", "fqn": ["asana_source", "tmp", "stg_asana__task_tag_tmp"], "unique_id": "model.asana_source.stg_asana__task_tag_tmp", "raw_code": "select * \nfrom {{ var('task_tag') }}", "language": "sql", "package_name": "asana_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/asana_source", "path": "tmp/stg_asana__task_tag_tmp.sql", "original_file_path": "models/tmp/stg_asana__task_tag_tmp.sql", "name": "stg_asana__task_tag_tmp", "alias": "stg_asana__task_tag_tmp", "checksum": {"name": "sha256", "checksum": "00c6fa0be01310e2a827ce46dbadeb2cf3cc24dda4dc22142ed81b7bb0f85a4d"}, "tags": [], "refs": [], "sources": [["asana", "task_tag"]], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/asana_source/models/tmp/stg_asana__task_tag_tmp.sql", "build_path": null, "deferred": false, "unrendered_config": {"schema": "stg_asana", "materialized": "table"}, "created_at": 1671481804.535071, "compiled_code": "select * \nfrom \"postgres\".\"asana_integrations_tests\".\"task_tag_data\"", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "\"postgres\".\"asana_integrations_tests_stg_asana\".\"stg_asana__task_tag_tmp\""}, "model.asana_source.stg_asana__user_tmp": {"compiled": true, "resource_type": "model", "depends_on": {"macros": [], "nodes": ["source.asana_source.asana.user"]}, "config": {"enabled": true, "alias": null, "schema": "stg_asana", "database": null, "tags": [], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "post-hook": [], "pre-hook": []}, "database": "postgres", "schema": "asana_integrations_tests_stg_asana", "fqn": ["asana_source", "tmp", "stg_asana__user_tmp"], "unique_id": "model.asana_source.stg_asana__user_tmp", "raw_code": "select * \nfrom {{ var('user') }}", "language": "sql", "package_name": "asana_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/asana_source", "path": "tmp/stg_asana__user_tmp.sql", "original_file_path": "models/tmp/stg_asana__user_tmp.sql", "name": "stg_asana__user_tmp", "alias": "stg_asana__user_tmp", "checksum": {"name": "sha256", "checksum": "6a45d1112d3ae79f22784f5fd5723a27b7894d57aea5795a37921842affc0085"}, "tags": [], "refs": [], "sources": [["asana", "user"]], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/asana_source/models/tmp/stg_asana__user_tmp.sql", "build_path": null, "deferred": false, "unrendered_config": {"schema": "stg_asana", "materialized": "table"}, "created_at": 1671481804.5389209, "compiled_code": "select * \nfrom \"postgres\".\"asana_integrations_tests\".\"user_data\"", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "\"postgres\".\"asana_integrations_tests_stg_asana\".\"stg_asana__user_tmp\""}, "model.asana_source.stg_asana__section_tmp": {"compiled": true, "resource_type": "model", "depends_on": {"macros": [], "nodes": ["source.asana_source.asana.section"]}, "config": {"enabled": true, "alias": null, "schema": "stg_asana", "database": null, "tags": [], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "post-hook": [], "pre-hook": []}, "database": "postgres", "schema": "asana_integrations_tests_stg_asana", "fqn": ["asana_source", "tmp", "stg_asana__section_tmp"], "unique_id": "model.asana_source.stg_asana__section_tmp", "raw_code": "select * \nfrom {{ var('section') }}", "language": "sql", "package_name": "asana_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/asana_source", "path": "tmp/stg_asana__section_tmp.sql", "original_file_path": "models/tmp/stg_asana__section_tmp.sql", "name": "stg_asana__section_tmp", "alias": "stg_asana__section_tmp", "checksum": {"name": "sha256", "checksum": "83155348ae27cce121000df7d3d07cd4f734098dca2747df7dd5affde1c84188"}, "tags": [], "refs": [], "sources": [["asana", "section"]], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/asana_source/models/tmp/stg_asana__section_tmp.sql", "build_path": null, "deferred": false, "unrendered_config": {"schema": "stg_asana", "materialized": "table"}, "created_at": 1671481804.5421288, "compiled_code": "select * \nfrom \"postgres\".\"asana_integrations_tests\".\"section_data\"", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "\"postgres\".\"asana_integrations_tests_stg_asana\".\"stg_asana__section_tmp\""}, "model.asana_source.stg_asana__project_tmp": {"compiled": true, "resource_type": "model", "depends_on": {"macros": [], "nodes": ["source.asana_source.asana.project"]}, "config": {"enabled": true, "alias": null, "schema": "stg_asana", "database": null, "tags": [], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "post-hook": [], "pre-hook": []}, "database": "postgres", "schema": "asana_integrations_tests_stg_asana", "fqn": ["asana_source", "tmp", "stg_asana__project_tmp"], "unique_id": "model.asana_source.stg_asana__project_tmp", "raw_code": "select * \nfrom {{ var('project') }}", "language": "sql", "package_name": "asana_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/asana_source", "path": "tmp/stg_asana__project_tmp.sql", "original_file_path": "models/tmp/stg_asana__project_tmp.sql", "name": "stg_asana__project_tmp", "alias": "stg_asana__project_tmp", "checksum": {"name": "sha256", "checksum": "2c1320ac7d1c876b9aa540a4aa0a07bcacfa92e35d74a60cb09a5948ac6869ad"}, "tags": [], "refs": [], "sources": [["asana", "project"]], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/asana_source/models/tmp/stg_asana__project_tmp.sql", "build_path": null, "deferred": false, "unrendered_config": {"schema": "stg_asana", "materialized": "table"}, "created_at": 1671481804.545301, "compiled_code": "select * \nfrom \"postgres\".\"asana_integrations_tests\".\"project_data\"", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "\"postgres\".\"asana_integrations_tests_stg_asana\".\"stg_asana__project_tmp\""}, "model.asana_source.stg_asana__project_task_tmp": {"compiled": true, "resource_type": "model", "depends_on": {"macros": [], "nodes": ["source.asana_source.asana.project_task"]}, "config": {"enabled": true, "alias": null, "schema": "stg_asana", "database": null, "tags": [], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "post-hook": [], "pre-hook": []}, "database": "postgres", "schema": "asana_integrations_tests_stg_asana", "fqn": ["asana_source", "tmp", "stg_asana__project_task_tmp"], "unique_id": "model.asana_source.stg_asana__project_task_tmp", "raw_code": "select * \nfrom {{ var('project_task') }}", "language": "sql", "package_name": "asana_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/asana_source", "path": "tmp/stg_asana__project_task_tmp.sql", "original_file_path": "models/tmp/stg_asana__project_task_tmp.sql", "name": "stg_asana__project_task_tmp", "alias": "stg_asana__project_task_tmp", "checksum": {"name": "sha256", "checksum": "2ad5271ec001d7cb80698feb2fcc08b189f360d756f86feb074bbd904002b10e"}, "tags": [], "refs": [], "sources": [["asana", "project_task"]], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/asana_source/models/tmp/stg_asana__project_task_tmp.sql", "build_path": null, "deferred": false, "unrendered_config": {"schema": "stg_asana", "materialized": "table"}, "created_at": 1671481804.5485241, "compiled_code": "select * \nfrom \"postgres\".\"asana_integrations_tests\".\"project_task_data\"", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "\"postgres\".\"asana_integrations_tests_stg_asana\".\"stg_asana__project_task_tmp\""}, "model.asana.asana__daily_metrics": {"compiled": true, "resource_type": "model", "depends_on": {"macros": ["macro.dbt.dateadd", "macro.dbt_utils.date_spine", "macro.dbt.datediff", "macro.dbt.date_trunc", "macro.dbt.type_timestamp", "macro.dbt.run_query"], "nodes": ["model.asana.asana__task"]}, "config": {"enabled": true, "alias": null, "schema": "asana", "database": null, "tags": [], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "post-hook": [], "pre-hook": []}, "database": "postgres", "schema": "asana_integrations_tests_asana", "fqn": ["asana", "asana__daily_metrics"], "unique_id": "model.asana.asana__daily_metrics", "raw_code": "with task as (\n\n select *\n from {{ ref('asana__task') }}\n),\n\n\nspine as (\n\n {% if execute %}\n {% set first_date_query %}\n select \n cast(min(created_at) as {{ dbt.type_timestamp() }}) as min_date \n from {{ ref('asana__task') }}\n {% endset %}\n {% set first_date = run_query(first_date_query).columns[0][0]|string %}\n \n {% else %} {% set first_date = \"2016-01-01\" %}\n {% endif %}\n\n\n {{ dbt_utils.date_spine(\n datepart = \"day\", \n start_date = \"cast('\" ~ first_date[0:10] ~ \"'as date)\", \n end_date = dbt.dateadd(\"week\", 1, \"current_date\") ) \n }} \n\n),\n\nspine_tasks as (\n \n select\n spine.date_day,\n sum( {{ dbt.datediff('task.created_at', 'spine.date_day', 'day') }} ) as total_days_open,\n count( task.task_id) as number_of_tasks_open,\n sum( case when cast(spine.date_day as timestamp) >= {{ dbt.date_trunc('day', 'task.first_assigned_at') }} then 1 else 0 end) as number_of_tasks_open_assigned,\n sum( {{ dbt.datediff('task.first_assigned_at', 'spine.date_day', 'day') }} ) as total_days_open_assigned,\n sum( case when cast(spine.date_day as timestamp) = {{ dbt.date_trunc('day', 'task.created_at') }} then 1 else 0 end) as number_of_tasks_created,\n sum( case when cast(spine.date_day as timestamp) = {{ dbt.date_trunc('day', 'task.completed_at') }} then 1 else 0 end) as number_of_tasks_completed\n\n from spine\n join task -- can't do left join with no = \n on cast(spine.date_day as timestamp) >= {{ dbt.date_trunc('day', 'task.created_at') }}\n and case when task.is_completed then \n cast(spine.date_day as timestamp) < {{ dbt.date_trunc('day', 'task.completed_at') }}\n else true end\n\n group by 1\n),\n\njoin_metrics as (\n\n select\n spine.date_day,\n coalesce(spine_tasks.number_of_tasks_open, 0) as number_of_tasks_open,\n coalesce(spine_tasks.number_of_tasks_open_assigned, 0) as number_of_tasks_open_assigned,\n coalesce(spine_tasks.number_of_tasks_created, 0) as number_of_tasks_created,\n coalesce(spine_tasks.number_of_tasks_completed, 0) as number_of_tasks_completed,\n\n round(nullif(spine_tasks.total_days_open,0) * 1.0 / nullif(spine_tasks.number_of_tasks_open,0), 0) as avg_days_open,\n round(nullif(spine_tasks.total_days_open_assigned,0) * 1.0 / nullif(spine_tasks.number_of_tasks_open_assigned,0), 0) as avg_days_open_assigned\n\n from \n spine\n left join spine_tasks on spine_tasks.date_day = spine.date_day \n\n)\n\nselect * from join_metrics\norder by date_day desc", "language": "sql", "package_name": "asana", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/asana", "path": "asana__daily_metrics.sql", "original_file_path": "models/asana__daily_metrics.sql", "name": "asana__daily_metrics", "alias": "asana__daily_metrics", "checksum": {"name": "sha256", "checksum": "41f8d6d5ba94eacd2d9f47a00c49f66d75347bb7ce10a9da1ccd09788edc7f65"}, "tags": [], "refs": [["asana__task"]], "sources": [], "metrics": [], "description": "Table of task metrics per each day", "columns": {"date_day": {"name": "date_day", "description": "Unique day for which metrics are calculated.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "number_of_tasks_open": {"name": "number_of_tasks_open", "description": "The number of tasks open at that point in time", "meta": {}, "data_type": null, "quote": null, "tags": []}, "number_of_tasks_open_assigned": {"name": "number_of_tasks_open_assigned", "description": "The number of tasks that are open on that day and have been assigned", "meta": {}, "data_type": null, "quote": null, "tags": []}, "number_of_tasks_created": {"name": "number_of_tasks_created", "description": "The number of tasks created on that day", "meta": {}, "data_type": null, "quote": null, "tags": []}, "number_of_tasks_completed": {"name": "number_of_tasks_completed", "description": "The number of tasks completed on that day", "meta": {}, "data_type": null, "quote": null, "tags": []}, "avg_days_open": {"name": "avg_days_open", "description": "The average time that all tasks open on this day have spent open.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "avg_days_open_assigned": {"name": "avg_days_open_assigned", "description": "The average time that all tasks open on this day have spent open and assigned.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "asana://models/asana.yml", "compiled_path": "target/compiled/asana/models/asana__daily_metrics.sql", "build_path": null, "deferred": false, "unrendered_config": {"schema": "asana", "materialized": "table"}, "created_at": 1671481804.767499, "compiled_code": "with task as (\n\n select *\n from \"postgres\".\"asana_integrations_tests_asana\".\"asana__task\"\n),\n\n\nspine as (\n\n \n \n \n \n \n\n\n \n\n\n\n\n\nwith rawdata as (\n\n \n\n \n\n with p as (\n select 0 as generated_number union all select 1\n ), unioned as (\n\n select\n\n \n p0.generated_number * power(2, 0)\n + \n \n p1.generated_number * power(2, 1)\n + \n \n p2.generated_number * power(2, 2)\n + \n \n p3.generated_number * power(2, 3)\n + \n \n p4.generated_number * power(2, 4)\n + \n \n p5.generated_number * power(2, 5)\n + \n \n p6.generated_number * power(2, 6)\n + \n \n p7.generated_number * power(2, 7)\n + \n \n p8.generated_number * power(2, 8)\n + \n \n p9.generated_number * power(2, 9)\n + \n \n p10.generated_number * power(2, 10)\n \n \n + 1\n as generated_number\n\n from\n\n \n p as p0\n cross join \n \n p as p1\n cross join \n \n p as p2\n cross join \n \n p as p3\n cross join \n \n p as p4\n cross join \n \n p as p5\n cross join \n \n p as p6\n cross join \n \n p as p7\n cross join \n \n p as p8\n cross join \n \n p as p9\n cross join \n \n p as p10\n \n \n\n )\n\n select *\n from unioned\n where generated_number <= 1211\n order by generated_number\n\n\n\n),\n\nall_periods as (\n\n select (\n \n\n cast('2019-09-02'as date) + ((interval '1 day') * (row_number() over (order by 1) - 1))\n\n\n ) as date_day\n from rawdata\n\n),\n\nfiltered as (\n\n select *\n from all_periods\n where date_day <= \n\n current_date + ((interval '1 week') * (1))\n\n\n\n)\n\nselect * from filtered\n\n \n\n),\n\nspine_tasks as (\n \n select\n spine.date_day,\n sum( \n ((spine.date_day)::date - (task.created_at)::date)\n ) as total_days_open,\n count( task.task_id) as number_of_tasks_open,\n sum( case when cast(spine.date_day as timestamp) >= date_trunc('day', task.first_assigned_at) then 1 else 0 end) as number_of_tasks_open_assigned,\n sum( \n ((spine.date_day)::date - (task.first_assigned_at)::date)\n ) as total_days_open_assigned,\n sum( case when cast(spine.date_day as timestamp) = date_trunc('day', task.created_at) then 1 else 0 end) as number_of_tasks_created,\n sum( case when cast(spine.date_day as timestamp) = date_trunc('day', task.completed_at) then 1 else 0 end) as number_of_tasks_completed\n\n from spine\n join task -- can't do left join with no = \n on cast(spine.date_day as timestamp) >= date_trunc('day', task.created_at)\n and case when task.is_completed then \n cast(spine.date_day as timestamp) < date_trunc('day', task.completed_at)\n else true end\n\n group by 1\n),\n\njoin_metrics as (\n\n select\n spine.date_day,\n coalesce(spine_tasks.number_of_tasks_open, 0) as number_of_tasks_open,\n coalesce(spine_tasks.number_of_tasks_open_assigned, 0) as number_of_tasks_open_assigned,\n coalesce(spine_tasks.number_of_tasks_created, 0) as number_of_tasks_created,\n coalesce(spine_tasks.number_of_tasks_completed, 0) as number_of_tasks_completed,\n\n round(nullif(spine_tasks.total_days_open,0) * 1.0 / nullif(spine_tasks.number_of_tasks_open,0), 0) as avg_days_open,\n round(nullif(spine_tasks.total_days_open_assigned,0) * 1.0 / nullif(spine_tasks.number_of_tasks_open_assigned,0), 0) as avg_days_open_assigned\n\n from \n spine\n left join spine_tasks on spine_tasks.date_day = spine.date_day \n\n)\n\nselect * from join_metrics\norder by date_day desc", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "\"postgres\".\"asana_integrations_tests_asana\".\"asana__daily_metrics\""}, "model.asana.asana__user": {"compiled": true, "resource_type": "model", "depends_on": {"macros": ["macro.fivetran_utils.string_agg"], "nodes": ["model.asana.int_asana__user_task_metrics", "model.asana_source.stg_asana__user", "model.asana.int_asana__project_user"]}, "config": {"enabled": true, "alias": null, "schema": "asana", "database": null, "tags": [], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "post-hook": [], "pre-hook": []}, "database": "postgres", "schema": "asana_integrations_tests_asana", "fqn": ["asana", "asana__user"], "unique_id": "model.asana.asana__user", "raw_code": "with user_task_metrics as (\n\n select * \n from {{ ref('int_asana__user_task_metrics') }}\n),\n\nasana_user as (\n select * \n from {{ var('user') }}\n),\n\nproject_user as (\n \n select * \n from {{ ref('int_asana__project_user') }}\n\n where currently_working_on or role = 'owner'\n),\n\ncount_user_projects as (\n\n select \n user_id,\n sum(case when role = 'owner' then 1\n else 0 end) as number_of_projects_owned,\n sum(case when currently_working_on = true then 1\n else 0 end) as number_of_projects_currently_assigned_to\n\n from project_user\n\n group by 1\n\n),\n\nunique_user_projects as (\n select\n user_id,\n project_id,\n project_name\n\n from project_user\n group by 1,2,3\n),\n\n\nagg_user_projects as (\n\n select \n user_id,\n {{ fivetran_utils.string_agg( 'project_name', \"', '\" )}} as projects_working_on\n\n from unique_user_projects\n group by 1\n\n),\n\nuser_join as (\n\n select \n asana_user.*,\n coalesce(user_task_metrics.number_of_open_tasks, 0) as number_of_open_tasks,\n coalesce(user_task_metrics.number_of_tasks_completed, 0) as number_of_tasks_completed,\n round(user_task_metrics.avg_close_time_days, 0) as avg_close_time_days,\n\n coalesce(count_user_projects.number_of_projects_owned, 0) as number_of_projects_owned,\n coalesce(count_user_projects.number_of_projects_currently_assigned_to, 0) as number_of_projects_currently_assigned_to,\n agg_user_projects.projects_working_on\n \n from asana_user \n\n left join user_task_metrics on asana_user.user_id = user_task_metrics.user_id\n left join count_user_projects on asana_user.user_id = count_user_projects.user_id\n left join agg_user_projects on asana_user.user_id = agg_user_projects.user_id\n)\n\nselect * from user_join", "language": "sql", "package_name": "asana", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/asana", "path": "asana__user.sql", "original_file_path": "models/asana__user.sql", "name": "asana__user", "alias": "asana__user", "checksum": {"name": "sha256", "checksum": "88ccd963cf4ee613643a10749d93ce8c912a38c2672f70c54bd88397607c7a47"}, "tags": [], "refs": [["int_asana__user_task_metrics"], ["stg_asana__user"], ["int_asana__project_user"]], "sources": [], "metrics": [], "description": "Enriched user table consisting of base user info + metrics around tasks and completions", "columns": {"user_id": {"name": "user_id", "description": "System generated unique ID of the user", "meta": {}, "data_type": null, "quote": null, "tags": []}, "user_name": {"name": "user_name", "description": "Name of the user as it appears in the UI", "meta": {}, "data_type": null, "quote": null, "tags": []}, "email": {"name": "email", "description": "The user's email", "meta": {}, "data_type": null, "quote": null, "tags": []}, "number_of_open_tasks": {"name": "number_of_open_tasks", "description": "Count of the currently open tasks assigned to this user", "meta": {}, "data_type": null, "quote": null, "tags": []}, "number_of_tasks_completed": {"name": "number_of_tasks_completed", "description": "Count of the tasks that this user has completed", "meta": {}, "data_type": null, "quote": null, "tags": []}, "avg_close_time_days": {"name": "avg_close_time_days", "description": "The avg number of days it has taken the user to complete tasks once assigned to them.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "number_of_projects_owned": {"name": "number_of_projects_owned", "description": "Count of the projects that this user is the owner of (excludes archived projects)", "meta": {}, "data_type": null, "quote": null, "tags": []}, "number_of_projects_currently_assigned_to": {"name": "number_of_projects_currently_assigned_to", "description": "Count of the projects that the user is currently assigned open tasks to.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "projects_working_on": {"name": "projects_working_on", "description": "Aggregated list of the projects that the user is currently assigned to or owns", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "asana://models/asana.yml", "compiled_path": "target/compiled/asana/models/asana__user.sql", "build_path": null, "deferred": false, "unrendered_config": {"schema": "asana", "materialized": "table"}, "created_at": 1671481804.759551, "compiled_code": "with __dbt__cte__int_asana__user_task_metrics as (\nwith tasks as (\n\n select * \n from \"postgres\".\"asana_integrations_tests_asana\".\"asana__task\"\n where assignee_user_id is not null\n\n), \n\nagg_user_tasks as (\n\n select \n assignee_user_id as user_id,\n sum(case when not is_completed then 1 else 0 end) as number_of_open_tasks,\n sum(case when is_completed then 1 else 0 end) as number_of_tasks_completed,\n sum(case when is_completed then days_since_last_assignment else 0 end) as days_assigned_this_user -- will divde later for avg\n\n from tasks\n\n group by 1\n\n),\n\nfinal as (\n select\n agg_user_tasks.user_id,\n agg_user_tasks.number_of_open_tasks,\n agg_user_tasks.number_of_tasks_completed,\n nullif(agg_user_tasks.days_assigned_this_user, 0) * 1.0 / nullif(agg_user_tasks.number_of_tasks_completed, 0) as avg_close_time_days\n\n from \n agg_user_tasks \n)\n\nselect * from final\n), __dbt__cte__int_asana__task_assignee as (\nwith task as (\n\n select * \n from \"postgres\".\"asana_integrations_tests_stg_asana\".\"stg_asana__task\"\n\n),\n\nasana_user as (\n\n select *\n from \"postgres\".\"asana_integrations_tests_stg_asana\".\"stg_asana__user\"\n),\n\ntask_assignee as (\n\n select\n task.*,\n assignee_user_id is not null as has_assignee,\n asana_user.user_name as assignee_name,\n asana_user.email as assignee_email\n\n from task \n left join asana_user \n on task.assignee_user_id = asana_user.user_id\n)\n\nselect * from task_assignee\n), __dbt__cte__int_asana__project_user as (\nwith project_tasks as (\n \n select *\n from \"postgres\".\"asana_integrations_tests_stg_asana\".\"stg_asana__project_task\"\n),\n\nassigned_tasks as (\n \n select * \n from __dbt__cte__int_asana__task_assignee\n where has_assignee\n \n),\n\nproject as (\n \n select *\n from \"postgres\".\"asana_integrations_tests_stg_asana\".\"stg_asana__project\"\n\n where not is_archived\n\n),\n\nproject_assignee as (\n\n select\n project_tasks.project_id,\n project_tasks.task_id,\n assigned_tasks.assignee_user_id,\n assigned_tasks.assignee_name,\n not assigned_tasks.is_completed as currently_working_on\n\n from project_tasks \n join assigned_tasks \n on assigned_tasks.task_id = project_tasks.task_id\n\n),\n\nproject_owner as (\n\n select \n project_id,\n project_name,\n owner_user_id\n\n from project\n \n where owner_user_id is not null\n),\n\nproject_user as (\n \n select\n project_id,\n project_name,\n owner_user_id as user_id,\n 'owner' as role,\n null as currently_working_on\n \n from project_owner\n\n union all\n\n select\n project.project_id,\n project.project_name,\n project_assignee.assignee_user_id as user_id,\n 'task assignee' as role,\n project_assignee.currently_working_on\n \n from project \n \n join project_assignee \n on project.project_id = project_assignee.project_id\n group by 1,2,3,4,5\n\n)\n\n\nselect * from project_user\n),user_task_metrics as (\n\n select * \n from __dbt__cte__int_asana__user_task_metrics\n),\n\nasana_user as (\n select * \n from \"postgres\".\"asana_integrations_tests_stg_asana\".\"stg_asana__user\"\n),\n\nproject_user as (\n \n select * \n from __dbt__cte__int_asana__project_user\n\n where currently_working_on or role = 'owner'\n),\n\ncount_user_projects as (\n\n select \n user_id,\n sum(case when role = 'owner' then 1\n else 0 end) as number_of_projects_owned,\n sum(case when currently_working_on = true then 1\n else 0 end) as number_of_projects_currently_assigned_to\n\n from project_user\n\n group by 1\n\n),\n\nunique_user_projects as (\n select\n user_id,\n project_id,\n project_name\n\n from project_user\n group by 1,2,3\n),\n\n\nagg_user_projects as (\n\n select \n user_id,\n \n string_agg(project_name, ', ')\n\n as projects_working_on\n\n from unique_user_projects\n group by 1\n\n),\n\nuser_join as (\n\n select \n asana_user.*,\n coalesce(user_task_metrics.number_of_open_tasks, 0) as number_of_open_tasks,\n coalesce(user_task_metrics.number_of_tasks_completed, 0) as number_of_tasks_completed,\n round(user_task_metrics.avg_close_time_days, 0) as avg_close_time_days,\n\n coalesce(count_user_projects.number_of_projects_owned, 0) as number_of_projects_owned,\n coalesce(count_user_projects.number_of_projects_currently_assigned_to, 0) as number_of_projects_currently_assigned_to,\n agg_user_projects.projects_working_on\n \n from asana_user \n\n left join user_task_metrics on asana_user.user_id = user_task_metrics.user_id\n left join count_user_projects on asana_user.user_id = count_user_projects.user_id\n left join agg_user_projects on asana_user.user_id = agg_user_projects.user_id\n)\n\nselect * from user_join", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.asana.int_asana__user_task_metrics", "sql": " __dbt__cte__int_asana__user_task_metrics as (\nwith tasks as (\n\n select * \n from \"postgres\".\"asana_integrations_tests_asana\".\"asana__task\"\n where assignee_user_id is not null\n\n), \n\nagg_user_tasks as (\n\n select \n assignee_user_id as user_id,\n sum(case when not is_completed then 1 else 0 end) as number_of_open_tasks,\n sum(case when is_completed then 1 else 0 end) as number_of_tasks_completed,\n sum(case when is_completed then days_since_last_assignment else 0 end) as days_assigned_this_user -- will divde later for avg\n\n from tasks\n\n group by 1\n\n),\n\nfinal as (\n select\n agg_user_tasks.user_id,\n agg_user_tasks.number_of_open_tasks,\n agg_user_tasks.number_of_tasks_completed,\n nullif(agg_user_tasks.days_assigned_this_user, 0) * 1.0 / nullif(agg_user_tasks.number_of_tasks_completed, 0) as avg_close_time_days\n\n from \n agg_user_tasks \n)\n\nselect * from final\n)"}, {"id": "model.asana.int_asana__task_assignee", "sql": " __dbt__cte__int_asana__task_assignee as (\nwith task as (\n\n select * \n from \"postgres\".\"asana_integrations_tests_stg_asana\".\"stg_asana__task\"\n\n),\n\nasana_user as (\n\n select *\n from \"postgres\".\"asana_integrations_tests_stg_asana\".\"stg_asana__user\"\n),\n\ntask_assignee as (\n\n select\n task.*,\n assignee_user_id is not null as has_assignee,\n asana_user.user_name as assignee_name,\n asana_user.email as assignee_email\n\n from task \n left join asana_user \n on task.assignee_user_id = asana_user.user_id\n)\n\nselect * from task_assignee\n)"}, {"id": "model.asana.int_asana__project_user", "sql": " __dbt__cte__int_asana__project_user as (\nwith project_tasks as (\n \n select *\n from \"postgres\".\"asana_integrations_tests_stg_asana\".\"stg_asana__project_task\"\n),\n\nassigned_tasks as (\n \n select * \n from __dbt__cte__int_asana__task_assignee\n where has_assignee\n \n),\n\nproject as (\n \n select *\n from \"postgres\".\"asana_integrations_tests_stg_asana\".\"stg_asana__project\"\n\n where not is_archived\n\n),\n\nproject_assignee as (\n\n select\n project_tasks.project_id,\n project_tasks.task_id,\n assigned_tasks.assignee_user_id,\n assigned_tasks.assignee_name,\n not assigned_tasks.is_completed as currently_working_on\n\n from project_tasks \n join assigned_tasks \n on assigned_tasks.task_id = project_tasks.task_id\n\n),\n\nproject_owner as (\n\n select \n project_id,\n project_name,\n owner_user_id\n\n from project\n \n where owner_user_id is not null\n),\n\nproject_user as (\n \n select\n project_id,\n project_name,\n owner_user_id as user_id,\n 'owner' as role,\n null as currently_working_on\n \n from project_owner\n\n union all\n\n select\n project.project_id,\n project.project_name,\n project_assignee.assignee_user_id as user_id,\n 'task assignee' as role,\n project_assignee.currently_working_on\n \n from project \n \n join project_assignee \n on project.project_id = project_assignee.project_id\n group by 1,2,3,4,5\n\n)\n\n\nselect * from project_user\n)"}], "relation_name": "\"postgres\".\"asana_integrations_tests_asana\".\"asana__user\""}, "model.asana.asana__task": {"compiled": true, "resource_type": "model", "depends_on": {"macros": [], "nodes": ["model.asana_source.stg_asana__task", "model.asana.int_asana__task_comments", "model.asana.int_asana__task_followers", "model.asana.int_asana__task_open_length", "model.asana.int_asana__task_tags", "model.asana.int_asana__task_assignee", "model.asana.int_asana__task_projects", "model.asana.int_asana__subtask_parent", "model.asana.int_asana__task_first_modifier"]}, "config": {"enabled": true, "alias": null, "schema": "asana", "database": null, "tags": [], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "post-hook": [], "pre-hook": []}, "database": "postgres", "schema": "asana_integrations_tests_asana", "fqn": ["asana", "asana__task"], "unique_id": "model.asana.asana__task", "raw_code": "with task as (\n select *\n from {{ var('task') }}\n),\n\ntask_comments as (\n\n select * \n from {{ ref('int_asana__task_comments') }}\n),\n\ntask_followers as (\n\n select *\n from {{ ref('int_asana__task_followers') }}\n),\n\ntask_open_length as (\n\n select *\n from {{ ref('int_asana__task_open_length') }}\n),\n\ntask_tags as (\n\n select *\n from {{ ref('int_asana__task_tags') }}\n),\n\ntask_assignee as (\n\n select * \n from {{ ref('int_asana__task_assignee') }}\n where has_assignee\n),\n\ntask_projects as (\n\n select *\n from {{ ref('int_asana__task_projects') }}\n),\n\nsubtask_parent as (\n\n select * \n from {{ ref('int_asana__subtask_parent') }}\n\n),\n\ntask_first_modifier as (\n \n select *\n from {{ ref('int_asana__task_first_modifier') }}\n),\n\ntask_join as (\n\n select\n task.*,\n concat('https://app.asana.com/0/0/', task.task_id) as task_link,\n task_assignee.assignee_name,\n task_assignee.assignee_email,\n \n task_open_length.days_open, \n task_open_length.is_currently_assigned,\n task_open_length.has_been_assigned,\n task_open_length.days_since_last_assignment, -- is null for never-assigned tasks\n task_open_length.days_since_first_assignment, -- is null for never-assigned tasks\n task_open_length.last_assigned_at,\n task_open_length.first_assigned_at, \n\n task_first_modifier.first_modifier_user_id,\n task_first_modifier.first_modifier_name,\n\n task_comments.conversation, \n coalesce(task_comments.number_of_comments, 0) as number_of_comments, \n task_followers.followers,\n coalesce(task_followers.number_of_followers, 0) as number_of_followers,\n task_tags.tags, \n coalesce(task_tags.number_of_tags, 0) as number_of_tags, \n \n task_projects.projects_sections,\n\n subtask_parent.subtask_id is not null as is_subtask, -- parent id is in task.*\n subtask_parent.parent_task_name,\n subtask_parent.parent_assignee_user_id,\n subtask_parent.parent_assignee_name,\n subtask_parent.parent_due_date,\n subtask_parent.parent_created_at\n\n from\n task\n join task_open_length on task.task_id = task_open_length.task_id\n left join task_first_modifier on task.task_id = task_first_modifier.task_id\n\n left join task_comments on task.task_id = task_comments.task_id\n left join task_followers on task.task_id = task_followers.task_id\n left join task_tags on task.task_id = task_tags.task_id\n \n left join task_assignee on task.task_id = task_assignee.task_id\n\n left join subtask_parent on task.task_id = subtask_parent.subtask_id\n\n left join task_projects on task.task_id = task_projects.task_id\n\n)\n\nselect * from task_join", "language": "sql", "package_name": "asana", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/asana", "path": "asana__task.sql", "original_file_path": "models/asana__task.sql", "name": "asana__task", "alias": "asana__task", "checksum": {"name": "sha256", "checksum": "9595b73e29bce0539fc8b3c27eeffdb1ffcba0a3f4f1946b9d36d2a495f59e79"}, "tags": [], "refs": [["stg_asana__task"], ["int_asana__task_comments"], ["int_asana__task_followers"], ["int_asana__task_open_length"], ["int_asana__task_tags"], ["int_asana__task_assignee"], ["int_asana__task_projects"], ["int_asana__subtask_parent"], ["int_asana__task_first_modifier"]], "sources": [], "metrics": [], "description": "An enriched task table consisting of base task info + aggregated metrics and lists", "columns": {"task_id": {"name": "task_id", "description": "System generated unique ID of the task.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "task_name": {"name": "task_name", "description": "User-facing name of the task", "meta": {}, "data_type": null, "quote": null, "tags": []}, "assignee_user_id": {"name": "assignee_user_id", "description": "Foreign key referencing the ASANA_USER that is currently assigned the task.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "assignee_name": {"name": "assignee_name", "description": "Name of the user that the task is currently assigned to.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "assignee_email": {"name": "assignee_email", "description": "Email of the user that the task is currently assigned to.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "is_completed": {"name": "is_completed", "description": "Boolean that is true if the task is currently marked complete.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "completed_at": {"name": "completed_at", "description": "Timestamp of when the task was marked complete.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "completed_by_user_id": {"name": "completed_by_user_id", "description": "Foreign key referencing the USER who completed the task. Note that this may be different than the assignee", "meta": {}, "data_type": null, "quote": null, "tags": []}, "created_at": {"name": "created_at", "description": "Timestamp of when the task was created", "meta": {}, "data_type": null, "quote": null, "tags": []}, "due_date": {"name": "due_date", "description": "Date the task is due, if provided.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "modified_at": {"name": "modified_at", "description": "Timestamp of when the task was last modified", "meta": {}, "data_type": null, "quote": null, "tags": []}, "start_date": {"name": "start_date", "description": "The start date of the task, if a date range is given.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "task_description": {"name": "task_description", "description": "Free-form text describing the task, as seen in the UI.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "task_link": {"name": "task_link", "description": "URL formatted to bring you directly to the task in asana.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "days_open": {"name": "days_open", "description": "The number of days the task has been/was open (creation -> completion)", "meta": {}, "data_type": null, "quote": null, "tags": []}, "is_currently_assigned": {"name": "is_currently_assigned", "description": "Boolean, true if the task is *currently* assigned", "meta": {}, "data_type": null, "quote": null, "tags": []}, "has_been_assigned": {"name": "has_been_assigned", "description": "Boolean, true if the task has at one point been assigned, even if currently not.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "days_since_last_assignment": {"name": "days_since_last_assignment", "description": "The number of days the task has been/was open and assigned to to the most recent user (last assignment -> completion)", "meta": {}, "data_type": null, "quote": null, "tags": []}, "days_since_first_assignment": {"name": "days_since_first_assignment", "description": "The number of days the task has been/was open and assigned at all (first time assigned -> completion)", "meta": {}, "data_type": null, "quote": null, "tags": []}, "last_assigned_at": {"name": "last_assigned_at", "description": "Timestamp of when the task was last assigned (to the current user if still assigned)", "meta": {}, "data_type": null, "quote": null, "tags": []}, "first_assigned_At": {"name": "first_assigned_At", "description": "Timestamp of when the task was first assigned to someone", "meta": {}, "data_type": null, "quote": null, "tags": []}, "first_modifier_user_id": {"name": "first_modifier_user_id", "description": "Foreign key referencing the ASANA_USER who made the first modification to the task (ie added a description). A proxy for task creator.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "first_modifier_name": {"name": "first_modifier_name", "description": "Name of the user who made the first modification to the task", "meta": {}, "data_type": null, "quote": null, "tags": []}, "number_of_comments": {"name": "number_of_comments", "description": "Count of comments made on the task", "meta": {}, "data_type": null, "quote": null, "tags": []}, "conversation": {"name": "conversation", "description": "The task's comments and authors aggregated into an ordered conversation, with authors + time sent", "meta": {}, "data_type": null, "quote": null, "tags": []}, "followers": {"name": "followers", "description": "A list of the names of the users who follow the task.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "number_of_followers": {"name": "number_of_followers", "description": "Count of the users following the task", "meta": {}, "data_type": null, "quote": null, "tags": []}, "tags": {"name": "tags", "description": "A list of the tags associated with the task.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "number_of_tags": {"name": "number_of_tags", "description": "Count of the tags associated with the task.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "projects_sections": {"name": "projects_sections", "description": "A list of the projects + sections that this task is listed under.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "is_subtask": {"name": "is_subtask", "description": "Boolean that's true if the task is a subtask of another.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "parent_task_id": {"name": "parent_task_id", "description": "Self-referential id of the parent TASK that this is a subtask of.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "parent_task_name": {"name": "parent_task_name", "description": "User-facing name of the task's parent task.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "parent_assignee_user_id": {"name": "parent_assignee_user_id", "description": "Foreign key referencing the ASANA_USER who is assigned the parent task", "meta": {}, "data_type": null, "quote": null, "tags": []}, "parent_assignee_name": {"name": "parent_assignee_name", "description": "Name of the user assigned this task's parent task", "meta": {}, "data_type": null, "quote": null, "tags": []}, "parent_due_date": {"name": "parent_due_date", "description": "Date on which the parent task is due, if given", "meta": {}, "data_type": null, "quote": null, "tags": []}, "parent_created_at": {"name": "parent_created_at", "description": "Timestamp of when the parent task was created", "meta": {}, "data_type": null, "quote": null, "tags": []}, "workspace_id": {"name": "workspace_id", "description": "Foreign key reference to the workspace", "meta": {}, "data_type": null, "quote": null, "tags": []}, "is_liked": {"name": "is_liked", "description": "Boolean that is true if the task is liked by the authorized user.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "number_of_likes": {"name": "number_of_likes", "description": "Number of users who have liked this task.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "asana://models/asana.yml", "compiled_path": "target/compiled/asana/models/asana__task.sql", "build_path": null, "deferred": false, "unrendered_config": {"schema": "asana", "materialized": "table"}, "created_at": 1671481804.7578309, "compiled_code": "with __dbt__cte__int_asana__task_story as (\nwith story as (\n \n select * \n from \"postgres\".\"asana_integrations_tests_stg_asana\".\"stg_asana__story\"\n\n),\n\nasana_user as (\n\n select * \n from \"postgres\".\"asana_integrations_tests_stg_asana\".\"stg_asana__user\"\n),\n\nstory_user as (\n select \n story.*,\n asana_user.user_name as created_by_name\n from story\n join asana_user \n on story.created_by_user_id = asana_user.user_id\n),\n\nsplit_comments as (\n\n select\n story_id,\n created_at,\n created_by_user_id,\n created_by_name,\n target_task_id,\n \n case when event_type = 'comment' then story_content \n else null end as comment_content,\n\n case when event_type = 'system' then story_content \n else 'comment' end as action_description\n \n from story_user\n\n),\n\n\n-- the next CTE uses this dictionary to parse the type of action out of the event descfription\n\n\nparse_actions as (\n select\n story_id,\n target_task_id,\n created_at,\n created_by_user_id,\n created_by_name,\n comment_content,\n case \n when action_description like 'added the name%' then 'added name' \n when action_description like 'changed the name%' then 'changed name' \n when action_description like 'removed the name' then 'removed name' \n when action_description like 'added the description%' then 'added description' \n when action_description like 'changed the description%' then 'changed description' \n when action_description like 'removed the description' then 'removed description' \n when action_description like 'added to%' then 'added to project' \n when action_description like 'removed from%' then 'removed from project' \n when action_description like 'assigned%' then 'assigned' \n when action_description like 'unassigned%' then 'unassigned' \n when action_description like 'changed the due date%' then 'changed due date' \n when action_description like 'changed the start date%due date%' then 'changed due date' \n when action_description like 'changed the start date%' then 'changed start date' \n when action_description like 'removed the due date%' then 'removed due date' \n when action_description like 'removed the date range%' then 'removed due date' \n when action_description like 'removed the start date' then 'removed start date' \n when action_description like 'added subtask%' then 'added subtask' \n when action_description like 'added%collaborator%' then 'added collaborator' \n when action_description like 'moved%' then 'moved to section' \n when action_description like 'duplicated task from%' then 'duplicated this from other task' \n when action_description like 'marked%as a duplicate of this' then 'marked other task as duplicate of this' \n when action_description like 'marked this a duplicate of%' then 'marked as duplicate' \n when action_description like 'marked this task complete' then 'completed' \n when action_description like 'completed this task' then 'completed' \n when action_description like 'marked incomplete' then 'marked incomplete' \n when action_description like 'marked this task as a milestone' then 'marked as milestone' \n when action_description like 'unmarked this task as a milestone' then 'unmarked as milestone' \n when action_description like 'marked this milestone complete' then 'completed milestone' \n when action_description like 'completed this milestone' then 'completed milestone' \n when action_description like 'attached%' then 'attachment' \n when action_description like 'liked your comment' then 'liked comment' \n when action_description like 'liked this task' then 'liked task' \n when action_description like 'liked your attachment' then 'liked attachment' \n when action_description like 'liked that you completed this task' then 'liked completion' \n when action_description like 'completed the last task you were waiting on%' then 'completed dependency' \n when action_description like 'added feedback to%' then 'added feedback' \n when action_description like 'changed%to%' then 'changed tag' \n when action_description like 'cleared%' then 'cleared tag' \n when action_description like 'comment' then 'comment' \n when action_description like 'have a task due on%' then ''\n else action_description end as action_taken,\n action_description\n \n from split_comments\n\n),\n\n\nfinal as (\n \n select * \n from parse_actions\n\n -- remove actions you don't care about (set to null in the actions dictionary above)\n where action_taken is not null \n\n)\n\n\nselect * from final\n), __dbt__cte__int_asana__task_comments as (\nwith comments as (\n \n select *\n from __dbt__cte__int_asana__task_story\n where comment_content is not null\n order by target_task_id, created_at asc\n\n),\n\ntask_conversation as (\n\n select\n target_task_id as task_id,\n -- creates a chronologically ordered conversation about the task\n \n string_agg(created_at || ' - ' || created_by_name || ': ' || comment_content, '\\n')\n\n as conversation,\n count(*) as number_of_comments\n\n from comments \n group by 1\n)\n\nselect * from task_conversation\n), __dbt__cte__int_asana__task_followers as (\nwith task_follower as (\n \n select *\n from \"postgres\".\"asana_integrations_tests_stg_asana\".\"stg_asana__task_follower\"\n\n),\n\nasana_user as (\n\n select * \n from \"postgres\".\"asana_integrations_tests_stg_asana\".\"stg_asana__user\"\n\n),\n\nagg_followers as (\n\n select\n task_follower.task_id,\n \n string_agg(asana_user.user_name, ', ')\n\n as followers,\n count(*) as number_of_followers\n from task_follower \n join asana_user \n on asana_user.user_id = task_follower.user_id\n group by 1\n \n)\n\nselect * from agg_followers\n), __dbt__cte__int_asana__task_open_length as (\nwith task as (\n \n select *\n from \"postgres\".\"asana_integrations_tests_stg_asana\".\"stg_asana__task\"\n\n),\n\nstory as (\n\n select * \n from __dbt__cte__int_asana__task_story\n\n),\n\nassignments as (\n \n select \n target_task_id as task_id,\n min(created_at) as first_assigned_at,\n max(created_at) as last_assigned_at -- current assignment\n\n from story\n where action_taken = 'assigned'\n\n group by 1\n\n),\n\n\nopen_assigned_length as (\n\n \n\n select\n task.task_id,\n task.is_completed,\n task.completed_at,\n task.assignee_user_id is not null as is_currently_assigned,\n assignments.task_id is not null as has_been_assigned,\n assignments.last_assigned_at as last_assigned_at,\n assignments.first_assigned_at as first_assigned_at,\n \n ((\n current_timestamp::TIMESTAMP\n)::date - (task.created_at)::date)\n as days_open,\n\n -- if the task is currently assigned, this is the time it has been assigned to this current user.\n \n ((\n current_timestamp::TIMESTAMP\n)::date - (assignments.last_assigned_at)::date)\n as days_since_last_assignment,\n\n \n ((\n current_timestamp::TIMESTAMP\n)::date - (assignments.first_assigned_at)::date)\n as days_since_first_assignment\n \n\n from task\n left join assignments \n on task.task_id = assignments.task_id\n\n)\n\n\nselect * from open_assigned_length\n), __dbt__cte__int_asana__task_tags as (\nwith task_tag as (\n \n select *\n from \"postgres\".\"asana_integrations_tests_stg_asana\".\"stg_asana__task_tag\"\n\n),\n\nasana_tag as (\n\n select * \n from \"postgres\".\"asana_integrations_tests_stg_asana\".\"stg_asana__tag\"\n\n),\n\nagg_tags as (\n\n select\n task_tag.task_id,\n \n string_agg(asana_tag.tag_name, ', ')\n\n as tags,\n count(*) as number_of_tags\n from task_tag \n join asana_tag \n on asana_tag.tag_id = task_tag.tag_id\n group by 1\n \n)\n\nselect * from agg_tags\n), __dbt__cte__int_asana__task_assignee as (\nwith task as (\n\n select * \n from \"postgres\".\"asana_integrations_tests_stg_asana\".\"stg_asana__task\"\n\n),\n\nasana_user as (\n\n select *\n from \"postgres\".\"asana_integrations_tests_stg_asana\".\"stg_asana__user\"\n),\n\ntask_assignee as (\n\n select\n task.*,\n assignee_user_id is not null as has_assignee,\n asana_user.user_name as assignee_name,\n asana_user.email as assignee_email\n\n from task \n left join asana_user \n on task.assignee_user_id = asana_user.user_id\n)\n\nselect * from task_assignee\n), __dbt__cte__int_asana__task_projects as (\nwith task_project as (\n\n select * \n from \"postgres\".\"asana_integrations_tests_stg_asana\".\"stg_asana__project_task\"\n\n),\n\nproject as (\n \n select * \n from \"postgres\".\"asana_integrations_tests_stg_asana\".\"stg_asana__project\"\n),\n\ntask_section as (\n\n select * \n from \"postgres\".\"asana_integrations_tests_stg_asana\".\"stg_asana__task_section\"\n\n),\n\nsection as (\n \n select * \n from \"postgres\".\"asana_integrations_tests_stg_asana\".\"stg_asana__section\"\n\n),\n\ntask_project_section as (\n\n select \n task_project.task_id,\n project.project_name || (case when section.section_name = '(no section)' then ''\n else ': ' || section.section_name end) as project_section, \n project.project_id\n from\n task_project \n join project \n on project.project_id = task_project.project_id\n join task_section\n on task_section.task_id = task_project.task_id\n join section \n on section.section_id = task_section.section_id \n and section.project_id = project.project_id\n),\n\nagg_project_sections as (\n select \n task_id,\n \n string_agg(task_project_section.project_section, ', ')\n\n as projects_sections,\n count(project_id) as number_of_projects\n\n from task_project_section \n\n group by 1\n)\n\nselect * from agg_project_sections\n), __dbt__cte__int_asana__subtask_parent as (\nwith task_assignee as (\n\n select * \n from __dbt__cte__int_asana__task_assignee\n\n),\n\n\nsubtask_parent as (\n\n select\n subtask.task_id as subtask_id,\n parent.task_id as parent_task_id,\n parent.task_name as parent_task_name,\n parent.due_date as parent_due_date,\n parent.created_at as parent_created_at,\n parent.assignee_user_id as parent_assignee_user_id,\n parent.assignee_name as parent_assignee_name\n\n from task_assignee as parent \n join task_assignee as subtask\n on parent.task_id = subtask.parent_task_id\n\n)\n\nselect * from subtask_parent\n), __dbt__cte__int_asana__task_first_modifier as (\nwith story as (\n\n select *\n from __dbt__cte__int_asana__task_story\n where created_by_user_id is not null -- sometimes user id can be null in story. limit to ones with associated users\n),\n\nordered_stories as (\n\n select \n target_task_id,\n created_by_user_id,\n created_by_name,\n created_at,\n row_number() over ( partition by target_task_id order by created_at asc ) as nth_story\n \n from story\n\n),\n\nfirst_modifier as (\n\n select \n target_task_id as task_id,\n created_by_user_id as first_modifier_user_id,\n created_by_name as first_modifier_name\n\n from ordered_stories \n where nth_story = 1\n)\n\nselect *\nfrom first_modifier\n),task as (\n select *\n from \"postgres\".\"asana_integrations_tests_stg_asana\".\"stg_asana__task\"\n),\n\ntask_comments as (\n\n select * \n from __dbt__cte__int_asana__task_comments\n),\n\ntask_followers as (\n\n select *\n from __dbt__cte__int_asana__task_followers\n),\n\ntask_open_length as (\n\n select *\n from __dbt__cte__int_asana__task_open_length\n),\n\ntask_tags as (\n\n select *\n from __dbt__cte__int_asana__task_tags\n),\n\ntask_assignee as (\n\n select * \n from __dbt__cte__int_asana__task_assignee\n where has_assignee\n),\n\ntask_projects as (\n\n select *\n from __dbt__cte__int_asana__task_projects\n),\n\nsubtask_parent as (\n\n select * \n from __dbt__cte__int_asana__subtask_parent\n\n),\n\ntask_first_modifier as (\n \n select *\n from __dbt__cte__int_asana__task_first_modifier\n),\n\ntask_join as (\n\n select\n task.*,\n concat('https://app.asana.com/0/0/', task.task_id) as task_link,\n task_assignee.assignee_name,\n task_assignee.assignee_email,\n \n task_open_length.days_open, \n task_open_length.is_currently_assigned,\n task_open_length.has_been_assigned,\n task_open_length.days_since_last_assignment, -- is null for never-assigned tasks\n task_open_length.days_since_first_assignment, -- is null for never-assigned tasks\n task_open_length.last_assigned_at,\n task_open_length.first_assigned_at, \n\n task_first_modifier.first_modifier_user_id,\n task_first_modifier.first_modifier_name,\n\n task_comments.conversation, \n coalesce(task_comments.number_of_comments, 0) as number_of_comments, \n task_followers.followers,\n coalesce(task_followers.number_of_followers, 0) as number_of_followers,\n task_tags.tags, \n coalesce(task_tags.number_of_tags, 0) as number_of_tags, \n \n task_projects.projects_sections,\n\n subtask_parent.subtask_id is not null as is_subtask, -- parent id is in task.*\n subtask_parent.parent_task_name,\n subtask_parent.parent_assignee_user_id,\n subtask_parent.parent_assignee_name,\n subtask_parent.parent_due_date,\n subtask_parent.parent_created_at\n\n from\n task\n join task_open_length on task.task_id = task_open_length.task_id\n left join task_first_modifier on task.task_id = task_first_modifier.task_id\n\n left join task_comments on task.task_id = task_comments.task_id\n left join task_followers on task.task_id = task_followers.task_id\n left join task_tags on task.task_id = task_tags.task_id\n \n left join task_assignee on task.task_id = task_assignee.task_id\n\n left join subtask_parent on task.task_id = subtask_parent.subtask_id\n\n left join task_projects on task.task_id = task_projects.task_id\n\n)\n\nselect * from task_join", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.asana.int_asana__task_story", "sql": " __dbt__cte__int_asana__task_story as (\nwith story as (\n \n select * \n from \"postgres\".\"asana_integrations_tests_stg_asana\".\"stg_asana__story\"\n\n),\n\nasana_user as (\n\n select * \n from \"postgres\".\"asana_integrations_tests_stg_asana\".\"stg_asana__user\"\n),\n\nstory_user as (\n select \n story.*,\n asana_user.user_name as created_by_name\n from story\n join asana_user \n on story.created_by_user_id = asana_user.user_id\n),\n\nsplit_comments as (\n\n select\n story_id,\n created_at,\n created_by_user_id,\n created_by_name,\n target_task_id,\n \n case when event_type = 'comment' then story_content \n else null end as comment_content,\n\n case when event_type = 'system' then story_content \n else 'comment' end as action_description\n \n from story_user\n\n),\n\n\n-- the next CTE uses this dictionary to parse the type of action out of the event descfription\n\n\nparse_actions as (\n select\n story_id,\n target_task_id,\n created_at,\n created_by_user_id,\n created_by_name,\n comment_content,\n case \n when action_description like 'added the name%' then 'added name' \n when action_description like 'changed the name%' then 'changed name' \n when action_description like 'removed the name' then 'removed name' \n when action_description like 'added the description%' then 'added description' \n when action_description like 'changed the description%' then 'changed description' \n when action_description like 'removed the description' then 'removed description' \n when action_description like 'added to%' then 'added to project' \n when action_description like 'removed from%' then 'removed from project' \n when action_description like 'assigned%' then 'assigned' \n when action_description like 'unassigned%' then 'unassigned' \n when action_description like 'changed the due date%' then 'changed due date' \n when action_description like 'changed the start date%due date%' then 'changed due date' \n when action_description like 'changed the start date%' then 'changed start date' \n when action_description like 'removed the due date%' then 'removed due date' \n when action_description like 'removed the date range%' then 'removed due date' \n when action_description like 'removed the start date' then 'removed start date' \n when action_description like 'added subtask%' then 'added subtask' \n when action_description like 'added%collaborator%' then 'added collaborator' \n when action_description like 'moved%' then 'moved to section' \n when action_description like 'duplicated task from%' then 'duplicated this from other task' \n when action_description like 'marked%as a duplicate of this' then 'marked other task as duplicate of this' \n when action_description like 'marked this a duplicate of%' then 'marked as duplicate' \n when action_description like 'marked this task complete' then 'completed' \n when action_description like 'completed this task' then 'completed' \n when action_description like 'marked incomplete' then 'marked incomplete' \n when action_description like 'marked this task as a milestone' then 'marked as milestone' \n when action_description like 'unmarked this task as a milestone' then 'unmarked as milestone' \n when action_description like 'marked this milestone complete' then 'completed milestone' \n when action_description like 'completed this milestone' then 'completed milestone' \n when action_description like 'attached%' then 'attachment' \n when action_description like 'liked your comment' then 'liked comment' \n when action_description like 'liked this task' then 'liked task' \n when action_description like 'liked your attachment' then 'liked attachment' \n when action_description like 'liked that you completed this task' then 'liked completion' \n when action_description like 'completed the last task you were waiting on%' then 'completed dependency' \n when action_description like 'added feedback to%' then 'added feedback' \n when action_description like 'changed%to%' then 'changed tag' \n when action_description like 'cleared%' then 'cleared tag' \n when action_description like 'comment' then 'comment' \n when action_description like 'have a task due on%' then ''\n else action_description end as action_taken,\n action_description\n \n from split_comments\n\n),\n\n\nfinal as (\n \n select * \n from parse_actions\n\n -- remove actions you don't care about (set to null in the actions dictionary above)\n where action_taken is not null \n\n)\n\n\nselect * from final\n)"}, {"id": "model.asana.int_asana__task_comments", "sql": " __dbt__cte__int_asana__task_comments as (\nwith comments as (\n \n select *\n from __dbt__cte__int_asana__task_story\n where comment_content is not null\n order by target_task_id, created_at asc\n\n),\n\ntask_conversation as (\n\n select\n target_task_id as task_id,\n -- creates a chronologically ordered conversation about the task\n \n string_agg(created_at || ' - ' || created_by_name || ': ' || comment_content, '\\n')\n\n as conversation,\n count(*) as number_of_comments\n\n from comments \n group by 1\n)\n\nselect * from task_conversation\n)"}, {"id": "model.asana.int_asana__task_followers", "sql": " __dbt__cte__int_asana__task_followers as (\nwith task_follower as (\n \n select *\n from \"postgres\".\"asana_integrations_tests_stg_asana\".\"stg_asana__task_follower\"\n\n),\n\nasana_user as (\n\n select * \n from \"postgres\".\"asana_integrations_tests_stg_asana\".\"stg_asana__user\"\n\n),\n\nagg_followers as (\n\n select\n task_follower.task_id,\n \n string_agg(asana_user.user_name, ', ')\n\n as followers,\n count(*) as number_of_followers\n from task_follower \n join asana_user \n on asana_user.user_id = task_follower.user_id\n group by 1\n \n)\n\nselect * from agg_followers\n)"}, {"id": "model.asana.int_asana__task_open_length", "sql": " __dbt__cte__int_asana__task_open_length as (\nwith task as (\n \n select *\n from \"postgres\".\"asana_integrations_tests_stg_asana\".\"stg_asana__task\"\n\n),\n\nstory as (\n\n select * \n from __dbt__cte__int_asana__task_story\n\n),\n\nassignments as (\n \n select \n target_task_id as task_id,\n min(created_at) as first_assigned_at,\n max(created_at) as last_assigned_at -- current assignment\n\n from story\n where action_taken = 'assigned'\n\n group by 1\n\n),\n\n\nopen_assigned_length as (\n\n \n\n select\n task.task_id,\n task.is_completed,\n task.completed_at,\n task.assignee_user_id is not null as is_currently_assigned,\n assignments.task_id is not null as has_been_assigned,\n assignments.last_assigned_at as last_assigned_at,\n assignments.first_assigned_at as first_assigned_at,\n \n ((\n current_timestamp::TIMESTAMP\n)::date - (task.created_at)::date)\n as days_open,\n\n -- if the task is currently assigned, this is the time it has been assigned to this current user.\n \n ((\n current_timestamp::TIMESTAMP\n)::date - (assignments.last_assigned_at)::date)\n as days_since_last_assignment,\n\n \n ((\n current_timestamp::TIMESTAMP\n)::date - (assignments.first_assigned_at)::date)\n as days_since_first_assignment\n \n\n from task\n left join assignments \n on task.task_id = assignments.task_id\n\n)\n\n\nselect * from open_assigned_length\n)"}, {"id": "model.asana.int_asana__task_tags", "sql": " __dbt__cte__int_asana__task_tags as (\nwith task_tag as (\n \n select *\n from \"postgres\".\"asana_integrations_tests_stg_asana\".\"stg_asana__task_tag\"\n\n),\n\nasana_tag as (\n\n select * \n from \"postgres\".\"asana_integrations_tests_stg_asana\".\"stg_asana__tag\"\n\n),\n\nagg_tags as (\n\n select\n task_tag.task_id,\n \n string_agg(asana_tag.tag_name, ', ')\n\n as tags,\n count(*) as number_of_tags\n from task_tag \n join asana_tag \n on asana_tag.tag_id = task_tag.tag_id\n group by 1\n \n)\n\nselect * from agg_tags\n)"}, {"id": "model.asana.int_asana__task_assignee", "sql": " __dbt__cte__int_asana__task_assignee as (\nwith task as (\n\n select * \n from \"postgres\".\"asana_integrations_tests_stg_asana\".\"stg_asana__task\"\n\n),\n\nasana_user as (\n\n select *\n from \"postgres\".\"asana_integrations_tests_stg_asana\".\"stg_asana__user\"\n),\n\ntask_assignee as (\n\n select\n task.*,\n assignee_user_id is not null as has_assignee,\n asana_user.user_name as assignee_name,\n asana_user.email as assignee_email\n\n from task \n left join asana_user \n on task.assignee_user_id = asana_user.user_id\n)\n\nselect * from task_assignee\n)"}, {"id": "model.asana.int_asana__task_projects", "sql": " __dbt__cte__int_asana__task_projects as (\nwith task_project as (\n\n select * \n from \"postgres\".\"asana_integrations_tests_stg_asana\".\"stg_asana__project_task\"\n\n),\n\nproject as (\n \n select * \n from \"postgres\".\"asana_integrations_tests_stg_asana\".\"stg_asana__project\"\n),\n\ntask_section as (\n\n select * \n from \"postgres\".\"asana_integrations_tests_stg_asana\".\"stg_asana__task_section\"\n\n),\n\nsection as (\n \n select * \n from \"postgres\".\"asana_integrations_tests_stg_asana\".\"stg_asana__section\"\n\n),\n\ntask_project_section as (\n\n select \n task_project.task_id,\n project.project_name || (case when section.section_name = '(no section)' then ''\n else ': ' || section.section_name end) as project_section, \n project.project_id\n from\n task_project \n join project \n on project.project_id = task_project.project_id\n join task_section\n on task_section.task_id = task_project.task_id\n join section \n on section.section_id = task_section.section_id \n and section.project_id = project.project_id\n),\n\nagg_project_sections as (\n select \n task_id,\n \n string_agg(task_project_section.project_section, ', ')\n\n as projects_sections,\n count(project_id) as number_of_projects\n\n from task_project_section \n\n group by 1\n)\n\nselect * from agg_project_sections\n)"}, {"id": "model.asana.int_asana__subtask_parent", "sql": " __dbt__cte__int_asana__subtask_parent as (\nwith task_assignee as (\n\n select * \n from __dbt__cte__int_asana__task_assignee\n\n),\n\n\nsubtask_parent as (\n\n select\n subtask.task_id as subtask_id,\n parent.task_id as parent_task_id,\n parent.task_name as parent_task_name,\n parent.due_date as parent_due_date,\n parent.created_at as parent_created_at,\n parent.assignee_user_id as parent_assignee_user_id,\n parent.assignee_name as parent_assignee_name\n\n from task_assignee as parent \n join task_assignee as subtask\n on parent.task_id = subtask.parent_task_id\n\n)\n\nselect * from subtask_parent\n)"}, {"id": "model.asana.int_asana__task_first_modifier", "sql": " __dbt__cte__int_asana__task_first_modifier as (\nwith story as (\n\n select *\n from __dbt__cte__int_asana__task_story\n where created_by_user_id is not null -- sometimes user id can be null in story. limit to ones with associated users\n),\n\nordered_stories as (\n\n select \n target_task_id,\n created_by_user_id,\n created_by_name,\n created_at,\n row_number() over ( partition by target_task_id order by created_at asc ) as nth_story\n \n from story\n\n),\n\nfirst_modifier as (\n\n select \n target_task_id as task_id,\n created_by_user_id as first_modifier_user_id,\n created_by_name as first_modifier_name\n\n from ordered_stories \n where nth_story = 1\n)\n\nselect *\nfrom first_modifier\n)"}], "relation_name": "\"postgres\".\"asana_integrations_tests_asana\".\"asana__task\""}, "model.asana.asana__team": {"compiled": true, "resource_type": "model", "depends_on": {"macros": ["macro.fivetran_utils.string_agg"], "nodes": ["model.asana_source.stg_asana__team", "model.asana.asana__project"]}, "config": {"enabled": true, "alias": null, "schema": "asana", "database": null, "tags": [], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "post-hook": [], "pre-hook": []}, "database": "postgres", "schema": "asana_integrations_tests_asana", "fqn": ["asana", "asana__team"], "unique_id": "model.asana.asana__team", "raw_code": "with team as (\n\n select * from {{ var('team') }}\n),\n\nproject as (\n\n select * \n from {{ ref('asana__project') }}\n),\n\nteam_join as (\n\n select\n team.team_id,\n team.team_name,\n\n coalesce( sum(project.number_of_open_tasks), 0) as number_of_open_tasks, -- will double-count tasks in multiple projects\n coalesce( sum( project.number_of_assigned_open_tasks), 0) as number_of_assigned_open_tasks,\n coalesce( sum(project.number_of_tasks_completed), 0) as number_of_tasks_completed,\n round(avg(project.avg_close_time_days), 0) as avg_close_time_days, -- avg of project's avg\n round(avg(project.avg_close_time_assigned_days), 0) as avg_close_time_assigned_days,\n\n coalesce( sum(case when not project.is_archived then 1 else 0 end), 0) as number_of_active_projects,\n {{ fivetran_utils.string_agg('case when not project.is_archived then project.project_name else null end', \"', '\") }} as active_projects,\n coalesce( sum(case when project.is_archived then 1 else 0 end), 0) as number_of_archived_projects\n\n \n\n from team \n left join project on project.team_id = team.team_id\n\n group by 1,2\n\n)\n\nselect * from team_join", "language": "sql", "package_name": "asana", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/asana", "path": "asana__team.sql", "original_file_path": "models/asana__team.sql", "name": "asana__team", "alias": "asana__team", "checksum": {"name": "sha256", "checksum": "848787a32e0c75060c960f1d73bd6c6652da47bfeafb7e6e74949ec183a5da63"}, "tags": [], "refs": [["stg_asana__team"], ["asana__project"]], "sources": [], "metrics": [], "description": "Enriched team table consisting of basic team info + task/completion metrics (note that teams can only act on tasks in projects)", "columns": {"team_id": {"name": "team_id", "description": "System generate unique ID for the team", "meta": {}, "data_type": null, "quote": null, "tags": []}, "team_name": {"name": "team_name", "description": "UI-facing name of the team.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "number_of_open_tasks": {"name": "number_of_open_tasks", "description": "Count of the currently open tasks for this team.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "number_of_assigned_open_tasks": {"name": "number_of_assigned_open_tasks", "description": "Count of the open and assigned tasks for the team.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "number_of_tasks_completed": {"name": "number_of_tasks_completed", "description": "Count of tasks that this team has completed.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "avg_close_time_days": {"name": "avg_close_time_days", "description": "The avg number of days it has taken projects of this team to close tasks.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "avg_close_time_assigned_days": {"name": "avg_close_time_assigned_days", "description": "The avg number of days it has taken projects of this team to close tasks, once assigned", "meta": {}, "data_type": null, "quote": null, "tags": []}, "active_projects": {"name": "active_projects", "description": "Aggregated list of non archived projects associated with the team", "meta": {}, "data_type": null, "quote": null, "tags": []}, "number_of_active_projects": {"name": "number_of_active_projects", "description": "Count of non-archived projects", "meta": {}, "data_type": null, "quote": null, "tags": []}, "number_of_archived_projects": {"name": "number_of_archived_projects", "description": "Count of archived projects", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "asana://models/asana.yml", "compiled_path": "target/compiled/asana/models/asana__team.sql", "build_path": null, "deferred": false, "unrendered_config": {"schema": "asana", "materialized": "table"}, "created_at": 1671481804.7642932, "compiled_code": "with team as (\n\n select * from \"postgres\".\"asana_integrations_tests_stg_asana\".\"stg_asana__team\"\n),\n\nproject as (\n\n select * \n from \"postgres\".\"asana_integrations_tests_asana\".\"asana__project\"\n),\n\nteam_join as (\n\n select\n team.team_id,\n team.team_name,\n\n coalesce( sum(project.number_of_open_tasks), 0) as number_of_open_tasks, -- will double-count tasks in multiple projects\n coalesce( sum( project.number_of_assigned_open_tasks), 0) as number_of_assigned_open_tasks,\n coalesce( sum(project.number_of_tasks_completed), 0) as number_of_tasks_completed,\n round(avg(project.avg_close_time_days), 0) as avg_close_time_days, -- avg of project's avg\n round(avg(project.avg_close_time_assigned_days), 0) as avg_close_time_assigned_days,\n\n coalesce( sum(case when not project.is_archived then 1 else 0 end), 0) as number_of_active_projects,\n \n string_agg(case when not project.is_archived then project.project_name else null end, ', ')\n\n as active_projects,\n coalesce( sum(case when project.is_archived then 1 else 0 end), 0) as number_of_archived_projects\n\n \n\n from team \n left join project on project.team_id = team.team_id\n\n group by 1,2\n\n)\n\nselect * from team_join", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "\"postgres\".\"asana_integrations_tests_asana\".\"asana__team\""}, "model.asana.asana__project": {"compiled": true, "resource_type": "model", "depends_on": {"macros": ["macro.fivetran_utils.string_agg"], "nodes": ["model.asana.int_asana__project_task_metrics", "model.asana_source.stg_asana__project", "model.asana.int_asana__project_user", "model.asana_source.stg_asana__user", "model.asana_source.stg_asana__team", "model.asana_source.stg_asana__section"]}, "config": {"enabled": true, "alias": null, "schema": "asana", "database": null, "tags": [], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "post-hook": [], "pre-hook": []}, "database": "postgres", "schema": "asana_integrations_tests_asana", "fqn": ["asana", "asana__project"], "unique_id": "model.asana.asana__project", "raw_code": "with project_task_metrics as (\n\n select *\n from {{ ref('int_asana__project_task_metrics') }}\n),\n\nproject as (\n \n select *\n from {{ var('project') }}\n),\n\nproject_user as (\n \n select *\n from {{ ref('int_asana__project_user') }}\n),\n\nasana_user as (\n select *\n from {{ var('user') }}\n),\n\nteam as (\n select *\n from {{ var('team') }}\n),\n\nagg_sections as (\n\n select\n project_id,\n {{ fivetran_utils.string_agg( 'section_name', \"', '\") }} as sections\n\n from {{ var('section') }}\n where section_name != '(no section)'\n group by 1\n),\n\nagg_project_users as (\n\n select \n project_user.project_id,\n {{ fivetran_utils.string_agg( \"asana_user.user_name || ' as ' || project_user.role\" , \"', '\" ) }} as users\n\n from project_user join asana_user using(user_id)\n\n group by 1\n\n),\n\n-- need to split from above due to redshift's inability to string/list_agg and use distinct aggregates\ncount_project_users as (\n \n select \n project_id, \n count(distinct user_id) as number_of_users_involved\n\n from project_user\n group by 1\n\n),\n\nproject_join as (\n\n select\n project.project_id,\n project_name,\n\n coalesce(project_task_metrics.number_of_open_tasks, 0) as number_of_open_tasks,\n coalesce(project_task_metrics.number_of_assigned_open_tasks, 0) as number_of_assigned_open_tasks,\n coalesce(project_task_metrics.number_of_tasks_completed, 0) as number_of_tasks_completed,\n round(project_task_metrics.avg_close_time_days, 0) as avg_close_time_days,\n round(project_task_metrics.avg_close_time_assigned_days, 0) as avg_close_time_assigned_days,\n\n 'https://app.asana.com/0/' || project.project_id ||'/' || project.project_id as project_link,\n\n project.team_id,\n team.team_name,\n project.is_archived,\n created_at,\n current_status,\n due_date,\n modified_at as last_modified_at,\n owner_user_id,\n agg_project_users.users as users_involved,\n coalesce(count_project_users.number_of_users_involved, 0) as number_of_users_involved,\n agg_sections.sections,\n project.notes,\n project.is_public\n\n from\n project \n left join project_task_metrics on project.project_id = project_task_metrics.project_id \n left join agg_project_users on project.project_id = agg_project_users.project_id \n left join count_project_users on project.project_id = count_project_users.project_id\n join team on team.team_id = project.team_id -- every project needs a team\n left join agg_sections on project.project_id = agg_sections.project_id\n\n)\n\nselect * from project_join", "language": "sql", "package_name": "asana", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/asana", "path": "asana__project.sql", "original_file_path": "models/asana__project.sql", "name": "asana__project", "alias": "asana__project", "checksum": {"name": "sha256", "checksum": "91f218d2cb1e3f59adce898263d14060794892986bce92fda2825d39ed99e170"}, "tags": [], "refs": [["int_asana__project_task_metrics"], ["stg_asana__project"], ["int_asana__project_user"], ["stg_asana__user"], ["stg_asana__team"], ["stg_asana__section"]], "sources": [], "metrics": [], "description": "Table of projects' basic info enriched with metrics regarding tasks and completions", "columns": {"project_id": {"name": "project_id", "description": "System-generated unique ID of the project.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "project_name": {"name": "project_name", "description": "UI-facing name of the project", "meta": {}, "data_type": null, "quote": null, "tags": []}, "number_of_open_tasks": {"name": "number_of_open_tasks", "description": "Count of the currently open tasks in this project", "meta": {}, "data_type": null, "quote": null, "tags": []}, "number_of_assigned_open_tasks": {"name": "number_of_assigned_open_tasks", "description": "Count of the open and assigned tasks in this project.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "number_of_tasks_completed": {"name": "number_of_tasks_completed", "description": "Count of tasks that have been completed in this project", "meta": {}, "data_type": null, "quote": null, "tags": []}, "avg_close_time_days": {"name": "avg_close_time_days", "description": "The avg number of days it has taken to close tasks in this project", "meta": {}, "data_type": null, "quote": null, "tags": []}, "avg_close_time_assigned_days": {"name": "avg_close_time_assigned_days", "description": "The avg number of days it has taken to close tasks, since their *last* assignment, in this project", "meta": {}, "data_type": null, "quote": null, "tags": []}, "team_id": {"name": "team_id", "description": "Foreign key referencing the ASANA_TEAM that the project is associated with", "meta": {}, "data_type": null, "quote": null, "tags": []}, "team_name": {"name": "team_name", "description": "User-facing name of the project's team", "meta": {}, "data_type": null, "quote": null, "tags": []}, "is_archived": {"name": "is_archived", "description": "Boolean representing if the project has been archived in the UI", "meta": {}, "data_type": null, "quote": null, "tags": []}, "project_link": {"name": "project_link", "description": "URL formatted to bring you directly to the project in asana.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "created_at": {"name": "created_at", "description": "Timestamp of when the project was created", "meta": {}, "data_type": null, "quote": null, "tags": []}, "current_status": {"name": "current_status", "description": "The most recent progress status update for the project (free-form string)", "meta": {}, "data_type": null, "quote": null, "tags": []}, "due_date": {"name": "due_date", "description": "The date the project is due on, if given", "meta": {}, "data_type": null, "quote": null, "tags": []}, "last_modified_at": {"name": "last_modified_at", "description": "Timestamp of when the project was last modified (doesn't include comments or tasks)", "meta": {}, "data_type": null, "quote": null, "tags": []}, "owner_user_id": {"name": "owner_user_id", "description": "Foreign key referencing the USER who owns the project.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "users_involved": {"name": "users_involved", "description": "Aggregated list of the names + roles of the users involved (working on or owning) a project", "meta": {}, "data_type": null, "quote": null, "tags": []}, "number_of_users_involved": {"name": "number_of_users_involved", "description": "Count of the unique users associated with the project", "meta": {}, "data_type": null, "quote": null, "tags": []}, "is_public": {"name": "is_public", "description": "Boolean that's true if public to the whole workspace, false if private.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "sections": {"name": "sections", "description": "Aggregated list of the sections that exist in the project.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "notes": {"name": "notes", "description": "Free-form textual description associated with project", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "asana://models/asana.yml", "compiled_path": "target/compiled/asana/models/asana__project.sql", "build_path": null, "deferred": false, "unrendered_config": {"schema": "asana", "materialized": "table"}, "created_at": 1671481804.762663, "compiled_code": "with __dbt__cte__int_asana__project_task_metrics as (\nwith task as (\n\n select *\n from \"postgres\".\"asana_integrations_tests_asana\".\"asana__task\"\n\n),\n\nproject as (\n\n select * \n from \"postgres\".\"asana_integrations_tests_stg_asana\".\"stg_asana__project\"\n\n),\n\nproject_task as (\n\n select * \n from \"postgres\".\"asana_integrations_tests_stg_asana\".\"stg_asana__project_task\"\n),\n\nproject_task_history as (\n\n select\n project.project_id,\n task.task_id,\n task.is_completed as task_is_completed,\n task.assignee_user_id as task_assignee_user_id,\n task.days_open as task_days_open,\n task.days_since_last_assignment as task_days_assigned_current_user\n\n from project\n left join project_task \n on project.project_id = project_task.project_id\n left join task \n on project_task.task_id = task.task_id\n\n),\n\nagg_proj_tasks as (\n\n select \n project_id,\n sum(case when not task_is_completed then 1 else 0 end) as number_of_open_tasks,\n sum(case when not task_is_completed and task_assignee_user_id is not null then 1 else 0 end) as number_of_assigned_open_tasks,\n sum(case when task_is_completed then 1 else 0 end) as number_of_tasks_completed,\n sum(case when task_is_completed and task_assignee_user_id is not null then 1 else 0 end) as number_of_assigned_tasks_completed,\n sum(case when task_is_completed then task_days_open else 0 end) as total_days_open,\n sum(case when task_is_completed then task_days_assigned_current_user else 0 end) as total_days_assigned_last_user -- will divde later for avg\n\n from project_task_history\n\n group by 1\n\n),\n\nfinal as (\n\n select\n agg_proj_tasks.*,\n round(nullif(total_days_open, 0) * 1.0 / nullif(number_of_tasks_completed, 0), 0) as avg_close_time_days,\n round(nullif(total_days_assigned_last_user, 0) * 1.0 / nullif(number_of_assigned_tasks_completed, 0), 0) as avg_close_time_assigned_days\n\n from agg_proj_tasks\n \n)\n\nselect * from final\n), __dbt__cte__int_asana__task_assignee as (\nwith task as (\n\n select * \n from \"postgres\".\"asana_integrations_tests_stg_asana\".\"stg_asana__task\"\n\n),\n\nasana_user as (\n\n select *\n from \"postgres\".\"asana_integrations_tests_stg_asana\".\"stg_asana__user\"\n),\n\ntask_assignee as (\n\n select\n task.*,\n assignee_user_id is not null as has_assignee,\n asana_user.user_name as assignee_name,\n asana_user.email as assignee_email\n\n from task \n left join asana_user \n on task.assignee_user_id = asana_user.user_id\n)\n\nselect * from task_assignee\n), __dbt__cte__int_asana__project_user as (\nwith project_tasks as (\n \n select *\n from \"postgres\".\"asana_integrations_tests_stg_asana\".\"stg_asana__project_task\"\n),\n\nassigned_tasks as (\n \n select * \n from __dbt__cte__int_asana__task_assignee\n where has_assignee\n \n),\n\nproject as (\n \n select *\n from \"postgres\".\"asana_integrations_tests_stg_asana\".\"stg_asana__project\"\n\n where not is_archived\n\n),\n\nproject_assignee as (\n\n select\n project_tasks.project_id,\n project_tasks.task_id,\n assigned_tasks.assignee_user_id,\n assigned_tasks.assignee_name,\n not assigned_tasks.is_completed as currently_working_on\n\n from project_tasks \n join assigned_tasks \n on assigned_tasks.task_id = project_tasks.task_id\n\n),\n\nproject_owner as (\n\n select \n project_id,\n project_name,\n owner_user_id\n\n from project\n \n where owner_user_id is not null\n),\n\nproject_user as (\n \n select\n project_id,\n project_name,\n owner_user_id as user_id,\n 'owner' as role,\n null as currently_working_on\n \n from project_owner\n\n union all\n\n select\n project.project_id,\n project.project_name,\n project_assignee.assignee_user_id as user_id,\n 'task assignee' as role,\n project_assignee.currently_working_on\n \n from project \n \n join project_assignee \n on project.project_id = project_assignee.project_id\n group by 1,2,3,4,5\n\n)\n\n\nselect * from project_user\n),project_task_metrics as (\n\n select *\n from __dbt__cte__int_asana__project_task_metrics\n),\n\nproject as (\n \n select *\n from \"postgres\".\"asana_integrations_tests_stg_asana\".\"stg_asana__project\"\n),\n\nproject_user as (\n \n select *\n from __dbt__cte__int_asana__project_user\n),\n\nasana_user as (\n select *\n from \"postgres\".\"asana_integrations_tests_stg_asana\".\"stg_asana__user\"\n),\n\nteam as (\n select *\n from \"postgres\".\"asana_integrations_tests_stg_asana\".\"stg_asana__team\"\n),\n\nagg_sections as (\n\n select\n project_id,\n \n string_agg(section_name, ', ')\n\n as sections\n\n from \"postgres\".\"asana_integrations_tests_stg_asana\".\"stg_asana__section\"\n where section_name != '(no section)'\n group by 1\n),\n\nagg_project_users as (\n\n select \n project_user.project_id,\n \n string_agg(asana_user.user_name || ' as ' || project_user.role, ', ')\n\n as users\n\n from project_user join asana_user using(user_id)\n\n group by 1\n\n),\n\n-- need to split from above due to redshift's inability to string/list_agg and use distinct aggregates\ncount_project_users as (\n \n select \n project_id, \n count(distinct user_id) as number_of_users_involved\n\n from project_user\n group by 1\n\n),\n\nproject_join as (\n\n select\n project.project_id,\n project_name,\n\n coalesce(project_task_metrics.number_of_open_tasks, 0) as number_of_open_tasks,\n coalesce(project_task_metrics.number_of_assigned_open_tasks, 0) as number_of_assigned_open_tasks,\n coalesce(project_task_metrics.number_of_tasks_completed, 0) as number_of_tasks_completed,\n round(project_task_metrics.avg_close_time_days, 0) as avg_close_time_days,\n round(project_task_metrics.avg_close_time_assigned_days, 0) as avg_close_time_assigned_days,\n\n 'https://app.asana.com/0/' || project.project_id ||'/' || project.project_id as project_link,\n\n project.team_id,\n team.team_name,\n project.is_archived,\n created_at,\n current_status,\n due_date,\n modified_at as last_modified_at,\n owner_user_id,\n agg_project_users.users as users_involved,\n coalesce(count_project_users.number_of_users_involved, 0) as number_of_users_involved,\n agg_sections.sections,\n project.notes,\n project.is_public\n\n from\n project \n left join project_task_metrics on project.project_id = project_task_metrics.project_id \n left join agg_project_users on project.project_id = agg_project_users.project_id \n left join count_project_users on project.project_id = count_project_users.project_id\n join team on team.team_id = project.team_id -- every project needs a team\n left join agg_sections on project.project_id = agg_sections.project_id\n\n)\n\nselect * from project_join", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.asana.int_asana__project_task_metrics", "sql": " __dbt__cte__int_asana__project_task_metrics as (\nwith task as (\n\n select *\n from \"postgres\".\"asana_integrations_tests_asana\".\"asana__task\"\n\n),\n\nproject as (\n\n select * \n from \"postgres\".\"asana_integrations_tests_stg_asana\".\"stg_asana__project\"\n\n),\n\nproject_task as (\n\n select * \n from \"postgres\".\"asana_integrations_tests_stg_asana\".\"stg_asana__project_task\"\n),\n\nproject_task_history as (\n\n select\n project.project_id,\n task.task_id,\n task.is_completed as task_is_completed,\n task.assignee_user_id as task_assignee_user_id,\n task.days_open as task_days_open,\n task.days_since_last_assignment as task_days_assigned_current_user\n\n from project\n left join project_task \n on project.project_id = project_task.project_id\n left join task \n on project_task.task_id = task.task_id\n\n),\n\nagg_proj_tasks as (\n\n select \n project_id,\n sum(case when not task_is_completed then 1 else 0 end) as number_of_open_tasks,\n sum(case when not task_is_completed and task_assignee_user_id is not null then 1 else 0 end) as number_of_assigned_open_tasks,\n sum(case when task_is_completed then 1 else 0 end) as number_of_tasks_completed,\n sum(case when task_is_completed and task_assignee_user_id is not null then 1 else 0 end) as number_of_assigned_tasks_completed,\n sum(case when task_is_completed then task_days_open else 0 end) as total_days_open,\n sum(case when task_is_completed then task_days_assigned_current_user else 0 end) as total_days_assigned_last_user -- will divde later for avg\n\n from project_task_history\n\n group by 1\n\n),\n\nfinal as (\n\n select\n agg_proj_tasks.*,\n round(nullif(total_days_open, 0) * 1.0 / nullif(number_of_tasks_completed, 0), 0) as avg_close_time_days,\n round(nullif(total_days_assigned_last_user, 0) * 1.0 / nullif(number_of_assigned_tasks_completed, 0), 0) as avg_close_time_assigned_days\n\n from agg_proj_tasks\n \n)\n\nselect * from final\n)"}, {"id": "model.asana.int_asana__task_assignee", "sql": " __dbt__cte__int_asana__task_assignee as (\nwith task as (\n\n select * \n from \"postgres\".\"asana_integrations_tests_stg_asana\".\"stg_asana__task\"\n\n),\n\nasana_user as (\n\n select *\n from \"postgres\".\"asana_integrations_tests_stg_asana\".\"stg_asana__user\"\n),\n\ntask_assignee as (\n\n select\n task.*,\n assignee_user_id is not null as has_assignee,\n asana_user.user_name as assignee_name,\n asana_user.email as assignee_email\n\n from task \n left join asana_user \n on task.assignee_user_id = asana_user.user_id\n)\n\nselect * from task_assignee\n)"}, {"id": "model.asana.int_asana__project_user", "sql": " __dbt__cte__int_asana__project_user as (\nwith project_tasks as (\n \n select *\n from \"postgres\".\"asana_integrations_tests_stg_asana\".\"stg_asana__project_task\"\n),\n\nassigned_tasks as (\n \n select * \n from __dbt__cte__int_asana__task_assignee\n where has_assignee\n \n),\n\nproject as (\n \n select *\n from \"postgres\".\"asana_integrations_tests_stg_asana\".\"stg_asana__project\"\n\n where not is_archived\n\n),\n\nproject_assignee as (\n\n select\n project_tasks.project_id,\n project_tasks.task_id,\n assigned_tasks.assignee_user_id,\n assigned_tasks.assignee_name,\n not assigned_tasks.is_completed as currently_working_on\n\n from project_tasks \n join assigned_tasks \n on assigned_tasks.task_id = project_tasks.task_id\n\n),\n\nproject_owner as (\n\n select \n project_id,\n project_name,\n owner_user_id\n\n from project\n \n where owner_user_id is not null\n),\n\nproject_user as (\n \n select\n project_id,\n project_name,\n owner_user_id as user_id,\n 'owner' as role,\n null as currently_working_on\n \n from project_owner\n\n union all\n\n select\n project.project_id,\n project.project_name,\n project_assignee.assignee_user_id as user_id,\n 'task assignee' as role,\n project_assignee.currently_working_on\n \n from project \n \n join project_assignee \n on project.project_id = project_assignee.project_id\n group by 1,2,3,4,5\n\n)\n\n\nselect * from project_user\n)"}], "relation_name": "\"postgres\".\"asana_integrations_tests_asana\".\"asana__project\""}, "model.asana.asana__tag": {"compiled": true, "resource_type": "model", "depends_on": {"macros": [], "nodes": ["model.asana_source.stg_asana__tag", "model.asana_source.stg_asana__task_tag", "model.asana.asana__task"]}, "config": {"enabled": true, "alias": null, "schema": "asana", "database": null, "tags": [], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "post-hook": [], "pre-hook": []}, "database": "postgres", "schema": "asana_integrations_tests_asana", "fqn": ["asana", "asana__tag"], "unique_id": "model.asana.asana__tag", "raw_code": "with asana_tag as (\n\n select * \n from {{ var('tag') }}\n),\n\ntask_tag as (\n\n select * \n from {{ var('task_tag') }}\n),\n\ntask as (\n\n select *\n from {{ ref('asana__task') }}\n\n where is_completed and tags is not null\n\n),\n\nagg_tag as (\n\n select\n asana_tag.tag_id,\n asana_tag.tag_name,\n asana_tag.created_at,\n sum(case when not task.is_completed then 1 else 0 end) as number_of_open_tasks,\n sum(case when not task.is_completed and task.assignee_user_id is not null then 1 else 0 end) as number_of_assigned_open_tasks,\n sum(case when task.is_completed then 1 else 0 end) as number_of_tasks_completed,\n round(avg(case when task.is_completed then task.days_open else null end), 0) as avg_days_open,\n round(avg(case when task.is_completed then task.days_since_last_assignment else null end), 0) as avg_days_assigned\n\n\n from asana_tag \n left join task_tag on asana_tag.tag_id = task_tag.tag_id\n left join task on task.task_id = task_tag.task_id\n\n group by 1,2,3\n)\n\nselect * from agg_tag", "language": "sql", "package_name": "asana", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/asana", "path": "asana__tag.sql", "original_file_path": "models/asana__tag.sql", "name": "asana__tag", "alias": "asana__tag", "checksum": {"name": "sha256", "checksum": "e8783d268c5d3f46a7e11e597a0090254f15aa92b89122dcf6ee2481e77eb433"}, "tags": [], "refs": [["stg_asana__tag"], ["stg_asana__task_tag"], ["asana__task"]], "sources": [], "metrics": [], "description": "Table of tag basic info enriched with some task metrics.", "columns": {"tag_id": {"name": "tag_id", "description": "System-generated unique ID for the tag", "meta": {}, "data_type": null, "quote": null, "tags": []}, "tag_name": {"name": "tag_name", "description": "UI-facing name of the tag", "meta": {}, "data_type": null, "quote": null, "tags": []}, "created_at": {"name": "created_at", "description": "Timestamp of when the tag was created", "meta": {}, "data_type": null, "quote": null, "tags": []}, "number_of_open_tasks": {"name": "number_of_open_tasks", "description": "Count of the currently open tasks with this tag.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "number_of_assigned_open_tasks": {"name": "number_of_assigned_open_tasks", "description": "Count of the open and assigned tasks with this tag.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "number_of_tasks_completed": {"name": "number_of_tasks_completed", "description": "Count of tasks with this tag that have been completed.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "avg_days_open": {"name": "avg_days_open", "description": "The avg number of days that completed tasks with this tag were open.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "avg_days_assigned": {"name": "avg_days_assigned", "description": "The avg number of days that completed tasks with this tag were open and assigned.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "asana://models/asana.yml", "compiled_path": "target/compiled/asana/models/asana__tag.sql", "build_path": null, "deferred": false, "unrendered_config": {"schema": "asana", "materialized": "table"}, "created_at": 1671481804.766173, "compiled_code": "with asana_tag as (\n\n select * \n from \"postgres\".\"asana_integrations_tests_stg_asana\".\"stg_asana__tag\"\n),\n\ntask_tag as (\n\n select * \n from \"postgres\".\"asana_integrations_tests_stg_asana\".\"stg_asana__task_tag\"\n),\n\ntask as (\n\n select *\n from \"postgres\".\"asana_integrations_tests_asana\".\"asana__task\"\n\n where is_completed and tags is not null\n\n),\n\nagg_tag as (\n\n select\n asana_tag.tag_id,\n asana_tag.tag_name,\n asana_tag.created_at,\n sum(case when not task.is_completed then 1 else 0 end) as number_of_open_tasks,\n sum(case when not task.is_completed and task.assignee_user_id is not null then 1 else 0 end) as number_of_assigned_open_tasks,\n sum(case when task.is_completed then 1 else 0 end) as number_of_tasks_completed,\n round(avg(case when task.is_completed then task.days_open else null end), 0) as avg_days_open,\n round(avg(case when task.is_completed then task.days_since_last_assignment else null end), 0) as avg_days_assigned\n\n\n from asana_tag \n left join task_tag on asana_tag.tag_id = task_tag.tag_id\n left join task on task.task_id = task_tag.task_id\n\n group by 1,2,3\n)\n\nselect * from agg_tag", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "\"postgres\".\"asana_integrations_tests_asana\".\"asana__tag\""}, "model.asana.int_asana__task_comments": {"compiled": true, "resource_type": "model", "depends_on": {"macros": ["macro.fivetran_utils.string_agg"], "nodes": ["model.asana.int_asana__task_story"]}, "config": {"enabled": true, "alias": null, "schema": "asana", "database": null, "tags": [], "meta": {}, "materialized": "ephemeral", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "post-hook": [], "pre-hook": []}, "database": "postgres", "schema": "asana_integrations_tests_asana", "fqn": ["asana", "intermediate", "int_asana__task_comments"], "unique_id": "model.asana.int_asana__task_comments", "raw_code": "with comments as (\n \n select *\n from {{ ref('int_asana__task_story') }}\n where comment_content is not null\n order by target_task_id, created_at asc\n\n),\n\ntask_conversation as (\n\n select\n target_task_id as task_id,\n -- creates a chronologically ordered conversation about the task\n {{ fivetran_utils.string_agg( \"created_at || ' - ' || created_by_name || ': ' || comment_content\", \"'\\\\n'\" ) }} as conversation,\n count(*) as number_of_comments\n\n from comments \n group by 1\n)\n\nselect * from task_conversation", "language": "sql", "package_name": "asana", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/asana", "path": "intermediate/int_asana__task_comments.sql", "original_file_path": "models/intermediate/int_asana__task_comments.sql", "name": "int_asana__task_comments", "alias": "int_asana__task_comments", "checksum": {"name": "sha256", "checksum": "b50c377464e548b3cd44e3535fd4fa56541851bfa7029f6081f1b3f6b62b380d"}, "tags": [], "refs": [["int_asana__task_story"]], "sources": [], "metrics": [], "description": "Aggregates all comments on a task into a conversation + the number of comments", "columns": {"task_id": {"name": "task_id", "description": "", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "asana://models/intermediate/intermediate_asana.yml", "compiled_path": "target/compiled/asana/models/intermediate/int_asana__task_comments.sql", "build_path": null, "deferred": false, "unrendered_config": {"schema": "asana", "materialized": "ephemeral"}, "created_at": 1671481804.7828019, "compiled_code": "with __dbt__cte__int_asana__task_story as (\nwith story as (\n \n select * \n from \"postgres\".\"asana_integrations_tests_stg_asana\".\"stg_asana__story\"\n\n),\n\nasana_user as (\n\n select * \n from \"postgres\".\"asana_integrations_tests_stg_asana\".\"stg_asana__user\"\n),\n\nstory_user as (\n select \n story.*,\n asana_user.user_name as created_by_name\n from story\n join asana_user \n on story.created_by_user_id = asana_user.user_id\n),\n\nsplit_comments as (\n\n select\n story_id,\n created_at,\n created_by_user_id,\n created_by_name,\n target_task_id,\n \n case when event_type = 'comment' then story_content \n else null end as comment_content,\n\n case when event_type = 'system' then story_content \n else 'comment' end as action_description\n \n from story_user\n\n),\n\n\n-- the next CTE uses this dictionary to parse the type of action out of the event descfription\n\n\nparse_actions as (\n select\n story_id,\n target_task_id,\n created_at,\n created_by_user_id,\n created_by_name,\n comment_content,\n case \n when action_description like 'added the name%' then 'added name' \n when action_description like 'changed the name%' then 'changed name' \n when action_description like 'removed the name' then 'removed name' \n when action_description like 'added the description%' then 'added description' \n when action_description like 'changed the description%' then 'changed description' \n when action_description like 'removed the description' then 'removed description' \n when action_description like 'added to%' then 'added to project' \n when action_description like 'removed from%' then 'removed from project' \n when action_description like 'assigned%' then 'assigned' \n when action_description like 'unassigned%' then 'unassigned' \n when action_description like 'changed the due date%' then 'changed due date' \n when action_description like 'changed the start date%due date%' then 'changed due date' \n when action_description like 'changed the start date%' then 'changed start date' \n when action_description like 'removed the due date%' then 'removed due date' \n when action_description like 'removed the date range%' then 'removed due date' \n when action_description like 'removed the start date' then 'removed start date' \n when action_description like 'added subtask%' then 'added subtask' \n when action_description like 'added%collaborator%' then 'added collaborator' \n when action_description like 'moved%' then 'moved to section' \n when action_description like 'duplicated task from%' then 'duplicated this from other task' \n when action_description like 'marked%as a duplicate of this' then 'marked other task as duplicate of this' \n when action_description like 'marked this a duplicate of%' then 'marked as duplicate' \n when action_description like 'marked this task complete' then 'completed' \n when action_description like 'completed this task' then 'completed' \n when action_description like 'marked incomplete' then 'marked incomplete' \n when action_description like 'marked this task as a milestone' then 'marked as milestone' \n when action_description like 'unmarked this task as a milestone' then 'unmarked as milestone' \n when action_description like 'marked this milestone complete' then 'completed milestone' \n when action_description like 'completed this milestone' then 'completed milestone' \n when action_description like 'attached%' then 'attachment' \n when action_description like 'liked your comment' then 'liked comment' \n when action_description like 'liked this task' then 'liked task' \n when action_description like 'liked your attachment' then 'liked attachment' \n when action_description like 'liked that you completed this task' then 'liked completion' \n when action_description like 'completed the last task you were waiting on%' then 'completed dependency' \n when action_description like 'added feedback to%' then 'added feedback' \n when action_description like 'changed%to%' then 'changed tag' \n when action_description like 'cleared%' then 'cleared tag' \n when action_description like 'comment' then 'comment' \n when action_description like 'have a task due on%' then ''\n else action_description end as action_taken,\n action_description\n \n from split_comments\n\n),\n\n\nfinal as (\n \n select * \n from parse_actions\n\n -- remove actions you don't care about (set to null in the actions dictionary above)\n where action_taken is not null \n\n)\n\n\nselect * from final\n),comments as (\n \n select *\n from __dbt__cte__int_asana__task_story\n where comment_content is not null\n order by target_task_id, created_at asc\n\n),\n\ntask_conversation as (\n\n select\n target_task_id as task_id,\n -- creates a chronologically ordered conversation about the task\n \n string_agg(created_at || ' - ' || created_by_name || ': ' || comment_content, '\\n')\n\n as conversation,\n count(*) as number_of_comments\n\n from comments \n group by 1\n)\n\nselect * from task_conversation", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.asana.int_asana__task_story", "sql": " __dbt__cte__int_asana__task_story as (\nwith story as (\n \n select * \n from \"postgres\".\"asana_integrations_tests_stg_asana\".\"stg_asana__story\"\n\n),\n\nasana_user as (\n\n select * \n from \"postgres\".\"asana_integrations_tests_stg_asana\".\"stg_asana__user\"\n),\n\nstory_user as (\n select \n story.*,\n asana_user.user_name as created_by_name\n from story\n join asana_user \n on story.created_by_user_id = asana_user.user_id\n),\n\nsplit_comments as (\n\n select\n story_id,\n created_at,\n created_by_user_id,\n created_by_name,\n target_task_id,\n \n case when event_type = 'comment' then story_content \n else null end as comment_content,\n\n case when event_type = 'system' then story_content \n else 'comment' end as action_description\n \n from story_user\n\n),\n\n\n-- the next CTE uses this dictionary to parse the type of action out of the event descfription\n\n\nparse_actions as (\n select\n story_id,\n target_task_id,\n created_at,\n created_by_user_id,\n created_by_name,\n comment_content,\n case \n when action_description like 'added the name%' then 'added name' \n when action_description like 'changed the name%' then 'changed name' \n when action_description like 'removed the name' then 'removed name' \n when action_description like 'added the description%' then 'added description' \n when action_description like 'changed the description%' then 'changed description' \n when action_description like 'removed the description' then 'removed description' \n when action_description like 'added to%' then 'added to project' \n when action_description like 'removed from%' then 'removed from project' \n when action_description like 'assigned%' then 'assigned' \n when action_description like 'unassigned%' then 'unassigned' \n when action_description like 'changed the due date%' then 'changed due date' \n when action_description like 'changed the start date%due date%' then 'changed due date' \n when action_description like 'changed the start date%' then 'changed start date' \n when action_description like 'removed the due date%' then 'removed due date' \n when action_description like 'removed the date range%' then 'removed due date' \n when action_description like 'removed the start date' then 'removed start date' \n when action_description like 'added subtask%' then 'added subtask' \n when action_description like 'added%collaborator%' then 'added collaborator' \n when action_description like 'moved%' then 'moved to section' \n when action_description like 'duplicated task from%' then 'duplicated this from other task' \n when action_description like 'marked%as a duplicate of this' then 'marked other task as duplicate of this' \n when action_description like 'marked this a duplicate of%' then 'marked as duplicate' \n when action_description like 'marked this task complete' then 'completed' \n when action_description like 'completed this task' then 'completed' \n when action_description like 'marked incomplete' then 'marked incomplete' \n when action_description like 'marked this task as a milestone' then 'marked as milestone' \n when action_description like 'unmarked this task as a milestone' then 'unmarked as milestone' \n when action_description like 'marked this milestone complete' then 'completed milestone' \n when action_description like 'completed this milestone' then 'completed milestone' \n when action_description like 'attached%' then 'attachment' \n when action_description like 'liked your comment' then 'liked comment' \n when action_description like 'liked this task' then 'liked task' \n when action_description like 'liked your attachment' then 'liked attachment' \n when action_description like 'liked that you completed this task' then 'liked completion' \n when action_description like 'completed the last task you were waiting on%' then 'completed dependency' \n when action_description like 'added feedback to%' then 'added feedback' \n when action_description like 'changed%to%' then 'changed tag' \n when action_description like 'cleared%' then 'cleared tag' \n when action_description like 'comment' then 'comment' \n when action_description like 'have a task due on%' then ''\n else action_description end as action_taken,\n action_description\n \n from split_comments\n\n),\n\n\nfinal as (\n \n select * \n from parse_actions\n\n -- remove actions you don't care about (set to null in the actions dictionary above)\n where action_taken is not null \n\n)\n\n\nselect * from final\n)"}], "relation_name": null}, "model.asana.int_asana__project_task_metrics": {"compiled": true, "resource_type": "model", "depends_on": {"macros": [], "nodes": ["model.asana.asana__task", "model.asana_source.stg_asana__project", "model.asana_source.stg_asana__project_task"]}, "config": {"enabled": true, "alias": null, "schema": "asana", "database": null, "tags": [], "meta": {}, "materialized": "ephemeral", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "post-hook": [], "pre-hook": []}, "database": "postgres", "schema": "asana_integrations_tests_asana", "fqn": ["asana", "intermediate", "int_asana__project_task_metrics"], "unique_id": "model.asana.int_asana__project_task_metrics", "raw_code": "with task as (\n\n select *\n from {{ ref('asana__task') }}\n\n),\n\nproject as (\n\n select * \n from {{ var('project') }}\n\n),\n\nproject_task as (\n\n select * \n from {{ var('project_task') }}\n),\n\nproject_task_history as (\n\n select\n project.project_id,\n task.task_id,\n task.is_completed as task_is_completed,\n task.assignee_user_id as task_assignee_user_id,\n task.days_open as task_days_open,\n task.days_since_last_assignment as task_days_assigned_current_user\n\n from project\n left join project_task \n on project.project_id = project_task.project_id\n left join task \n on project_task.task_id = task.task_id\n\n),\n\nagg_proj_tasks as (\n\n select \n project_id,\n sum(case when not task_is_completed then 1 else 0 end) as number_of_open_tasks,\n sum(case when not task_is_completed and task_assignee_user_id is not null then 1 else 0 end) as number_of_assigned_open_tasks,\n sum(case when task_is_completed then 1 else 0 end) as number_of_tasks_completed,\n sum(case when task_is_completed and task_assignee_user_id is not null then 1 else 0 end) as number_of_assigned_tasks_completed,\n sum(case when task_is_completed then task_days_open else 0 end) as total_days_open,\n sum(case when task_is_completed then task_days_assigned_current_user else 0 end) as total_days_assigned_last_user -- will divde later for avg\n\n from project_task_history\n\n group by 1\n\n),\n\nfinal as (\n\n select\n agg_proj_tasks.*,\n round(nullif(total_days_open, 0) * 1.0 / nullif(number_of_tasks_completed, 0), 0) as avg_close_time_days,\n round(nullif(total_days_assigned_last_user, 0) * 1.0 / nullif(number_of_assigned_tasks_completed, 0), 0) as avg_close_time_assigned_days\n\n from agg_proj_tasks\n \n)\n\nselect * from final", "language": "sql", "package_name": "asana", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/asana", "path": "intermediate/int_asana__project_task_metrics.sql", "original_file_path": "models/intermediate/int_asana__project_task_metrics.sql", "name": "int_asana__project_task_metrics", "alias": "int_asana__project_task_metrics", "checksum": {"name": "sha256", "checksum": "59d3c639d66f84f786b75ff772ccc57cff3037a5d43fd3699a05da0459b2da7a"}, "tags": [], "refs": [["asana__task"], ["stg_asana__project"], ["stg_asana__project_task"]], "sources": [], "metrics": [], "description": "Draws from (non-intermediate) ASANA_TASK to compute metrics about tasks in each project.", "columns": {"project_id": {"name": "project_id", "description": "", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "asana://models/intermediate/intermediate_asana.yml", "compiled_path": "target/compiled/asana/models/intermediate/int_asana__project_task_metrics.sql", "build_path": null, "deferred": false, "unrendered_config": {"schema": "asana", "materialized": "ephemeral"}, "created_at": 1671481804.78129, "compiled_code": "with task as (\n\n select *\n from \"postgres\".\"asana_integrations_tests_asana\".\"asana__task\"\n\n),\n\nproject as (\n\n select * \n from \"postgres\".\"asana_integrations_tests_stg_asana\".\"stg_asana__project\"\n\n),\n\nproject_task as (\n\n select * \n from \"postgres\".\"asana_integrations_tests_stg_asana\".\"stg_asana__project_task\"\n),\n\nproject_task_history as (\n\n select\n project.project_id,\n task.task_id,\n task.is_completed as task_is_completed,\n task.assignee_user_id as task_assignee_user_id,\n task.days_open as task_days_open,\n task.days_since_last_assignment as task_days_assigned_current_user\n\n from project\n left join project_task \n on project.project_id = project_task.project_id\n left join task \n on project_task.task_id = task.task_id\n\n),\n\nagg_proj_tasks as (\n\n select \n project_id,\n sum(case when not task_is_completed then 1 else 0 end) as number_of_open_tasks,\n sum(case when not task_is_completed and task_assignee_user_id is not null then 1 else 0 end) as number_of_assigned_open_tasks,\n sum(case when task_is_completed then 1 else 0 end) as number_of_tasks_completed,\n sum(case when task_is_completed and task_assignee_user_id is not null then 1 else 0 end) as number_of_assigned_tasks_completed,\n sum(case when task_is_completed then task_days_open else 0 end) as total_days_open,\n sum(case when task_is_completed then task_days_assigned_current_user else 0 end) as total_days_assigned_last_user -- will divde later for avg\n\n from project_task_history\n\n group by 1\n\n),\n\nfinal as (\n\n select\n agg_proj_tasks.*,\n round(nullif(total_days_open, 0) * 1.0 / nullif(number_of_tasks_completed, 0), 0) as avg_close_time_days,\n round(nullif(total_days_assigned_last_user, 0) * 1.0 / nullif(number_of_assigned_tasks_completed, 0), 0) as avg_close_time_assigned_days\n\n from agg_proj_tasks\n \n)\n\nselect * from final", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null}, "model.asana.int_asana__user_task_metrics": {"compiled": true, "resource_type": "model", "depends_on": {"macros": [], "nodes": ["model.asana.asana__task"]}, "config": {"enabled": true, "alias": null, "schema": "asana", "database": null, "tags": [], "meta": {}, "materialized": "ephemeral", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "post-hook": [], "pre-hook": []}, "database": "postgres", "schema": "asana_integrations_tests_asana", "fqn": ["asana", "intermediate", "int_asana__user_task_metrics"], "unique_id": "model.asana.int_asana__user_task_metrics", "raw_code": "with tasks as (\n\n select * \n from {{ ref('asana__task') }}\n where assignee_user_id is not null\n\n), \n\nagg_user_tasks as (\n\n select \n assignee_user_id as user_id,\n sum(case when not is_completed then 1 else 0 end) as number_of_open_tasks,\n sum(case when is_completed then 1 else 0 end) as number_of_tasks_completed,\n sum(case when is_completed then days_since_last_assignment else 0 end) as days_assigned_this_user -- will divde later for avg\n\n from tasks\n\n group by 1\n\n),\n\nfinal as (\n select\n agg_user_tasks.user_id,\n agg_user_tasks.number_of_open_tasks,\n agg_user_tasks.number_of_tasks_completed,\n nullif(agg_user_tasks.days_assigned_this_user, 0) * 1.0 / nullif(agg_user_tasks.number_of_tasks_completed, 0) as avg_close_time_days\n\n from \n agg_user_tasks \n)\n\nselect * from final", "language": "sql", "package_name": "asana", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/asana", "path": "intermediate/int_asana__user_task_metrics.sql", "original_file_path": "models/intermediate/int_asana__user_task_metrics.sql", "name": "int_asana__user_task_metrics", "alias": "int_asana__user_task_metrics", "checksum": {"name": "sha256", "checksum": "22283e2744be59600dfcd8f89912736207b817d43c8ed00b1a49a7e4926237bd"}, "tags": [], "refs": [["asana__task"]], "sources": [], "metrics": [], "description": "Draws from (non-intermediate) ASANA_TASK to compute metrics about tasks for each user.", "columns": {"user_id": {"name": "user_id", "description": "", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "asana://models/intermediate/intermediate_asana.yml", "compiled_path": "target/compiled/asana/models/intermediate/int_asana__user_task_metrics.sql", "build_path": null, "deferred": false, "unrendered_config": {"schema": "asana", "materialized": "ephemeral"}, "created_at": 1671481804.786519, "compiled_code": "with tasks as (\n\n select * \n from \"postgres\".\"asana_integrations_tests_asana\".\"asana__task\"\n where assignee_user_id is not null\n\n), \n\nagg_user_tasks as (\n\n select \n assignee_user_id as user_id,\n sum(case when not is_completed then 1 else 0 end) as number_of_open_tasks,\n sum(case when is_completed then 1 else 0 end) as number_of_tasks_completed,\n sum(case when is_completed then days_since_last_assignment else 0 end) as days_assigned_this_user -- will divde later for avg\n\n from tasks\n\n group by 1\n\n),\n\nfinal as (\n select\n agg_user_tasks.user_id,\n agg_user_tasks.number_of_open_tasks,\n agg_user_tasks.number_of_tasks_completed,\n nullif(agg_user_tasks.days_assigned_this_user, 0) * 1.0 / nullif(agg_user_tasks.number_of_tasks_completed, 0) as avg_close_time_days\n\n from \n agg_user_tasks \n)\n\nselect * from final", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null}, "model.asana.int_asana__task_tags": {"compiled": true, "resource_type": "model", "depends_on": {"macros": ["macro.fivetran_utils.string_agg"], "nodes": ["model.asana_source.stg_asana__task_tag", "model.asana_source.stg_asana__tag"]}, "config": {"enabled": true, "alias": null, "schema": "asana", "database": null, "tags": [], "meta": {}, "materialized": "ephemeral", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "post-hook": [], "pre-hook": []}, "database": "postgres", "schema": "asana_integrations_tests_asana", "fqn": ["asana", "intermediate", "int_asana__task_tags"], "unique_id": "model.asana.int_asana__task_tags", "raw_code": "with task_tag as (\n \n select *\n from {{ var('task_tag') }}\n\n),\n\nasana_tag as (\n\n select * \n from {{ var('tag') }}\n\n),\n\nagg_tags as (\n\n select\n task_tag.task_id,\n {{ fivetran_utils.string_agg( 'asana_tag.tag_name', \"', '\" )}} as tags,\n count(*) as number_of_tags\n from task_tag \n join asana_tag \n on asana_tag.tag_id = task_tag.tag_id\n group by 1\n \n)\n\nselect * from agg_tags", "language": "sql", "package_name": "asana", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/asana", "path": "intermediate/int_asana__task_tags.sql", "original_file_path": "models/intermediate/int_asana__task_tags.sql", "name": "int_asana__task_tags", "alias": "int_asana__task_tags", "checksum": {"name": "sha256", "checksum": "8016dbd490f23f719d4a3dd688ab6c5c2897b86746e3ea63c0b739cfbdda6848"}, "tags": [], "refs": [["stg_asana__task_tag"], ["stg_asana__tag"]], "sources": [], "metrics": [], "description": "Aggregates a count of and a list of the names of the tags attached to each task.", "columns": {"task_id": {"name": "task_id", "description": "", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "asana://models/intermediate/intermediate_asana.yml", "compiled_path": "target/compiled/asana/models/intermediate/int_asana__task_tags.sql", "build_path": null, "deferred": false, "unrendered_config": {"schema": "asana", "materialized": "ephemeral"}, "created_at": 1671481804.7860649, "compiled_code": "with task_tag as (\n \n select *\n from \"postgres\".\"asana_integrations_tests_stg_asana\".\"stg_asana__task_tag\"\n\n),\n\nasana_tag as (\n\n select * \n from \"postgres\".\"asana_integrations_tests_stg_asana\".\"stg_asana__tag\"\n\n),\n\nagg_tags as (\n\n select\n task_tag.task_id,\n \n string_agg(asana_tag.tag_name, ', ')\n\n as tags,\n count(*) as number_of_tags\n from task_tag \n join asana_tag \n on asana_tag.tag_id = task_tag.tag_id\n group by 1\n \n)\n\nselect * from agg_tags", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null}, "model.asana.int_asana__task_open_length": {"compiled": true, "resource_type": "model", "depends_on": {"macros": ["macro.dbt.current_timestamp_backcompat", "macro.dbt.datediff"], "nodes": ["model.asana_source.stg_asana__task", "model.asana.int_asana__task_story"]}, "config": {"enabled": true, "alias": null, "schema": "asana", "database": null, "tags": [], "meta": {}, "materialized": "ephemeral", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "post-hook": [], "pre-hook": []}, "database": "postgres", "schema": "asana_integrations_tests_asana", "fqn": ["asana", "intermediate", "int_asana__task_open_length"], "unique_id": "model.asana.int_asana__task_open_length", "raw_code": "with task as (\n \n select *\n from {{ var('task') }}\n\n),\n\nstory as (\n\n select * \n from {{ ref('int_asana__task_story') }}\n\n),\n\nassignments as (\n \n select \n target_task_id as task_id,\n min(created_at) as first_assigned_at,\n max(created_at) as last_assigned_at -- current assignment\n\n from story\n where action_taken = 'assigned'\n\n group by 1\n\n),\n\n\nopen_assigned_length as (\n\n {% set open_until = 'task.completed_at' if 'task.is_completed' is true else dbt.current_timestamp_backcompat() %}\n\n select\n task.task_id,\n task.is_completed,\n task.completed_at,\n task.assignee_user_id is not null as is_currently_assigned,\n assignments.task_id is not null as has_been_assigned,\n assignments.last_assigned_at as last_assigned_at,\n assignments.first_assigned_at as first_assigned_at,\n {{ dbt.datediff('task.created_at', open_until, 'day') }} as days_open,\n\n -- if the task is currently assigned, this is the time it has been assigned to this current user.\n {{ dbt.datediff('assignments.last_assigned_at', open_until, 'day') }} as days_since_last_assignment,\n\n {{ dbt.datediff('assignments.first_assigned_at', open_until, 'day') }} as days_since_first_assignment\n \n\n from task\n left join assignments \n on task.task_id = assignments.task_id\n\n)\n\n\nselect * from open_assigned_length", "language": "sql", "package_name": "asana", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/asana", "path": "intermediate/int_asana__task_open_length.sql", "original_file_path": "models/intermediate/int_asana__task_open_length.sql", "name": "int_asana__task_open_length", "alias": "int_asana__task_open_length", "checksum": {"name": "sha256", "checksum": "5b19dd1475b36b2dcd4e392e36ba362b01ec870a93d6e6696c6feb5070aef4d9"}, "tags": [], "refs": [["stg_asana__task"], ["int_asana__task_story"]], "sources": [], "metrics": [], "description": "Computes the days that each task has spent open and assigned.", "columns": {"task_id": {"name": "task_id", "description": "", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "asana://models/intermediate/intermediate_asana.yml", "compiled_path": "target/compiled/asana/models/intermediate/int_asana__task_open_length.sql", "build_path": null, "deferred": false, "unrendered_config": {"schema": "asana", "materialized": "ephemeral"}, "created_at": 1671481804.7844532, "compiled_code": "with __dbt__cte__int_asana__task_story as (\nwith story as (\n \n select * \n from \"postgres\".\"asana_integrations_tests_stg_asana\".\"stg_asana__story\"\n\n),\n\nasana_user as (\n\n select * \n from \"postgres\".\"asana_integrations_tests_stg_asana\".\"stg_asana__user\"\n),\n\nstory_user as (\n select \n story.*,\n asana_user.user_name as created_by_name\n from story\n join asana_user \n on story.created_by_user_id = asana_user.user_id\n),\n\nsplit_comments as (\n\n select\n story_id,\n created_at,\n created_by_user_id,\n created_by_name,\n target_task_id,\n \n case when event_type = 'comment' then story_content \n else null end as comment_content,\n\n case when event_type = 'system' then story_content \n else 'comment' end as action_description\n \n from story_user\n\n),\n\n\n-- the next CTE uses this dictionary to parse the type of action out of the event descfription\n\n\nparse_actions as (\n select\n story_id,\n target_task_id,\n created_at,\n created_by_user_id,\n created_by_name,\n comment_content,\n case \n when action_description like 'added the name%' then 'added name' \n when action_description like 'changed the name%' then 'changed name' \n when action_description like 'removed the name' then 'removed name' \n when action_description like 'added the description%' then 'added description' \n when action_description like 'changed the description%' then 'changed description' \n when action_description like 'removed the description' then 'removed description' \n when action_description like 'added to%' then 'added to project' \n when action_description like 'removed from%' then 'removed from project' \n when action_description like 'assigned%' then 'assigned' \n when action_description like 'unassigned%' then 'unassigned' \n when action_description like 'changed the due date%' then 'changed due date' \n when action_description like 'changed the start date%due date%' then 'changed due date' \n when action_description like 'changed the start date%' then 'changed start date' \n when action_description like 'removed the due date%' then 'removed due date' \n when action_description like 'removed the date range%' then 'removed due date' \n when action_description like 'removed the start date' then 'removed start date' \n when action_description like 'added subtask%' then 'added subtask' \n when action_description like 'added%collaborator%' then 'added collaborator' \n when action_description like 'moved%' then 'moved to section' \n when action_description like 'duplicated task from%' then 'duplicated this from other task' \n when action_description like 'marked%as a duplicate of this' then 'marked other task as duplicate of this' \n when action_description like 'marked this a duplicate of%' then 'marked as duplicate' \n when action_description like 'marked this task complete' then 'completed' \n when action_description like 'completed this task' then 'completed' \n when action_description like 'marked incomplete' then 'marked incomplete' \n when action_description like 'marked this task as a milestone' then 'marked as milestone' \n when action_description like 'unmarked this task as a milestone' then 'unmarked as milestone' \n when action_description like 'marked this milestone complete' then 'completed milestone' \n when action_description like 'completed this milestone' then 'completed milestone' \n when action_description like 'attached%' then 'attachment' \n when action_description like 'liked your comment' then 'liked comment' \n when action_description like 'liked this task' then 'liked task' \n when action_description like 'liked your attachment' then 'liked attachment' \n when action_description like 'liked that you completed this task' then 'liked completion' \n when action_description like 'completed the last task you were waiting on%' then 'completed dependency' \n when action_description like 'added feedback to%' then 'added feedback' \n when action_description like 'changed%to%' then 'changed tag' \n when action_description like 'cleared%' then 'cleared tag' \n when action_description like 'comment' then 'comment' \n when action_description like 'have a task due on%' then ''\n else action_description end as action_taken,\n action_description\n \n from split_comments\n\n),\n\n\nfinal as (\n \n select * \n from parse_actions\n\n -- remove actions you don't care about (set to null in the actions dictionary above)\n where action_taken is not null \n\n)\n\n\nselect * from final\n),task as (\n \n select *\n from \"postgres\".\"asana_integrations_tests_stg_asana\".\"stg_asana__task\"\n\n),\n\nstory as (\n\n select * \n from __dbt__cte__int_asana__task_story\n\n),\n\nassignments as (\n \n select \n target_task_id as task_id,\n min(created_at) as first_assigned_at,\n max(created_at) as last_assigned_at -- current assignment\n\n from story\n where action_taken = 'assigned'\n\n group by 1\n\n),\n\n\nopen_assigned_length as (\n\n \n\n select\n task.task_id,\n task.is_completed,\n task.completed_at,\n task.assignee_user_id is not null as is_currently_assigned,\n assignments.task_id is not null as has_been_assigned,\n assignments.last_assigned_at as last_assigned_at,\n assignments.first_assigned_at as first_assigned_at,\n \n ((\n current_timestamp::TIMESTAMP\n)::date - (task.created_at)::date)\n as days_open,\n\n -- if the task is currently assigned, this is the time it has been assigned to this current user.\n \n ((\n current_timestamp::TIMESTAMP\n)::date - (assignments.last_assigned_at)::date)\n as days_since_last_assignment,\n\n \n ((\n current_timestamp::TIMESTAMP\n)::date - (assignments.first_assigned_at)::date)\n as days_since_first_assignment\n \n\n from task\n left join assignments \n on task.task_id = assignments.task_id\n\n)\n\n\nselect * from open_assigned_length", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.asana.int_asana__task_story", "sql": " __dbt__cte__int_asana__task_story as (\nwith story as (\n \n select * \n from \"postgres\".\"asana_integrations_tests_stg_asana\".\"stg_asana__story\"\n\n),\n\nasana_user as (\n\n select * \n from \"postgres\".\"asana_integrations_tests_stg_asana\".\"stg_asana__user\"\n),\n\nstory_user as (\n select \n story.*,\n asana_user.user_name as created_by_name\n from story\n join asana_user \n on story.created_by_user_id = asana_user.user_id\n),\n\nsplit_comments as (\n\n select\n story_id,\n created_at,\n created_by_user_id,\n created_by_name,\n target_task_id,\n \n case when event_type = 'comment' then story_content \n else null end as comment_content,\n\n case when event_type = 'system' then story_content \n else 'comment' end as action_description\n \n from story_user\n\n),\n\n\n-- the next CTE uses this dictionary to parse the type of action out of the event descfription\n\n\nparse_actions as (\n select\n story_id,\n target_task_id,\n created_at,\n created_by_user_id,\n created_by_name,\n comment_content,\n case \n when action_description like 'added the name%' then 'added name' \n when action_description like 'changed the name%' then 'changed name' \n when action_description like 'removed the name' then 'removed name' \n when action_description like 'added the description%' then 'added description' \n when action_description like 'changed the description%' then 'changed description' \n when action_description like 'removed the description' then 'removed description' \n when action_description like 'added to%' then 'added to project' \n when action_description like 'removed from%' then 'removed from project' \n when action_description like 'assigned%' then 'assigned' \n when action_description like 'unassigned%' then 'unassigned' \n when action_description like 'changed the due date%' then 'changed due date' \n when action_description like 'changed the start date%due date%' then 'changed due date' \n when action_description like 'changed the start date%' then 'changed start date' \n when action_description like 'removed the due date%' then 'removed due date' \n when action_description like 'removed the date range%' then 'removed due date' \n when action_description like 'removed the start date' then 'removed start date' \n when action_description like 'added subtask%' then 'added subtask' \n when action_description like 'added%collaborator%' then 'added collaborator' \n when action_description like 'moved%' then 'moved to section' \n when action_description like 'duplicated task from%' then 'duplicated this from other task' \n when action_description like 'marked%as a duplicate of this' then 'marked other task as duplicate of this' \n when action_description like 'marked this a duplicate of%' then 'marked as duplicate' \n when action_description like 'marked this task complete' then 'completed' \n when action_description like 'completed this task' then 'completed' \n when action_description like 'marked incomplete' then 'marked incomplete' \n when action_description like 'marked this task as a milestone' then 'marked as milestone' \n when action_description like 'unmarked this task as a milestone' then 'unmarked as milestone' \n when action_description like 'marked this milestone complete' then 'completed milestone' \n when action_description like 'completed this milestone' then 'completed milestone' \n when action_description like 'attached%' then 'attachment' \n when action_description like 'liked your comment' then 'liked comment' \n when action_description like 'liked this task' then 'liked task' \n when action_description like 'liked your attachment' then 'liked attachment' \n when action_description like 'liked that you completed this task' then 'liked completion' \n when action_description like 'completed the last task you were waiting on%' then 'completed dependency' \n when action_description like 'added feedback to%' then 'added feedback' \n when action_description like 'changed%to%' then 'changed tag' \n when action_description like 'cleared%' then 'cleared tag' \n when action_description like 'comment' then 'comment' \n when action_description like 'have a task due on%' then ''\n else action_description end as action_taken,\n action_description\n \n from split_comments\n\n),\n\n\nfinal as (\n \n select * \n from parse_actions\n\n -- remove actions you don't care about (set to null in the actions dictionary above)\n where action_taken is not null \n\n)\n\n\nselect * from final\n)"}], "relation_name": null}, "model.asana.int_asana__task_followers": {"compiled": true, "resource_type": "model", "depends_on": {"macros": ["macro.fivetran_utils.string_agg"], "nodes": ["model.asana_source.stg_asana__task_follower", "model.asana_source.stg_asana__user"]}, "config": {"enabled": true, "alias": null, "schema": "asana", "database": null, "tags": [], "meta": {}, "materialized": "ephemeral", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "post-hook": [], "pre-hook": []}, "database": "postgres", "schema": "asana_integrations_tests_asana", "fqn": ["asana", "intermediate", "int_asana__task_followers"], "unique_id": "model.asana.int_asana__task_followers", "raw_code": "with task_follower as (\n \n select *\n from {{ var('task_follower') }}\n\n),\n\nasana_user as (\n\n select * \n from {{ var('user') }}\n\n),\n\nagg_followers as (\n\n select\n task_follower.task_id,\n {{ fivetran_utils.string_agg( 'asana_user.user_name', \"', '\" )}} as followers,\n count(*) as number_of_followers\n from task_follower \n join asana_user \n on asana_user.user_id = task_follower.user_id\n group by 1\n \n)\n\nselect * from agg_followers", "language": "sql", "package_name": "asana", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/asana", "path": "intermediate/int_asana__task_followers.sql", "original_file_path": "models/intermediate/int_asana__task_followers.sql", "name": "int_asana__task_followers", "alias": "int_asana__task_followers", "checksum": {"name": "sha256", "checksum": "fafdd691a271f08b345565db3962fd360163ec2213098c8fda86265d2680710c"}, "tags": [], "refs": [["stg_asana__task_follower"], ["stg_asana__user"]], "sources": [], "metrics": [], "description": "Aggregates a count of and a list of the names of the users who follow each task", "columns": {"task_id": {"name": "task_id", "description": "", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "asana://models/intermediate/intermediate_asana.yml", "compiled_path": "target/compiled/asana/models/intermediate/int_asana__task_followers.sql", "build_path": null, "deferred": false, "unrendered_config": {"schema": "asana", "materialized": "ephemeral"}, "created_at": 1671481804.784032, "compiled_code": "with task_follower as (\n \n select *\n from \"postgres\".\"asana_integrations_tests_stg_asana\".\"stg_asana__task_follower\"\n\n),\n\nasana_user as (\n\n select * \n from \"postgres\".\"asana_integrations_tests_stg_asana\".\"stg_asana__user\"\n\n),\n\nagg_followers as (\n\n select\n task_follower.task_id,\n \n string_agg(asana_user.user_name, ', ')\n\n as followers,\n count(*) as number_of_followers\n from task_follower \n join asana_user \n on asana_user.user_id = task_follower.user_id\n group by 1\n \n)\n\nselect * from agg_followers", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null}, "model.asana.int_asana__project_user": {"compiled": true, "resource_type": "model", "depends_on": {"macros": [], "nodes": ["model.asana_source.stg_asana__project_task", "model.asana.int_asana__task_assignee", "model.asana_source.stg_asana__project"]}, "config": {"enabled": true, "alias": null, "schema": "asana", "database": null, "tags": [], "meta": {}, "materialized": "ephemeral", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "post-hook": [], "pre-hook": []}, "database": "postgres", "schema": "asana_integrations_tests_asana", "fqn": ["asana", "intermediate", "int_asana__project_user"], "unique_id": "model.asana.int_asana__project_user", "raw_code": "with project_tasks as (\n \n select *\n from {{ var('project_task') }}\n),\n\nassigned_tasks as (\n \n select * \n from {{ ref('int_asana__task_assignee') }}\n where has_assignee\n \n),\n\nproject as (\n \n select *\n from {{ var('project') }}\n\n where not is_archived\n\n),\n\nproject_assignee as (\n\n select\n project_tasks.project_id,\n project_tasks.task_id,\n assigned_tasks.assignee_user_id,\n assigned_tasks.assignee_name,\n not assigned_tasks.is_completed as currently_working_on\n\n from project_tasks \n join assigned_tasks \n on assigned_tasks.task_id = project_tasks.task_id\n\n),\n\nproject_owner as (\n\n select \n project_id,\n project_name,\n owner_user_id\n\n from project\n \n where owner_user_id is not null\n),\n\nproject_user as (\n \n select\n project_id,\n project_name,\n owner_user_id as user_id,\n 'owner' as role,\n null as currently_working_on\n \n from project_owner\n\n union all\n\n select\n project.project_id,\n project.project_name,\n project_assignee.assignee_user_id as user_id,\n 'task assignee' as role,\n project_assignee.currently_working_on\n \n from project \n \n join project_assignee \n on project.project_id = project_assignee.project_id\n group by 1,2,3,4,5\n\n)\n\n\nselect * from project_user", "language": "sql", "package_name": "asana", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/asana", "path": "intermediate/int_asana__project_user.sql", "original_file_path": "models/intermediate/int_asana__project_user.sql", "name": "int_asana__project_user", "alias": "int_asana__project_user", "checksum": {"name": "sha256", "checksum": "28422acac2869e218af531cdd062ef4dcdde594a75a39e7ba4cc56119117e636"}, "tags": [], "refs": [["stg_asana__project_task"], ["int_asana__task_assignee"], ["stg_asana__project"]], "sources": [], "metrics": [], "description": "Table of who is *working* on the project -- its owner + users assigned to it tasks", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "asana://models/intermediate/intermediate_asana.yml", "compiled_path": "target/compiled/asana/models/intermediate/int_asana__project_user.sql", "build_path": null, "deferred": false, "unrendered_config": {"schema": "asana", "materialized": "ephemeral"}, "created_at": 1671481804.781554, "compiled_code": "with __dbt__cte__int_asana__task_assignee as (\nwith task as (\n\n select * \n from \"postgres\".\"asana_integrations_tests_stg_asana\".\"stg_asana__task\"\n\n),\n\nasana_user as (\n\n select *\n from \"postgres\".\"asana_integrations_tests_stg_asana\".\"stg_asana__user\"\n),\n\ntask_assignee as (\n\n select\n task.*,\n assignee_user_id is not null as has_assignee,\n asana_user.user_name as assignee_name,\n asana_user.email as assignee_email\n\n from task \n left join asana_user \n on task.assignee_user_id = asana_user.user_id\n)\n\nselect * from task_assignee\n),project_tasks as (\n \n select *\n from \"postgres\".\"asana_integrations_tests_stg_asana\".\"stg_asana__project_task\"\n),\n\nassigned_tasks as (\n \n select * \n from __dbt__cte__int_asana__task_assignee\n where has_assignee\n \n),\n\nproject as (\n \n select *\n from \"postgres\".\"asana_integrations_tests_stg_asana\".\"stg_asana__project\"\n\n where not is_archived\n\n),\n\nproject_assignee as (\n\n select\n project_tasks.project_id,\n project_tasks.task_id,\n assigned_tasks.assignee_user_id,\n assigned_tasks.assignee_name,\n not assigned_tasks.is_completed as currently_working_on\n\n from project_tasks \n join assigned_tasks \n on assigned_tasks.task_id = project_tasks.task_id\n\n),\n\nproject_owner as (\n\n select \n project_id,\n project_name,\n owner_user_id\n\n from project\n \n where owner_user_id is not null\n),\n\nproject_user as (\n \n select\n project_id,\n project_name,\n owner_user_id as user_id,\n 'owner' as role,\n null as currently_working_on\n \n from project_owner\n\n union all\n\n select\n project.project_id,\n project.project_name,\n project_assignee.assignee_user_id as user_id,\n 'task assignee' as role,\n project_assignee.currently_working_on\n \n from project \n \n join project_assignee \n on project.project_id = project_assignee.project_id\n group by 1,2,3,4,5\n\n)\n\n\nselect * from project_user", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.asana.int_asana__task_assignee", "sql": " __dbt__cte__int_asana__task_assignee as (\nwith task as (\n\n select * \n from \"postgres\".\"asana_integrations_tests_stg_asana\".\"stg_asana__task\"\n\n),\n\nasana_user as (\n\n select *\n from \"postgres\".\"asana_integrations_tests_stg_asana\".\"stg_asana__user\"\n),\n\ntask_assignee as (\n\n select\n task.*,\n assignee_user_id is not null as has_assignee,\n asana_user.user_name as assignee_name,\n asana_user.email as assignee_email\n\n from task \n left join asana_user \n on task.assignee_user_id = asana_user.user_id\n)\n\nselect * from task_assignee\n)"}], "relation_name": null}, "model.asana.int_asana__task_first_modifier": {"compiled": true, "resource_type": "model", "depends_on": {"macros": [], "nodes": ["model.asana.int_asana__task_story"]}, "config": {"enabled": true, "alias": null, "schema": "asana", "database": null, "tags": [], "meta": {}, "materialized": "ephemeral", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "post-hook": [], "pre-hook": []}, "database": "postgres", "schema": "asana_integrations_tests_asana", "fqn": ["asana", "intermediate", "int_asana__task_first_modifier"], "unique_id": "model.asana.int_asana__task_first_modifier", "raw_code": "with story as (\n\n select *\n from {{ ref('int_asana__task_story') }}\n where created_by_user_id is not null -- sometimes user id can be null in story. limit to ones with associated users\n),\n\nordered_stories as (\n\n select \n target_task_id,\n created_by_user_id,\n created_by_name,\n created_at,\n row_number() over ( partition by target_task_id order by created_at asc ) as nth_story\n \n from story\n\n),\n\nfirst_modifier as (\n\n select \n target_task_id as task_id,\n created_by_user_id as first_modifier_user_id,\n created_by_name as first_modifier_name\n\n from ordered_stories \n where nth_story = 1\n)\n\nselect *\nfrom first_modifier", "language": "sql", "package_name": "asana", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/asana", "path": "intermediate/int_asana__task_first_modifier.sql", "original_file_path": "models/intermediate/int_asana__task_first_modifier.sql", "name": "int_asana__task_first_modifier", "alias": "int_asana__task_first_modifier", "checksum": {"name": "sha256", "checksum": "1f6f8640a32bd71cb45062dfd5cffc7c6c5232051c33580299b613717f7ba2f6"}, "tags": [], "refs": [["int_asana__task_story"]], "sources": [], "metrics": [], "description": "Extracts the first person to make a story (modify) the task. A proxy for the task creator, since that's not provided.", "columns": {"task_id": {"name": "task_id", "description": "", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "asana://models/intermediate/intermediate_asana.yml", "compiled_path": "target/compiled/asana/models/intermediate/int_asana__task_first_modifier.sql", "build_path": null, "deferred": false, "unrendered_config": {"schema": "asana", "materialized": "ephemeral"}, "created_at": 1671481804.783194, "compiled_code": "with __dbt__cte__int_asana__task_story as (\nwith story as (\n \n select * \n from \"postgres\".\"asana_integrations_tests_stg_asana\".\"stg_asana__story\"\n\n),\n\nasana_user as (\n\n select * \n from \"postgres\".\"asana_integrations_tests_stg_asana\".\"stg_asana__user\"\n),\n\nstory_user as (\n select \n story.*,\n asana_user.user_name as created_by_name\n from story\n join asana_user \n on story.created_by_user_id = asana_user.user_id\n),\n\nsplit_comments as (\n\n select\n story_id,\n created_at,\n created_by_user_id,\n created_by_name,\n target_task_id,\n \n case when event_type = 'comment' then story_content \n else null end as comment_content,\n\n case when event_type = 'system' then story_content \n else 'comment' end as action_description\n \n from story_user\n\n),\n\n\n-- the next CTE uses this dictionary to parse the type of action out of the event descfription\n\n\nparse_actions as (\n select\n story_id,\n target_task_id,\n created_at,\n created_by_user_id,\n created_by_name,\n comment_content,\n case \n when action_description like 'added the name%' then 'added name' \n when action_description like 'changed the name%' then 'changed name' \n when action_description like 'removed the name' then 'removed name' \n when action_description like 'added the description%' then 'added description' \n when action_description like 'changed the description%' then 'changed description' \n when action_description like 'removed the description' then 'removed description' \n when action_description like 'added to%' then 'added to project' \n when action_description like 'removed from%' then 'removed from project' \n when action_description like 'assigned%' then 'assigned' \n when action_description like 'unassigned%' then 'unassigned' \n when action_description like 'changed the due date%' then 'changed due date' \n when action_description like 'changed the start date%due date%' then 'changed due date' \n when action_description like 'changed the start date%' then 'changed start date' \n when action_description like 'removed the due date%' then 'removed due date' \n when action_description like 'removed the date range%' then 'removed due date' \n when action_description like 'removed the start date' then 'removed start date' \n when action_description like 'added subtask%' then 'added subtask' \n when action_description like 'added%collaborator%' then 'added collaborator' \n when action_description like 'moved%' then 'moved to section' \n when action_description like 'duplicated task from%' then 'duplicated this from other task' \n when action_description like 'marked%as a duplicate of this' then 'marked other task as duplicate of this' \n when action_description like 'marked this a duplicate of%' then 'marked as duplicate' \n when action_description like 'marked this task complete' then 'completed' \n when action_description like 'completed this task' then 'completed' \n when action_description like 'marked incomplete' then 'marked incomplete' \n when action_description like 'marked this task as a milestone' then 'marked as milestone' \n when action_description like 'unmarked this task as a milestone' then 'unmarked as milestone' \n when action_description like 'marked this milestone complete' then 'completed milestone' \n when action_description like 'completed this milestone' then 'completed milestone' \n when action_description like 'attached%' then 'attachment' \n when action_description like 'liked your comment' then 'liked comment' \n when action_description like 'liked this task' then 'liked task' \n when action_description like 'liked your attachment' then 'liked attachment' \n when action_description like 'liked that you completed this task' then 'liked completion' \n when action_description like 'completed the last task you were waiting on%' then 'completed dependency' \n when action_description like 'added feedback to%' then 'added feedback' \n when action_description like 'changed%to%' then 'changed tag' \n when action_description like 'cleared%' then 'cleared tag' \n when action_description like 'comment' then 'comment' \n when action_description like 'have a task due on%' then ''\n else action_description end as action_taken,\n action_description\n \n from split_comments\n\n),\n\n\nfinal as (\n \n select * \n from parse_actions\n\n -- remove actions you don't care about (set to null in the actions dictionary above)\n where action_taken is not null \n\n)\n\n\nselect * from final\n),story as (\n\n select *\n from __dbt__cte__int_asana__task_story\n where created_by_user_id is not null -- sometimes user id can be null in story. limit to ones with associated users\n),\n\nordered_stories as (\n\n select \n target_task_id,\n created_by_user_id,\n created_by_name,\n created_at,\n row_number() over ( partition by target_task_id order by created_at asc ) as nth_story\n \n from story\n\n),\n\nfirst_modifier as (\n\n select \n target_task_id as task_id,\n created_by_user_id as first_modifier_user_id,\n created_by_name as first_modifier_name\n\n from ordered_stories \n where nth_story = 1\n)\n\nselect *\nfrom first_modifier", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.asana.int_asana__task_story", "sql": " __dbt__cte__int_asana__task_story as (\nwith story as (\n \n select * \n from \"postgres\".\"asana_integrations_tests_stg_asana\".\"stg_asana__story\"\n\n),\n\nasana_user as (\n\n select * \n from \"postgres\".\"asana_integrations_tests_stg_asana\".\"stg_asana__user\"\n),\n\nstory_user as (\n select \n story.*,\n asana_user.user_name as created_by_name\n from story\n join asana_user \n on story.created_by_user_id = asana_user.user_id\n),\n\nsplit_comments as (\n\n select\n story_id,\n created_at,\n created_by_user_id,\n created_by_name,\n target_task_id,\n \n case when event_type = 'comment' then story_content \n else null end as comment_content,\n\n case when event_type = 'system' then story_content \n else 'comment' end as action_description\n \n from story_user\n\n),\n\n\n-- the next CTE uses this dictionary to parse the type of action out of the event descfription\n\n\nparse_actions as (\n select\n story_id,\n target_task_id,\n created_at,\n created_by_user_id,\n created_by_name,\n comment_content,\n case \n when action_description like 'added the name%' then 'added name' \n when action_description like 'changed the name%' then 'changed name' \n when action_description like 'removed the name' then 'removed name' \n when action_description like 'added the description%' then 'added description' \n when action_description like 'changed the description%' then 'changed description' \n when action_description like 'removed the description' then 'removed description' \n when action_description like 'added to%' then 'added to project' \n when action_description like 'removed from%' then 'removed from project' \n when action_description like 'assigned%' then 'assigned' \n when action_description like 'unassigned%' then 'unassigned' \n when action_description like 'changed the due date%' then 'changed due date' \n when action_description like 'changed the start date%due date%' then 'changed due date' \n when action_description like 'changed the start date%' then 'changed start date' \n when action_description like 'removed the due date%' then 'removed due date' \n when action_description like 'removed the date range%' then 'removed due date' \n when action_description like 'removed the start date' then 'removed start date' \n when action_description like 'added subtask%' then 'added subtask' \n when action_description like 'added%collaborator%' then 'added collaborator' \n when action_description like 'moved%' then 'moved to section' \n when action_description like 'duplicated task from%' then 'duplicated this from other task' \n when action_description like 'marked%as a duplicate of this' then 'marked other task as duplicate of this' \n when action_description like 'marked this a duplicate of%' then 'marked as duplicate' \n when action_description like 'marked this task complete' then 'completed' \n when action_description like 'completed this task' then 'completed' \n when action_description like 'marked incomplete' then 'marked incomplete' \n when action_description like 'marked this task as a milestone' then 'marked as milestone' \n when action_description like 'unmarked this task as a milestone' then 'unmarked as milestone' \n when action_description like 'marked this milestone complete' then 'completed milestone' \n when action_description like 'completed this milestone' then 'completed milestone' \n when action_description like 'attached%' then 'attachment' \n when action_description like 'liked your comment' then 'liked comment' \n when action_description like 'liked this task' then 'liked task' \n when action_description like 'liked your attachment' then 'liked attachment' \n when action_description like 'liked that you completed this task' then 'liked completion' \n when action_description like 'completed the last task you were waiting on%' then 'completed dependency' \n when action_description like 'added feedback to%' then 'added feedback' \n when action_description like 'changed%to%' then 'changed tag' \n when action_description like 'cleared%' then 'cleared tag' \n when action_description like 'comment' then 'comment' \n when action_description like 'have a task due on%' then ''\n else action_description end as action_taken,\n action_description\n \n from split_comments\n\n),\n\n\nfinal as (\n \n select * \n from parse_actions\n\n -- remove actions you don't care about (set to null in the actions dictionary above)\n where action_taken is not null \n\n)\n\n\nselect * from final\n)"}], "relation_name": null}, "model.asana.int_asana__task_projects": {"compiled": true, "resource_type": "model", "depends_on": {"macros": ["macro.fivetran_utils.string_agg"], "nodes": ["model.asana_source.stg_asana__project_task", "model.asana_source.stg_asana__project", "model.asana_source.stg_asana__task_section", "model.asana_source.stg_asana__section"]}, "config": {"enabled": true, "alias": null, "schema": "asana", "database": null, "tags": [], "meta": {}, "materialized": "ephemeral", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "post-hook": [], "pre-hook": []}, "database": "postgres", "schema": "asana_integrations_tests_asana", "fqn": ["asana", "intermediate", "int_asana__task_projects"], "unique_id": "model.asana.int_asana__task_projects", "raw_code": "with task_project as (\n\n select * \n from {{ var('project_task') }}\n\n),\n\nproject as (\n \n select * \n from {{ var ('project') }}\n),\n\ntask_section as (\n\n select * \n from {{ var('task_section') }}\n\n),\n\nsection as (\n \n select * \n from {{ var ('section') }}\n\n),\n\ntask_project_section as (\n\n select \n task_project.task_id,\n project.project_name || (case when section.section_name = '(no section)' then ''\n else ': ' || section.section_name end) as project_section, \n project.project_id\n from\n task_project \n join project \n on project.project_id = task_project.project_id\n join task_section\n on task_section.task_id = task_project.task_id\n join section \n on section.section_id = task_section.section_id \n and section.project_id = project.project_id\n),\n\nagg_project_sections as (\n select \n task_id,\n {{ fivetran_utils.string_agg( 'task_project_section.project_section', \"', '\" )}} as projects_sections,\n count(project_id) as number_of_projects\n\n from task_project_section \n\n group by 1\n)\n\nselect * from agg_project_sections", "language": "sql", "package_name": "asana", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/asana", "path": "intermediate/int_asana__task_projects.sql", "original_file_path": "models/intermediate/int_asana__task_projects.sql", "name": "int_asana__task_projects", "alias": "int_asana__task_projects", "checksum": {"name": "sha256", "checksum": "fc36b507b9dba1840ad1d41d014cc5451ecb0c11c4e2043478f3ccf47d184aa2"}, "tags": [], "refs": [["stg_asana__project_task"], ["stg_asana__project"], ["stg_asana__task_section"], ["stg_asana__section"]], "sources": [], "metrics": [], "description": "Aggregates a count of and a list of the names of the projects and sections that each task belongs to.", "columns": {"task_id": {"name": "task_id", "description": "", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "asana://models/intermediate/intermediate_asana.yml", "compiled_path": "target/compiled/asana/models/intermediate/int_asana__task_projects.sql", "build_path": null, "deferred": false, "unrendered_config": {"schema": "asana", "materialized": "ephemeral"}, "created_at": 1671481804.7848508, "compiled_code": "with task_project as (\n\n select * \n from \"postgres\".\"asana_integrations_tests_stg_asana\".\"stg_asana__project_task\"\n\n),\n\nproject as (\n \n select * \n from \"postgres\".\"asana_integrations_tests_stg_asana\".\"stg_asana__project\"\n),\n\ntask_section as (\n\n select * \n from \"postgres\".\"asana_integrations_tests_stg_asana\".\"stg_asana__task_section\"\n\n),\n\nsection as (\n \n select * \n from \"postgres\".\"asana_integrations_tests_stg_asana\".\"stg_asana__section\"\n\n),\n\ntask_project_section as (\n\n select \n task_project.task_id,\n project.project_name || (case when section.section_name = '(no section)' then ''\n else ': ' || section.section_name end) as project_section, \n project.project_id\n from\n task_project \n join project \n on project.project_id = task_project.project_id\n join task_section\n on task_section.task_id = task_project.task_id\n join section \n on section.section_id = task_section.section_id \n and section.project_id = project.project_id\n),\n\nagg_project_sections as (\n select \n task_id,\n \n string_agg(task_project_section.project_section, ', ')\n\n as projects_sections,\n count(project_id) as number_of_projects\n\n from task_project_section \n\n group by 1\n)\n\nselect * from agg_project_sections", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null}, "model.asana.int_asana__task_assignee": {"compiled": true, "resource_type": "model", "depends_on": {"macros": [], "nodes": ["model.asana_source.stg_asana__task", "model.asana_source.stg_asana__user"]}, "config": {"enabled": true, "alias": null, "schema": "asana", "database": null, "tags": [], "meta": {}, "materialized": "ephemeral", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "post-hook": [], "pre-hook": []}, "database": "postgres", "schema": "asana_integrations_tests_asana", "fqn": ["asana", "intermediate", "int_asana__task_assignee"], "unique_id": "model.asana.int_asana__task_assignee", "raw_code": "with task as (\n\n select * \n from {{ var('task') }}\n\n),\n\nasana_user as (\n\n select *\n from {{ var('user') }}\n),\n\ntask_assignee as (\n\n select\n task.*,\n assignee_user_id is not null as has_assignee,\n asana_user.user_name as assignee_name,\n asana_user.email as assignee_email\n\n from task \n left join asana_user \n on task.assignee_user_id = asana_user.user_id\n)\n\nselect * from task_assignee", "language": "sql", "package_name": "asana", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/asana", "path": "intermediate/int_asana__task_assignee.sql", "original_file_path": "models/intermediate/int_asana__task_assignee.sql", "name": "int_asana__task_assignee", "alias": "int_asana__task_assignee", "checksum": {"name": "sha256", "checksum": "2dfff153566b1418a423d4275b9704e5d8b8c3a661be9e9babfc15aa4c5cead8"}, "tags": [], "refs": [["stg_asana__task"], ["stg_asana__user"]], "sources": [], "metrics": [], "description": "Combines tasks + information regarding their assigned user", "columns": {"task_id": {"name": "task_id", "description": "", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "asana://models/intermediate/intermediate_asana.yml", "compiled_path": "target/compiled/asana/models/intermediate/int_asana__task_assignee.sql", "build_path": null, "deferred": false, "unrendered_config": {"schema": "asana", "materialized": "ephemeral"}, "created_at": 1671481804.782397, "compiled_code": "with task as (\n\n select * \n from \"postgres\".\"asana_integrations_tests_stg_asana\".\"stg_asana__task\"\n\n),\n\nasana_user as (\n\n select *\n from \"postgres\".\"asana_integrations_tests_stg_asana\".\"stg_asana__user\"\n),\n\ntask_assignee as (\n\n select\n task.*,\n assignee_user_id is not null as has_assignee,\n asana_user.user_name as assignee_name,\n asana_user.email as assignee_email\n\n from task \n left join asana_user \n on task.assignee_user_id = asana_user.user_id\n)\n\nselect * from task_assignee", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null}, "model.asana.int_asana__subtask_parent": {"compiled": true, "resource_type": "model", "depends_on": {"macros": [], "nodes": ["model.asana.int_asana__task_assignee"]}, "config": {"enabled": true, "alias": null, "schema": "asana", "database": null, "tags": [], "meta": {}, "materialized": "ephemeral", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "post-hook": [], "pre-hook": []}, "database": "postgres", "schema": "asana_integrations_tests_asana", "fqn": ["asana", "intermediate", "int_asana__subtask_parent"], "unique_id": "model.asana.int_asana__subtask_parent", "raw_code": "with task_assignee as (\n\n select * \n from {{ ref('int_asana__task_assignee') }}\n\n),\n\n\nsubtask_parent as (\n\n select\n subtask.task_id as subtask_id,\n parent.task_id as parent_task_id,\n parent.task_name as parent_task_name,\n parent.due_date as parent_due_date,\n parent.created_at as parent_created_at,\n parent.assignee_user_id as parent_assignee_user_id,\n parent.assignee_name as parent_assignee_name\n\n from task_assignee as parent \n join task_assignee as subtask\n on parent.task_id = subtask.parent_task_id\n\n)\n\nselect * from subtask_parent", "language": "sql", "package_name": "asana", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/asana", "path": "intermediate/int_asana__subtask_parent.sql", "original_file_path": "models/intermediate/int_asana__subtask_parent.sql", "name": "int_asana__subtask_parent", "alias": "int_asana__subtask_parent", "checksum": {"name": "sha256", "checksum": "4abb15c88cfe83c53f5d4d97013d37d41689f4940b334b296b076eff5528b7b7"}, "tags": [], "refs": [["int_asana__task_assignee"]], "sources": [], "metrics": [], "description": "Combines subtasks + information regarding parent tasks", "columns": {"subtask_id": {"name": "subtask_id", "description": "", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "asana://models/intermediate/intermediate_asana.yml", "compiled_path": "target/compiled/asana/models/intermediate/int_asana__subtask_parent.sql", "build_path": null, "deferred": false, "unrendered_config": {"schema": "asana", "materialized": "ephemeral"}, "created_at": 1671481804.781982, "compiled_code": "with __dbt__cte__int_asana__task_assignee as (\nwith task as (\n\n select * \n from \"postgres\".\"asana_integrations_tests_stg_asana\".\"stg_asana__task\"\n\n),\n\nasana_user as (\n\n select *\n from \"postgres\".\"asana_integrations_tests_stg_asana\".\"stg_asana__user\"\n),\n\ntask_assignee as (\n\n select\n task.*,\n assignee_user_id is not null as has_assignee,\n asana_user.user_name as assignee_name,\n asana_user.email as assignee_email\n\n from task \n left join asana_user \n on task.assignee_user_id = asana_user.user_id\n)\n\nselect * from task_assignee\n),task_assignee as (\n\n select * \n from __dbt__cte__int_asana__task_assignee\n\n),\n\n\nsubtask_parent as (\n\n select\n subtask.task_id as subtask_id,\n parent.task_id as parent_task_id,\n parent.task_name as parent_task_name,\n parent.due_date as parent_due_date,\n parent.created_at as parent_created_at,\n parent.assignee_user_id as parent_assignee_user_id,\n parent.assignee_name as parent_assignee_name\n\n from task_assignee as parent \n join task_assignee as subtask\n on parent.task_id = subtask.parent_task_id\n\n)\n\nselect * from subtask_parent", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.asana.int_asana__task_assignee", "sql": " __dbt__cte__int_asana__task_assignee as (\nwith task as (\n\n select * \n from \"postgres\".\"asana_integrations_tests_stg_asana\".\"stg_asana__task\"\n\n),\n\nasana_user as (\n\n select *\n from \"postgres\".\"asana_integrations_tests_stg_asana\".\"stg_asana__user\"\n),\n\ntask_assignee as (\n\n select\n task.*,\n assignee_user_id is not null as has_assignee,\n asana_user.user_name as assignee_name,\n asana_user.email as assignee_email\n\n from task \n left join asana_user \n on task.assignee_user_id = asana_user.user_id\n)\n\nselect * from task_assignee\n)"}], "relation_name": null}, "model.asana.int_asana__task_story": {"compiled": true, "resource_type": "model", "depends_on": {"macros": [], "nodes": ["model.asana_source.stg_asana__story", "model.asana_source.stg_asana__user"]}, "config": {"enabled": true, "alias": null, "schema": "asana", "database": null, "tags": [], "meta": {}, "materialized": "ephemeral", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "post-hook": [], "pre-hook": []}, "database": "postgres", "schema": "asana_integrations_tests_asana", "fqn": ["asana", "intermediate", "int_asana__task_story"], "unique_id": "model.asana.int_asana__task_story", "raw_code": "with story as (\n \n select * \n from {{ var('story') }}\n\n),\n\nasana_user as (\n\n select * \n from {{ var('user') }}\n),\n\nstory_user as (\n select \n story.*,\n asana_user.user_name as created_by_name\n from story\n join asana_user \n on story.created_by_user_id = asana_user.user_id\n),\n\nsplit_comments as (\n\n select\n story_id,\n created_at,\n created_by_user_id,\n created_by_name,\n target_task_id,\n \n case when event_type = 'comment' then story_content \n else null end as comment_content,\n\n case when event_type = 'system' then story_content \n else 'comment' end as action_description\n \n from story_user\n\n),\n\n\n-- the next CTE uses this dictionary to parse the type of action out of the event descfription\n{% set actions = {\n 'added the name%': 'added name',\n 'changed the name%': 'changed name',\n 'removed the name': 'removed name',\n 'added the description%': 'added description',\n 'changed the description%': 'changed description',\n 'removed the description': 'removed description',\n 'added to%': 'added to project',\n 'removed from%': 'removed from project',\n 'assigned%': 'assigned',\n 'unassigned%': 'unassigned',\n 'changed the due date%': 'changed due date', \n 'changed the start date%due date%': 'changed due date',\n 'changed the start date%': 'changed start date',\n 'removed the due date%': 'removed due date',\n 'removed the date range%': 'removed due date',\n 'removed the start date': 'removed start date',\n 'added subtask%': 'added subtask',\n 'added%collaborator%': 'added collaborator',\n 'moved%': 'moved to section',\n 'duplicated task from%': 'duplicated this from other task',\n 'marked%as a duplicate of this': 'marked other task as duplicate of this',\n 'marked this a duplicate of%': 'marked as duplicate',\n 'marked this task complete': 'completed',\n 'completed this task': 'completed',\n 'marked incomplete': 'marked incomplete',\n 'marked this task as a milestone': 'marked as milestone',\n 'unmarked this task as a milestone': 'unmarked as milestone',\n 'marked this milestone complete': 'completed milestone',\n 'completed this milestone': 'completed milestone',\n 'attached%': 'attachment',\n 'liked your comment': 'liked comment',\n 'liked this task': 'liked task',\n 'liked your attachment': 'liked attachment',\n 'liked that you completed this task': 'liked completion',\n 'completed the last task you were waiting on%': 'completed dependency',\n 'added feedback to%': 'added feedback',\n 'changed%to%': 'changed tag',\n 'cleared%': 'cleared tag',\n 'comment': 'comment',\n \"have a task due on%\": null \n\n} %}\n\nparse_actions as (\n select\n story_id,\n target_task_id,\n created_at,\n created_by_user_id,\n created_by_name,\n comment_content,\n case \n {%- for key, value in actions.items() %} \n when action_description like '{{key}}' then '{{value}}' \n {%- endfor %}\n else action_description end as action_taken,\n action_description\n \n from split_comments\n\n),\n\n\nfinal as (\n \n select * \n from parse_actions\n\n -- remove actions you don't care about (set to null in the actions dictionary above)\n where action_taken is not null \n\n)\n\n\nselect * from final", "language": "sql", "package_name": "asana", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/asana", "path": "intermediate/int_asana__task_story.sql", "original_file_path": "models/intermediate/int_asana__task_story.sql", "name": "int_asana__task_story", "alias": "int_asana__task_story", "checksum": {"name": "sha256", "checksum": "805d894194316cd83e1d8545a98c05a3b63d808f0bdf342160be47c79c05f6e9"}, "tags": [], "refs": [["stg_asana__story"], ["stg_asana__user"]], "sources": [], "metrics": [], "description": "Parses and categorizes asana stories into action types. Useful for looking at individual-task histories", "columns": {"story_id": {"name": "story_id", "description": "", "meta": {}, "data_type": null, "quote": null, "tags": []}, "action_taken": {"name": "action_taken", "description": "The bucket that the story event falls into.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "comment_content": {"name": "comment_content", "description": "If the action taken is a comment, this is the comment's text. Otherwise null.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "action_description": {"name": "action_description", "description": "The original pre-categorized content of the story", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "asana://models/intermediate/intermediate_asana.yml", "compiled_path": "target/compiled/asana/models/intermediate/int_asana__task_story.sql", "build_path": null, "deferred": false, "unrendered_config": {"schema": "asana", "materialized": "ephemeral"}, "created_at": 1671481804.785686, "compiled_code": "with story as (\n \n select * \n from \"postgres\".\"asana_integrations_tests_stg_asana\".\"stg_asana__story\"\n\n),\n\nasana_user as (\n\n select * \n from \"postgres\".\"asana_integrations_tests_stg_asana\".\"stg_asana__user\"\n),\n\nstory_user as (\n select \n story.*,\n asana_user.user_name as created_by_name\n from story\n join asana_user \n on story.created_by_user_id = asana_user.user_id\n),\n\nsplit_comments as (\n\n select\n story_id,\n created_at,\n created_by_user_id,\n created_by_name,\n target_task_id,\n \n case when event_type = 'comment' then story_content \n else null end as comment_content,\n\n case when event_type = 'system' then story_content \n else 'comment' end as action_description\n \n from story_user\n\n),\n\n\n-- the next CTE uses this dictionary to parse the type of action out of the event descfription\n\n\nparse_actions as (\n select\n story_id,\n target_task_id,\n created_at,\n created_by_user_id,\n created_by_name,\n comment_content,\n case \n when action_description like 'added the name%' then 'added name' \n when action_description like 'changed the name%' then 'changed name' \n when action_description like 'removed the name' then 'removed name' \n when action_description like 'added the description%' then 'added description' \n when action_description like 'changed the description%' then 'changed description' \n when action_description like 'removed the description' then 'removed description' \n when action_description like 'added to%' then 'added to project' \n when action_description like 'removed from%' then 'removed from project' \n when action_description like 'assigned%' then 'assigned' \n when action_description like 'unassigned%' then 'unassigned' \n when action_description like 'changed the due date%' then 'changed due date' \n when action_description like 'changed the start date%due date%' then 'changed due date' \n when action_description like 'changed the start date%' then 'changed start date' \n when action_description like 'removed the due date%' then 'removed due date' \n when action_description like 'removed the date range%' then 'removed due date' \n when action_description like 'removed the start date' then 'removed start date' \n when action_description like 'added subtask%' then 'added subtask' \n when action_description like 'added%collaborator%' then 'added collaborator' \n when action_description like 'moved%' then 'moved to section' \n when action_description like 'duplicated task from%' then 'duplicated this from other task' \n when action_description like 'marked%as a duplicate of this' then 'marked other task as duplicate of this' \n when action_description like 'marked this a duplicate of%' then 'marked as duplicate' \n when action_description like 'marked this task complete' then 'completed' \n when action_description like 'completed this task' then 'completed' \n when action_description like 'marked incomplete' then 'marked incomplete' \n when action_description like 'marked this task as a milestone' then 'marked as milestone' \n when action_description like 'unmarked this task as a milestone' then 'unmarked as milestone' \n when action_description like 'marked this milestone complete' then 'completed milestone' \n when action_description like 'completed this milestone' then 'completed milestone' \n when action_description like 'attached%' then 'attachment' \n when action_description like 'liked your comment' then 'liked comment' \n when action_description like 'liked this task' then 'liked task' \n when action_description like 'liked your attachment' then 'liked attachment' \n when action_description like 'liked that you completed this task' then 'liked completion' \n when action_description like 'completed the last task you were waiting on%' then 'completed dependency' \n when action_description like 'added feedback to%' then 'added feedback' \n when action_description like 'changed%to%' then 'changed tag' \n when action_description like 'cleared%' then 'cleared tag' \n when action_description like 'comment' then 'comment' \n when action_description like 'have a task due on%' then ''\n else action_description end as action_taken,\n action_description\n \n from split_comments\n\n),\n\n\nfinal as (\n \n select * \n from parse_actions\n\n -- remove actions you don't care about (set to null in the actions dictionary above)\n where action_taken is not null \n\n)\n\n\nselect * from final", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null}, "test.asana_source.unique_stg_asana__project_project_id.67bfab1228": {"test_metadata": {"name": "unique", "kwargs": {"column_name": "project_id", "model": "{{ get_where_subquery(ref('stg_asana__project')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["model.asana_source.stg_asana__project"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "postgres", "schema": "asana_integrations_tests_dbt_test__audit", "fqn": ["asana_source", "unique_stg_asana__project_project_id"], "unique_id": "test.asana_source.unique_stg_asana__project_project_id.67bfab1228", "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "language": "sql", "package_name": "asana_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/asana_source", "path": "unique_stg_asana__project_project_id.sql", "original_file_path": "models/stg_asana.yml", "name": "unique_stg_asana__project_project_id", "alias": "unique_stg_asana__project_project_id", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["stg_asana__project"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/asana_source/models/stg_asana.yml/unique_stg_asana__project_project_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1671481804.705333, "compiled_code": "\n \n \n\nselect\n project_id as unique_field,\n count(*) as n_records\n\nfrom \"postgres\".\"asana_integrations_tests_stg_asana\".\"stg_asana__project\"\nwhere project_id is not null\ngroup by project_id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "project_id", "file_key_name": "models.stg_asana__project"}, "test.asana_source.not_null_stg_asana__project_project_id.d27dae84fa": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "project_id", "model": "{{ get_where_subquery(ref('stg_asana__project')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.asana_source.stg_asana__project"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "postgres", "schema": "asana_integrations_tests_dbt_test__audit", "fqn": ["asana_source", "not_null_stg_asana__project_project_id"], "unique_id": "test.asana_source.not_null_stg_asana__project_project_id.d27dae84fa", "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "package_name": "asana_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/asana_source", "path": "not_null_stg_asana__project_project_id.sql", "original_file_path": "models/stg_asana.yml", "name": "not_null_stg_asana__project_project_id", "alias": "not_null_stg_asana__project_project_id", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["stg_asana__project"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/asana_source/models/stg_asana.yml/not_null_stg_asana__project_project_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1671481804.706469, "compiled_code": "\n \n \n\n\n\nselect project_id\nfrom \"postgres\".\"asana_integrations_tests_stg_asana\".\"stg_asana__project\"\nwhere project_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "project_id", "file_key_name": "models.stg_asana__project"}, "test.asana_source.not_null_stg_asana__project_task_project_id.e2450d16b1": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "project_id", "model": "{{ get_where_subquery(ref('stg_asana__project_task')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.asana_source.stg_asana__project_task"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "postgres", "schema": "asana_integrations_tests_dbt_test__audit", "fqn": ["asana_source", "not_null_stg_asana__project_task_project_id"], "unique_id": "test.asana_source.not_null_stg_asana__project_task_project_id.e2450d16b1", "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "package_name": "asana_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/asana_source", "path": "not_null_stg_asana__project_task_project_id.sql", "original_file_path": "models/stg_asana.yml", "name": "not_null_stg_asana__project_task_project_id", "alias": "not_null_stg_asana__project_task_project_id", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["stg_asana__project_task"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/asana_source/models/stg_asana.yml/not_null_stg_asana__project_task_project_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1671481804.7074828, "compiled_code": "\n \n \n\n\n\nselect project_id\nfrom \"postgres\".\"asana_integrations_tests_stg_asana\".\"stg_asana__project_task\"\nwhere project_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "project_id", "file_key_name": "models.stg_asana__project_task"}, "test.asana_source.not_null_stg_asana__project_task_task_id.9479566014": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "task_id", "model": "{{ get_where_subquery(ref('stg_asana__project_task')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.asana_source.stg_asana__project_task"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "postgres", "schema": "asana_integrations_tests_dbt_test__audit", "fqn": ["asana_source", "not_null_stg_asana__project_task_task_id"], "unique_id": "test.asana_source.not_null_stg_asana__project_task_task_id.9479566014", "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "package_name": "asana_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/asana_source", "path": "not_null_stg_asana__project_task_task_id.sql", "original_file_path": "models/stg_asana.yml", "name": "not_null_stg_asana__project_task_task_id", "alias": "not_null_stg_asana__project_task_task_id", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["stg_asana__project_task"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/asana_source/models/stg_asana.yml/not_null_stg_asana__project_task_task_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1671481804.7084851, "compiled_code": "\n \n \n\n\n\nselect task_id\nfrom \"postgres\".\"asana_integrations_tests_stg_asana\".\"stg_asana__project_task\"\nwhere task_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "task_id", "file_key_name": "models.stg_asana__project_task"}, "test.asana_source.unique_stg_asana__section_section_id.0495dd3d2f": {"test_metadata": {"name": "unique", "kwargs": {"column_name": "section_id", "model": "{{ get_where_subquery(ref('stg_asana__section')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["model.asana_source.stg_asana__section"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "postgres", "schema": "asana_integrations_tests_dbt_test__audit", "fqn": ["asana_source", "unique_stg_asana__section_section_id"], "unique_id": "test.asana_source.unique_stg_asana__section_section_id.0495dd3d2f", "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "language": "sql", "package_name": "asana_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/asana_source", "path": "unique_stg_asana__section_section_id.sql", "original_file_path": "models/stg_asana.yml", "name": "unique_stg_asana__section_section_id", "alias": "unique_stg_asana__section_section_id", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["stg_asana__section"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/asana_source/models/stg_asana.yml/unique_stg_asana__section_section_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1671481804.709621, "compiled_code": "\n \n \n\nselect\n section_id as unique_field,\n count(*) as n_records\n\nfrom \"postgres\".\"asana_integrations_tests_stg_asana\".\"stg_asana__section\"\nwhere section_id is not null\ngroup by section_id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "section_id", "file_key_name": "models.stg_asana__section"}, "test.asana_source.not_null_stg_asana__section_section_id.389ebce958": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "section_id", "model": "{{ get_where_subquery(ref('stg_asana__section')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.asana_source.stg_asana__section"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "postgres", "schema": "asana_integrations_tests_dbt_test__audit", "fqn": ["asana_source", "not_null_stg_asana__section_section_id"], "unique_id": "test.asana_source.not_null_stg_asana__section_section_id.389ebce958", "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "package_name": "asana_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/asana_source", "path": "not_null_stg_asana__section_section_id.sql", "original_file_path": "models/stg_asana.yml", "name": "not_null_stg_asana__section_section_id", "alias": "not_null_stg_asana__section_section_id", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["stg_asana__section"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/asana_source/models/stg_asana.yml/not_null_stg_asana__section_section_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1671481804.710597, "compiled_code": "\n \n \n\n\n\nselect section_id\nfrom \"postgres\".\"asana_integrations_tests_stg_asana\".\"stg_asana__section\"\nwhere section_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "section_id", "file_key_name": "models.stg_asana__section"}, "test.asana_source.unique_stg_asana__story_story_id.414f25bb84": {"test_metadata": {"name": "unique", "kwargs": {"column_name": "story_id", "model": "{{ get_where_subquery(ref('stg_asana__story')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["model.asana_source.stg_asana__story"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "postgres", "schema": "asana_integrations_tests_dbt_test__audit", "fqn": ["asana_source", "unique_stg_asana__story_story_id"], "unique_id": "test.asana_source.unique_stg_asana__story_story_id.414f25bb84", "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "language": "sql", "package_name": "asana_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/asana_source", "path": "unique_stg_asana__story_story_id.sql", "original_file_path": "models/stg_asana.yml", "name": "unique_stg_asana__story_story_id", "alias": "unique_stg_asana__story_story_id", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["stg_asana__story"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/asana_source/models/stg_asana.yml/unique_stg_asana__story_story_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1671481804.711582, "compiled_code": "\n \n \n\nselect\n story_id as unique_field,\n count(*) as n_records\n\nfrom \"postgres\".\"asana_integrations_tests_stg_asana\".\"stg_asana__story\"\nwhere story_id is not null\ngroup by story_id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "story_id", "file_key_name": "models.stg_asana__story"}, "test.asana_source.not_null_stg_asana__story_story_id.ca847d0848": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "story_id", "model": "{{ get_where_subquery(ref('stg_asana__story')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.asana_source.stg_asana__story"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "postgres", "schema": "asana_integrations_tests_dbt_test__audit", "fqn": ["asana_source", "not_null_stg_asana__story_story_id"], "unique_id": "test.asana_source.not_null_stg_asana__story_story_id.ca847d0848", "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "package_name": "asana_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/asana_source", "path": "not_null_stg_asana__story_story_id.sql", "original_file_path": "models/stg_asana.yml", "name": "not_null_stg_asana__story_story_id", "alias": "not_null_stg_asana__story_story_id", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["stg_asana__story"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/asana_source/models/stg_asana.yml/not_null_stg_asana__story_story_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1671481804.712577, "compiled_code": "\n \n \n\n\n\nselect story_id\nfrom \"postgres\".\"asana_integrations_tests_stg_asana\".\"stg_asana__story\"\nwhere story_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "story_id", "file_key_name": "models.stg_asana__story"}, "test.asana_source.not_null_stg_asana__story_target_task_id.3f971de06e": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "target_task_id", "model": "{{ get_where_subquery(ref('stg_asana__story')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.asana_source.stg_asana__story"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "postgres", "schema": "asana_integrations_tests_dbt_test__audit", "fqn": ["asana_source", "not_null_stg_asana__story_target_task_id"], "unique_id": "test.asana_source.not_null_stg_asana__story_target_task_id.3f971de06e", "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "package_name": "asana_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/asana_source", "path": "not_null_stg_asana__story_target_task_id.sql", "original_file_path": "models/stg_asana.yml", "name": "not_null_stg_asana__story_target_task_id", "alias": "not_null_stg_asana__story_target_task_id", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["stg_asana__story"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/asana_source/models/stg_asana.yml/not_null_stg_asana__story_target_task_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1671481804.714041, "compiled_code": "\n \n \n\n\n\nselect target_task_id\nfrom \"postgres\".\"asana_integrations_tests_stg_asana\".\"stg_asana__story\"\nwhere target_task_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "target_task_id", "file_key_name": "models.stg_asana__story"}, "test.asana_source.unique_stg_asana__tag_tag_id.fd78b190c7": {"test_metadata": {"name": "unique", "kwargs": {"column_name": "tag_id", "model": "{{ get_where_subquery(ref('stg_asana__tag')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["model.asana_source.stg_asana__tag"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "postgres", "schema": "asana_integrations_tests_dbt_test__audit", "fqn": ["asana_source", "unique_stg_asana__tag_tag_id"], "unique_id": "test.asana_source.unique_stg_asana__tag_tag_id.fd78b190c7", "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "language": "sql", "package_name": "asana_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/asana_source", "path": "unique_stg_asana__tag_tag_id.sql", "original_file_path": "models/stg_asana.yml", "name": "unique_stg_asana__tag_tag_id", "alias": "unique_stg_asana__tag_tag_id", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["stg_asana__tag"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/asana_source/models/stg_asana.yml/unique_stg_asana__tag_tag_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1671481804.71502, "compiled_code": "\n \n \n\nselect\n tag_id as unique_field,\n count(*) as n_records\n\nfrom \"postgres\".\"asana_integrations_tests_stg_asana\".\"stg_asana__tag\"\nwhere tag_id is not null\ngroup by tag_id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "tag_id", "file_key_name": "models.stg_asana__tag"}, "test.asana_source.not_null_stg_asana__tag_tag_id.c6a8187ca2": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "tag_id", "model": "{{ get_where_subquery(ref('stg_asana__tag')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.asana_source.stg_asana__tag"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "postgres", "schema": "asana_integrations_tests_dbt_test__audit", "fqn": ["asana_source", "not_null_stg_asana__tag_tag_id"], "unique_id": "test.asana_source.not_null_stg_asana__tag_tag_id.c6a8187ca2", "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "package_name": "asana_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/asana_source", "path": "not_null_stg_asana__tag_tag_id.sql", "original_file_path": "models/stg_asana.yml", "name": "not_null_stg_asana__tag_tag_id", "alias": "not_null_stg_asana__tag_tag_id", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["stg_asana__tag"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/asana_source/models/stg_asana.yml/not_null_stg_asana__tag_tag_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1671481804.716008, "compiled_code": "\n \n \n\n\n\nselect tag_id\nfrom \"postgres\".\"asana_integrations_tests_stg_asana\".\"stg_asana__tag\"\nwhere tag_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "tag_id", "file_key_name": "models.stg_asana__tag"}, "test.asana_source.unique_stg_asana__task_task_id.a5271275a5": {"test_metadata": {"name": "unique", "kwargs": {"column_name": "task_id", "model": "{{ get_where_subquery(ref('stg_asana__task')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["model.asana_source.stg_asana__task"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "postgres", "schema": "asana_integrations_tests_dbt_test__audit", "fqn": ["asana_source", "unique_stg_asana__task_task_id"], "unique_id": "test.asana_source.unique_stg_asana__task_task_id.a5271275a5", "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "language": "sql", "package_name": "asana_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/asana_source", "path": "unique_stg_asana__task_task_id.sql", "original_file_path": "models/stg_asana.yml", "name": "unique_stg_asana__task_task_id", "alias": "unique_stg_asana__task_task_id", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["stg_asana__task"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/asana_source/models/stg_asana.yml/unique_stg_asana__task_task_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1671481804.717099, "compiled_code": "\n \n \n\nselect\n task_id as unique_field,\n count(*) as n_records\n\nfrom \"postgres\".\"asana_integrations_tests_stg_asana\".\"stg_asana__task\"\nwhere task_id is not null\ngroup by task_id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "task_id", "file_key_name": "models.stg_asana__task"}, "test.asana_source.not_null_stg_asana__task_task_id.924cc69000": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "task_id", "model": "{{ get_where_subquery(ref('stg_asana__task')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.asana_source.stg_asana__task"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "postgres", "schema": "asana_integrations_tests_dbt_test__audit", "fqn": ["asana_source", "not_null_stg_asana__task_task_id"], "unique_id": "test.asana_source.not_null_stg_asana__task_task_id.924cc69000", "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "package_name": "asana_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/asana_source", "path": "not_null_stg_asana__task_task_id.sql", "original_file_path": "models/stg_asana.yml", "name": "not_null_stg_asana__task_task_id", "alias": "not_null_stg_asana__task_task_id", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["stg_asana__task"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/asana_source/models/stg_asana.yml/not_null_stg_asana__task_task_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1671481804.718245, "compiled_code": "\n \n \n\n\n\nselect task_id\nfrom \"postgres\".\"asana_integrations_tests_stg_asana\".\"stg_asana__task\"\nwhere task_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "task_id", "file_key_name": "models.stg_asana__task"}, "test.asana_source.not_null_stg_asana__task_follower_task_id.5af35f322c": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "task_id", "model": "{{ get_where_subquery(ref('stg_asana__task_follower')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.asana_source.stg_asana__task_follower"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "postgres", "schema": "asana_integrations_tests_dbt_test__audit", "fqn": ["asana_source", "not_null_stg_asana__task_follower_task_id"], "unique_id": "test.asana_source.not_null_stg_asana__task_follower_task_id.5af35f322c", "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "package_name": "asana_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/asana_source", "path": "not_null_stg_asana__task_follower_task_id.sql", "original_file_path": "models/stg_asana.yml", "name": "not_null_stg_asana__task_follower_task_id", "alias": "not_null_stg_asana__task_follower_task_id", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["stg_asana__task_follower"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/asana_source/models/stg_asana.yml/not_null_stg_asana__task_follower_task_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1671481804.719262, "compiled_code": "\n \n \n\n\n\nselect task_id\nfrom \"postgres\".\"asana_integrations_tests_stg_asana\".\"stg_asana__task_follower\"\nwhere task_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "task_id", "file_key_name": "models.stg_asana__task_follower"}, "test.asana_source.not_null_stg_asana__task_follower_user_id.e0aea0b15e": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "user_id", "model": "{{ get_where_subquery(ref('stg_asana__task_follower')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.asana_source.stg_asana__task_follower"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "postgres", "schema": "asana_integrations_tests_dbt_test__audit", "fqn": ["asana_source", "not_null_stg_asana__task_follower_user_id"], "unique_id": "test.asana_source.not_null_stg_asana__task_follower_user_id.e0aea0b15e", "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "package_name": "asana_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/asana_source", "path": "not_null_stg_asana__task_follower_user_id.sql", "original_file_path": "models/stg_asana.yml", "name": "not_null_stg_asana__task_follower_user_id", "alias": "not_null_stg_asana__task_follower_user_id", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["stg_asana__task_follower"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/asana_source/models/stg_asana.yml/not_null_stg_asana__task_follower_user_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1671481804.720255, "compiled_code": "\n \n \n\n\n\nselect user_id\nfrom \"postgres\".\"asana_integrations_tests_stg_asana\".\"stg_asana__task_follower\"\nwhere user_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "user_id", "file_key_name": "models.stg_asana__task_follower"}, "test.asana_source.not_null_stg_asana__task_section_task_id.ab81301de8": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "task_id", "model": "{{ get_where_subquery(ref('stg_asana__task_section')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.asana_source.stg_asana__task_section"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "postgres", "schema": "asana_integrations_tests_dbt_test__audit", "fqn": ["asana_source", "not_null_stg_asana__task_section_task_id"], "unique_id": "test.asana_source.not_null_stg_asana__task_section_task_id.ab81301de8", "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "package_name": "asana_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/asana_source", "path": "not_null_stg_asana__task_section_task_id.sql", "original_file_path": "models/stg_asana.yml", "name": "not_null_stg_asana__task_section_task_id", "alias": "not_null_stg_asana__task_section_task_id", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["stg_asana__task_section"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/asana_source/models/stg_asana.yml/not_null_stg_asana__task_section_task_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1671481804.72125, "compiled_code": "\n \n \n\n\n\nselect task_id\nfrom \"postgres\".\"asana_integrations_tests_stg_asana\".\"stg_asana__task_section\"\nwhere task_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "task_id", "file_key_name": "models.stg_asana__task_section"}, "test.asana_source.not_null_stg_asana__task_section_section_id.b0977a4cfe": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "section_id", "model": "{{ get_where_subquery(ref('stg_asana__task_section')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.asana_source.stg_asana__task_section"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "postgres", "schema": "asana_integrations_tests_dbt_test__audit", "fqn": ["asana_source", "not_null_stg_asana__task_section_section_id"], "unique_id": "test.asana_source.not_null_stg_asana__task_section_section_id.b0977a4cfe", "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "package_name": "asana_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/asana_source", "path": "not_null_stg_asana__task_section_section_id.sql", "original_file_path": "models/stg_asana.yml", "name": "not_null_stg_asana__task_section_section_id", "alias": "not_null_stg_asana__task_section_section_id", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["stg_asana__task_section"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/asana_source/models/stg_asana.yml/not_null_stg_asana__task_section_section_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1671481804.722367, "compiled_code": "\n \n \n\n\n\nselect section_id\nfrom \"postgres\".\"asana_integrations_tests_stg_asana\".\"stg_asana__task_section\"\nwhere section_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "section_id", "file_key_name": "models.stg_asana__task_section"}, "test.asana_source.not_null_stg_asana__task_tag_tag_id.d523de41d8": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "tag_id", "model": "{{ get_where_subquery(ref('stg_asana__task_tag')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.asana_source.stg_asana__task_tag"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "postgres", "schema": "asana_integrations_tests_dbt_test__audit", "fqn": ["asana_source", "not_null_stg_asana__task_tag_tag_id"], "unique_id": "test.asana_source.not_null_stg_asana__task_tag_tag_id.d523de41d8", "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "package_name": "asana_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/asana_source", "path": "not_null_stg_asana__task_tag_tag_id.sql", "original_file_path": "models/stg_asana.yml", "name": "not_null_stg_asana__task_tag_tag_id", "alias": "not_null_stg_asana__task_tag_tag_id", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["stg_asana__task_tag"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/asana_source/models/stg_asana.yml/not_null_stg_asana__task_tag_tag_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1671481804.723398, "compiled_code": "\n \n \n\n\n\nselect tag_id\nfrom \"postgres\".\"asana_integrations_tests_stg_asana\".\"stg_asana__task_tag\"\nwhere tag_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "tag_id", "file_key_name": "models.stg_asana__task_tag"}, "test.asana_source.not_null_stg_asana__task_tag_task_id.9d27624748": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "task_id", "model": "{{ get_where_subquery(ref('stg_asana__task_tag')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.asana_source.stg_asana__task_tag"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "postgres", "schema": "asana_integrations_tests_dbt_test__audit", "fqn": ["asana_source", "not_null_stg_asana__task_tag_task_id"], "unique_id": "test.asana_source.not_null_stg_asana__task_tag_task_id.9d27624748", "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "package_name": "asana_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/asana_source", "path": "not_null_stg_asana__task_tag_task_id.sql", "original_file_path": "models/stg_asana.yml", "name": "not_null_stg_asana__task_tag_task_id", "alias": "not_null_stg_asana__task_tag_task_id", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["stg_asana__task_tag"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/asana_source/models/stg_asana.yml/not_null_stg_asana__task_tag_task_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1671481804.724459, "compiled_code": "\n \n \n\n\n\nselect task_id\nfrom \"postgres\".\"asana_integrations_tests_stg_asana\".\"stg_asana__task_tag\"\nwhere task_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "task_id", "file_key_name": "models.stg_asana__task_tag"}, "test.asana_source.unique_stg_asana__team_team_id.111fe15873": {"test_metadata": {"name": "unique", "kwargs": {"column_name": "team_id", "model": "{{ get_where_subquery(ref('stg_asana__team')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["model.asana_source.stg_asana__team"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "postgres", "schema": "asana_integrations_tests_dbt_test__audit", "fqn": ["asana_source", "unique_stg_asana__team_team_id"], "unique_id": "test.asana_source.unique_stg_asana__team_team_id.111fe15873", "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "language": "sql", "package_name": "asana_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/asana_source", "path": "unique_stg_asana__team_team_id.sql", "original_file_path": "models/stg_asana.yml", "name": "unique_stg_asana__team_team_id", "alias": "unique_stg_asana__team_team_id", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["stg_asana__team"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/asana_source/models/stg_asana.yml/unique_stg_asana__team_team_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1671481804.7254899, "compiled_code": "\n \n \n\nselect\n team_id as unique_field,\n count(*) as n_records\n\nfrom \"postgres\".\"asana_integrations_tests_stg_asana\".\"stg_asana__team\"\nwhere team_id is not null\ngroup by team_id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "team_id", "file_key_name": "models.stg_asana__team"}, "test.asana_source.not_null_stg_asana__team_team_id.e12b563474": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "team_id", "model": "{{ get_where_subquery(ref('stg_asana__team')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.asana_source.stg_asana__team"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "postgres", "schema": "asana_integrations_tests_dbt_test__audit", "fqn": ["asana_source", "not_null_stg_asana__team_team_id"], "unique_id": "test.asana_source.not_null_stg_asana__team_team_id.e12b563474", "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "package_name": "asana_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/asana_source", "path": "not_null_stg_asana__team_team_id.sql", "original_file_path": "models/stg_asana.yml", "name": "not_null_stg_asana__team_team_id", "alias": "not_null_stg_asana__team_team_id", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["stg_asana__team"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/asana_source/models/stg_asana.yml/not_null_stg_asana__team_team_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1671481804.726607, "compiled_code": "\n \n \n\n\n\nselect team_id\nfrom \"postgres\".\"asana_integrations_tests_stg_asana\".\"stg_asana__team\"\nwhere team_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "team_id", "file_key_name": "models.stg_asana__team"}, "test.asana_source.unique_stg_asana__user_user_id.73808d6267": {"test_metadata": {"name": "unique", "kwargs": {"column_name": "user_id", "model": "{{ get_where_subquery(ref('stg_asana__user')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["model.asana_source.stg_asana__user"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "postgres", "schema": "asana_integrations_tests_dbt_test__audit", "fqn": ["asana_source", "unique_stg_asana__user_user_id"], "unique_id": "test.asana_source.unique_stg_asana__user_user_id.73808d6267", "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "language": "sql", "package_name": "asana_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/asana_source", "path": "unique_stg_asana__user_user_id.sql", "original_file_path": "models/stg_asana.yml", "name": "unique_stg_asana__user_user_id", "alias": "unique_stg_asana__user_user_id", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["stg_asana__user"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/asana_source/models/stg_asana.yml/unique_stg_asana__user_user_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1671481804.7275898, "compiled_code": "\n \n \n\nselect\n user_id as unique_field,\n count(*) as n_records\n\nfrom \"postgres\".\"asana_integrations_tests_stg_asana\".\"stg_asana__user\"\nwhere user_id is not null\ngroup by user_id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "user_id", "file_key_name": "models.stg_asana__user"}, "test.asana_source.not_null_stg_asana__user_user_id.4e900e8ec6": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "user_id", "model": "{{ get_where_subquery(ref('stg_asana__user')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.asana_source.stg_asana__user"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "postgres", "schema": "asana_integrations_tests_dbt_test__audit", "fqn": ["asana_source", "not_null_stg_asana__user_user_id"], "unique_id": "test.asana_source.not_null_stg_asana__user_user_id.4e900e8ec6", "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "package_name": "asana_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/asana_source", "path": "not_null_stg_asana__user_user_id.sql", "original_file_path": "models/stg_asana.yml", "name": "not_null_stg_asana__user_user_id", "alias": "not_null_stg_asana__user_user_id", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["stg_asana__user"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/asana_source/models/stg_asana.yml/not_null_stg_asana__user_user_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1671481804.728582, "compiled_code": "\n \n \n\n\n\nselect user_id\nfrom \"postgres\".\"asana_integrations_tests_stg_asana\".\"stg_asana__user\"\nwhere user_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "user_id", "file_key_name": "models.stg_asana__user"}, "test.asana.unique_asana__task_task_id.ebfe331df1": {"test_metadata": {"name": "unique", "kwargs": {"column_name": "task_id", "model": "{{ get_where_subquery(ref('asana__task')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["model.asana.asana__task"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "postgres", "schema": "asana_integrations_tests_dbt_test__audit", "fqn": ["asana", "unique_asana__task_task_id"], "unique_id": "test.asana.unique_asana__task_task_id.ebfe331df1", "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "language": "sql", "package_name": "asana", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/asana", "path": "unique_asana__task_task_id.sql", "original_file_path": "models/asana.yml", "name": "unique_asana__task_task_id", "alias": "unique_asana__task_task_id", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["asana__task"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/asana/models/asana.yml/unique_asana__task_task_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1671481804.768041, "compiled_code": "\n \n \n\nselect\n task_id as unique_field,\n count(*) as n_records\n\nfrom \"postgres\".\"asana_integrations_tests_asana\".\"asana__task\"\nwhere task_id is not null\ngroup by task_id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "task_id", "file_key_name": "models.asana__task"}, "test.asana.not_null_asana__task_task_id.6d36eb2cd0": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "task_id", "model": "{{ get_where_subquery(ref('asana__task')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.asana.asana__task"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "postgres", "schema": "asana_integrations_tests_dbt_test__audit", "fqn": ["asana", "not_null_asana__task_task_id"], "unique_id": "test.asana.not_null_asana__task_task_id.6d36eb2cd0", "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "package_name": "asana", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/asana", "path": "not_null_asana__task_task_id.sql", "original_file_path": "models/asana.yml", "name": "not_null_asana__task_task_id", "alias": "not_null_asana__task_task_id", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["asana__task"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/asana/models/asana.yml/not_null_asana__task_task_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1671481804.769321, "compiled_code": "\n \n \n\n\n\nselect task_id\nfrom \"postgres\".\"asana_integrations_tests_asana\".\"asana__task\"\nwhere task_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "task_id", "file_key_name": "models.asana__task"}, "test.asana.unique_asana__user_user_id.3c4b63387e": {"test_metadata": {"name": "unique", "kwargs": {"column_name": "user_id", "model": "{{ get_where_subquery(ref('asana__user')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["model.asana.asana__user"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "postgres", "schema": "asana_integrations_tests_dbt_test__audit", "fqn": ["asana", "unique_asana__user_user_id"], "unique_id": "test.asana.unique_asana__user_user_id.3c4b63387e", "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "language": "sql", "package_name": "asana", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/asana", "path": "unique_asana__user_user_id.sql", "original_file_path": "models/asana.yml", "name": "unique_asana__user_user_id", "alias": "unique_asana__user_user_id", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["asana__user"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/asana/models/asana.yml/unique_asana__user_user_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1671481804.770425, "compiled_code": "\n \n \n\nselect\n user_id as unique_field,\n count(*) as n_records\n\nfrom \"postgres\".\"asana_integrations_tests_asana\".\"asana__user\"\nwhere user_id is not null\ngroup by user_id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "user_id", "file_key_name": "models.asana__user"}, "test.asana.not_null_asana__user_user_id.eb9cd93a43": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "user_id", "model": "{{ get_where_subquery(ref('asana__user')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.asana.asana__user"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "postgres", "schema": "asana_integrations_tests_dbt_test__audit", "fqn": ["asana", "not_null_asana__user_user_id"], "unique_id": "test.asana.not_null_asana__user_user_id.eb9cd93a43", "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "package_name": "asana", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/asana", "path": "not_null_asana__user_user_id.sql", "original_file_path": "models/asana.yml", "name": "not_null_asana__user_user_id", "alias": "not_null_asana__user_user_id", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["asana__user"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/asana/models/asana.yml/not_null_asana__user_user_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1671481804.771478, "compiled_code": "\n \n \n\n\n\nselect user_id\nfrom \"postgres\".\"asana_integrations_tests_asana\".\"asana__user\"\nwhere user_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "user_id", "file_key_name": "models.asana__user"}, "test.asana.unique_asana__project_project_id.66a76364ef": {"test_metadata": {"name": "unique", "kwargs": {"column_name": "project_id", "model": "{{ get_where_subquery(ref('asana__project')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["model.asana.asana__project"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "postgres", "schema": "asana_integrations_tests_dbt_test__audit", "fqn": ["asana", "unique_asana__project_project_id"], "unique_id": "test.asana.unique_asana__project_project_id.66a76364ef", "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "language": "sql", "package_name": "asana", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/asana", "path": "unique_asana__project_project_id.sql", "original_file_path": "models/asana.yml", "name": "unique_asana__project_project_id", "alias": "unique_asana__project_project_id", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["asana__project"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/asana/models/asana.yml/unique_asana__project_project_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1671481804.772671, "compiled_code": "\n \n \n\nselect\n project_id as unique_field,\n count(*) as n_records\n\nfrom \"postgres\".\"asana_integrations_tests_asana\".\"asana__project\"\nwhere project_id is not null\ngroup by project_id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "project_id", "file_key_name": "models.asana__project"}, "test.asana.not_null_asana__project_project_id.78420e1b45": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "project_id", "model": "{{ get_where_subquery(ref('asana__project')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.asana.asana__project"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "postgres", "schema": "asana_integrations_tests_dbt_test__audit", "fqn": ["asana", "not_null_asana__project_project_id"], "unique_id": "test.asana.not_null_asana__project_project_id.78420e1b45", "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "package_name": "asana", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/asana", "path": "not_null_asana__project_project_id.sql", "original_file_path": "models/asana.yml", "name": "not_null_asana__project_project_id", "alias": "not_null_asana__project_project_id", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["asana__project"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/asana/models/asana.yml/not_null_asana__project_project_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1671481804.7738519, "compiled_code": "\n \n \n\n\n\nselect project_id\nfrom \"postgres\".\"asana_integrations_tests_asana\".\"asana__project\"\nwhere project_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "project_id", "file_key_name": "models.asana__project"}, "test.asana.unique_asana__team_team_id.ada6b5e093": {"test_metadata": {"name": "unique", "kwargs": {"column_name": "team_id", "model": "{{ get_where_subquery(ref('asana__team')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["model.asana.asana__team"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "postgres", "schema": "asana_integrations_tests_dbt_test__audit", "fqn": ["asana", "unique_asana__team_team_id"], "unique_id": "test.asana.unique_asana__team_team_id.ada6b5e093", "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "language": "sql", "package_name": "asana", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/asana", "path": "unique_asana__team_team_id.sql", "original_file_path": "models/asana.yml", "name": "unique_asana__team_team_id", "alias": "unique_asana__team_team_id", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["asana__team"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/asana/models/asana.yml/unique_asana__team_team_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1671481804.774858, "compiled_code": "\n \n \n\nselect\n team_id as unique_field,\n count(*) as n_records\n\nfrom \"postgres\".\"asana_integrations_tests_asana\".\"asana__team\"\nwhere team_id is not null\ngroup by team_id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "team_id", "file_key_name": "models.asana__team"}, "test.asana.not_null_asana__team_team_id.cd6b6c88bf": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "team_id", "model": "{{ get_where_subquery(ref('asana__team')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.asana.asana__team"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "postgres", "schema": "asana_integrations_tests_dbt_test__audit", "fqn": ["asana", "not_null_asana__team_team_id"], "unique_id": "test.asana.not_null_asana__team_team_id.cd6b6c88bf", "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "package_name": "asana", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/asana", "path": "not_null_asana__team_team_id.sql", "original_file_path": "models/asana.yml", "name": "not_null_asana__team_team_id", "alias": "not_null_asana__team_team_id", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["asana__team"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/asana/models/asana.yml/not_null_asana__team_team_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1671481804.775872, "compiled_code": "\n \n \n\n\n\nselect team_id\nfrom \"postgres\".\"asana_integrations_tests_asana\".\"asana__team\"\nwhere team_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "team_id", "file_key_name": "models.asana__team"}, "test.asana.unique_asana__tag_tag_id.46c0d2510f": {"test_metadata": {"name": "unique", "kwargs": {"column_name": "tag_id", "model": "{{ get_where_subquery(ref('asana__tag')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["model.asana.asana__tag"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "postgres", "schema": "asana_integrations_tests_dbt_test__audit", "fqn": ["asana", "unique_asana__tag_tag_id"], "unique_id": "test.asana.unique_asana__tag_tag_id.46c0d2510f", "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "language": "sql", "package_name": "asana", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/asana", "path": "unique_asana__tag_tag_id.sql", "original_file_path": "models/asana.yml", "name": "unique_asana__tag_tag_id", "alias": "unique_asana__tag_tag_id", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["asana__tag"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/asana/models/asana.yml/unique_asana__tag_tag_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1671481804.776899, "compiled_code": "\n \n \n\nselect\n tag_id as unique_field,\n count(*) as n_records\n\nfrom \"postgres\".\"asana_integrations_tests_asana\".\"asana__tag\"\nwhere tag_id is not null\ngroup by tag_id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "tag_id", "file_key_name": "models.asana__tag"}, "test.asana.not_null_asana__tag_tag_id.593d626953": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "tag_id", "model": "{{ get_where_subquery(ref('asana__tag')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.asana.asana__tag"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "postgres", "schema": "asana_integrations_tests_dbt_test__audit", "fqn": ["asana", "not_null_asana__tag_tag_id"], "unique_id": "test.asana.not_null_asana__tag_tag_id.593d626953", "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "package_name": "asana", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/asana", "path": "not_null_asana__tag_tag_id.sql", "original_file_path": "models/asana.yml", "name": "not_null_asana__tag_tag_id", "alias": "not_null_asana__tag_tag_id", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["asana__tag"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/asana/models/asana.yml/not_null_asana__tag_tag_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1671481804.7780852, "compiled_code": "\n \n \n\n\n\nselect tag_id\nfrom \"postgres\".\"asana_integrations_tests_asana\".\"asana__tag\"\nwhere tag_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "tag_id", "file_key_name": "models.asana__tag"}, "test.asana.unique_asana__daily_metrics_date_day.e8d67f545d": {"test_metadata": {"name": "unique", "kwargs": {"column_name": "date_day", "model": "{{ get_where_subquery(ref('asana__daily_metrics')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["model.asana.asana__daily_metrics"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "postgres", "schema": "asana_integrations_tests_dbt_test__audit", "fqn": ["asana", "unique_asana__daily_metrics_date_day"], "unique_id": "test.asana.unique_asana__daily_metrics_date_day.e8d67f545d", "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "language": "sql", "package_name": "asana", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/asana", "path": "unique_asana__daily_metrics_date_day.sql", "original_file_path": "models/asana.yml", "name": "unique_asana__daily_metrics_date_day", "alias": "unique_asana__daily_metrics_date_day", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["asana__daily_metrics"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/asana/models/asana.yml/unique_asana__daily_metrics_date_day.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1671481804.779101, "compiled_code": "\n \n \n\nselect\n date_day as unique_field,\n count(*) as n_records\n\nfrom \"postgres\".\"asana_integrations_tests_asana\".\"asana__daily_metrics\"\nwhere date_day is not null\ngroup by date_day\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "date_day", "file_key_name": "models.asana__daily_metrics"}, "test.asana.not_null_asana__daily_metrics_date_day.363a2a09cf": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "date_day", "model": "{{ get_where_subquery(ref('asana__daily_metrics')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.asana.asana__daily_metrics"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "postgres", "schema": "asana_integrations_tests_dbt_test__audit", "fqn": ["asana", "not_null_asana__daily_metrics_date_day"], "unique_id": "test.asana.not_null_asana__daily_metrics_date_day.363a2a09cf", "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "package_name": "asana", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/asana", "path": "not_null_asana__daily_metrics_date_day.sql", "original_file_path": "models/asana.yml", "name": "not_null_asana__daily_metrics_date_day", "alias": "not_null_asana__daily_metrics_date_day", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["asana__daily_metrics"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/asana/models/asana.yml/not_null_asana__daily_metrics_date_day.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1671481804.780094, "compiled_code": "\n \n \n\n\n\nselect date_day\nfrom \"postgres\".\"asana_integrations_tests_asana\".\"asana__daily_metrics\"\nwhere date_day is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "date_day", "file_key_name": "models.asana__daily_metrics"}, "test.asana.unique_int_asana__project_task_metrics_project_id.049cc9b8a6": {"test_metadata": {"name": "unique", "kwargs": {"column_name": "project_id", "model": "{{ get_where_subquery(ref('int_asana__project_task_metrics')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["model.asana.int_asana__project_task_metrics"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "postgres", "schema": "asana_integrations_tests_dbt_test__audit", "fqn": ["asana", "intermediate", "unique_int_asana__project_task_metrics_project_id"], "unique_id": "test.asana.unique_int_asana__project_task_metrics_project_id.049cc9b8a6", "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "language": "sql", "package_name": "asana", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/asana", "path": "unique_int_asana__project_task_metrics_project_id.sql", "original_file_path": "models/intermediate/intermediate_asana.yml", "name": "unique_int_asana__project_task_metrics_project_id", "alias": "unique_int_asana__project_task_metrics_project_id", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["int_asana__project_task_metrics"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/asana/models/intermediate/intermediate_asana.yml/unique_int_asana__project_task_metrics_project_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1671481804.7869399, "compiled_code": "\n \n \n\nwith __dbt__cte__int_asana__project_task_metrics as (\nwith task as (\n\n select *\n from \"postgres\".\"asana_integrations_tests_asana\".\"asana__task\"\n\n),\n\nproject as (\n\n select * \n from \"postgres\".\"asana_integrations_tests_stg_asana\".\"stg_asana__project\"\n\n),\n\nproject_task as (\n\n select * \n from \"postgres\".\"asana_integrations_tests_stg_asana\".\"stg_asana__project_task\"\n),\n\nproject_task_history as (\n\n select\n project.project_id,\n task.task_id,\n task.is_completed as task_is_completed,\n task.assignee_user_id as task_assignee_user_id,\n task.days_open as task_days_open,\n task.days_since_last_assignment as task_days_assigned_current_user\n\n from project\n left join project_task \n on project.project_id = project_task.project_id\n left join task \n on project_task.task_id = task.task_id\n\n),\n\nagg_proj_tasks as (\n\n select \n project_id,\n sum(case when not task_is_completed then 1 else 0 end) as number_of_open_tasks,\n sum(case when not task_is_completed and task_assignee_user_id is not null then 1 else 0 end) as number_of_assigned_open_tasks,\n sum(case when task_is_completed then 1 else 0 end) as number_of_tasks_completed,\n sum(case when task_is_completed and task_assignee_user_id is not null then 1 else 0 end) as number_of_assigned_tasks_completed,\n sum(case when task_is_completed then task_days_open else 0 end) as total_days_open,\n sum(case when task_is_completed then task_days_assigned_current_user else 0 end) as total_days_assigned_last_user -- will divde later for avg\n\n from project_task_history\n\n group by 1\n\n),\n\nfinal as (\n\n select\n agg_proj_tasks.*,\n round(nullif(total_days_open, 0) * 1.0 / nullif(number_of_tasks_completed, 0), 0) as avg_close_time_days,\n round(nullif(total_days_assigned_last_user, 0) * 1.0 / nullif(number_of_assigned_tasks_completed, 0), 0) as avg_close_time_assigned_days\n\n from agg_proj_tasks\n \n)\n\nselect * from final\n)select\n project_id as unique_field,\n count(*) as n_records\n\nfrom __dbt__cte__int_asana__project_task_metrics\nwhere project_id is not null\ngroup by project_id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.asana.int_asana__project_task_metrics", "sql": " __dbt__cte__int_asana__project_task_metrics as (\nwith task as (\n\n select *\n from \"postgres\".\"asana_integrations_tests_asana\".\"asana__task\"\n\n),\n\nproject as (\n\n select * \n from \"postgres\".\"asana_integrations_tests_stg_asana\".\"stg_asana__project\"\n\n),\n\nproject_task as (\n\n select * \n from \"postgres\".\"asana_integrations_tests_stg_asana\".\"stg_asana__project_task\"\n),\n\nproject_task_history as (\n\n select\n project.project_id,\n task.task_id,\n task.is_completed as task_is_completed,\n task.assignee_user_id as task_assignee_user_id,\n task.days_open as task_days_open,\n task.days_since_last_assignment as task_days_assigned_current_user\n\n from project\n left join project_task \n on project.project_id = project_task.project_id\n left join task \n on project_task.task_id = task.task_id\n\n),\n\nagg_proj_tasks as (\n\n select \n project_id,\n sum(case when not task_is_completed then 1 else 0 end) as number_of_open_tasks,\n sum(case when not task_is_completed and task_assignee_user_id is not null then 1 else 0 end) as number_of_assigned_open_tasks,\n sum(case when task_is_completed then 1 else 0 end) as number_of_tasks_completed,\n sum(case when task_is_completed and task_assignee_user_id is not null then 1 else 0 end) as number_of_assigned_tasks_completed,\n sum(case when task_is_completed then task_days_open else 0 end) as total_days_open,\n sum(case when task_is_completed then task_days_assigned_current_user else 0 end) as total_days_assigned_last_user -- will divde later for avg\n\n from project_task_history\n\n group by 1\n\n),\n\nfinal as (\n\n select\n agg_proj_tasks.*,\n round(nullif(total_days_open, 0) * 1.0 / nullif(number_of_tasks_completed, 0), 0) as avg_close_time_days,\n round(nullif(total_days_assigned_last_user, 0) * 1.0 / nullif(number_of_assigned_tasks_completed, 0), 0) as avg_close_time_assigned_days\n\n from agg_proj_tasks\n \n)\n\nselect * from final\n)"}], "relation_name": null, "column_name": "project_id", "file_key_name": "models.int_asana__project_task_metrics"}, "test.asana.not_null_int_asana__project_task_metrics_project_id.804fd1daf3": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "project_id", "model": "{{ get_where_subquery(ref('int_asana__project_task_metrics')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.asana.int_asana__project_task_metrics"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "postgres", "schema": "asana_integrations_tests_dbt_test__audit", "fqn": ["asana", "intermediate", "not_null_int_asana__project_task_metrics_project_id"], "unique_id": "test.asana.not_null_int_asana__project_task_metrics_project_id.804fd1daf3", "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "package_name": "asana", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/asana", "path": "not_null_int_asana__project_task_metrics_project_id.sql", "original_file_path": "models/intermediate/intermediate_asana.yml", "name": "not_null_int_asana__project_task_metrics_project_id", "alias": "not_null_int_asana__project_task_metrics_project_id", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["int_asana__project_task_metrics"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/asana/models/intermediate/intermediate_asana.yml/not_null_int_asana__project_task_metrics_project_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1671481804.7879739, "compiled_code": "\n \n \n\n\n\nwith __dbt__cte__int_asana__project_task_metrics as (\nwith task as (\n\n select *\n from \"postgres\".\"asana_integrations_tests_asana\".\"asana__task\"\n\n),\n\nproject as (\n\n select * \n from \"postgres\".\"asana_integrations_tests_stg_asana\".\"stg_asana__project\"\n\n),\n\nproject_task as (\n\n select * \n from \"postgres\".\"asana_integrations_tests_stg_asana\".\"stg_asana__project_task\"\n),\n\nproject_task_history as (\n\n select\n project.project_id,\n task.task_id,\n task.is_completed as task_is_completed,\n task.assignee_user_id as task_assignee_user_id,\n task.days_open as task_days_open,\n task.days_since_last_assignment as task_days_assigned_current_user\n\n from project\n left join project_task \n on project.project_id = project_task.project_id\n left join task \n on project_task.task_id = task.task_id\n\n),\n\nagg_proj_tasks as (\n\n select \n project_id,\n sum(case when not task_is_completed then 1 else 0 end) as number_of_open_tasks,\n sum(case when not task_is_completed and task_assignee_user_id is not null then 1 else 0 end) as number_of_assigned_open_tasks,\n sum(case when task_is_completed then 1 else 0 end) as number_of_tasks_completed,\n sum(case when task_is_completed and task_assignee_user_id is not null then 1 else 0 end) as number_of_assigned_tasks_completed,\n sum(case when task_is_completed then task_days_open else 0 end) as total_days_open,\n sum(case when task_is_completed then task_days_assigned_current_user else 0 end) as total_days_assigned_last_user -- will divde later for avg\n\n from project_task_history\n\n group by 1\n\n),\n\nfinal as (\n\n select\n agg_proj_tasks.*,\n round(nullif(total_days_open, 0) * 1.0 / nullif(number_of_tasks_completed, 0), 0) as avg_close_time_days,\n round(nullif(total_days_assigned_last_user, 0) * 1.0 / nullif(number_of_assigned_tasks_completed, 0), 0) as avg_close_time_assigned_days\n\n from agg_proj_tasks\n \n)\n\nselect * from final\n)select project_id\nfrom __dbt__cte__int_asana__project_task_metrics\nwhere project_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.asana.int_asana__project_task_metrics", "sql": " __dbt__cte__int_asana__project_task_metrics as (\nwith task as (\n\n select *\n from \"postgres\".\"asana_integrations_tests_asana\".\"asana__task\"\n\n),\n\nproject as (\n\n select * \n from \"postgres\".\"asana_integrations_tests_stg_asana\".\"stg_asana__project\"\n\n),\n\nproject_task as (\n\n select * \n from \"postgres\".\"asana_integrations_tests_stg_asana\".\"stg_asana__project_task\"\n),\n\nproject_task_history as (\n\n select\n project.project_id,\n task.task_id,\n task.is_completed as task_is_completed,\n task.assignee_user_id as task_assignee_user_id,\n task.days_open as task_days_open,\n task.days_since_last_assignment as task_days_assigned_current_user\n\n from project\n left join project_task \n on project.project_id = project_task.project_id\n left join task \n on project_task.task_id = task.task_id\n\n),\n\nagg_proj_tasks as (\n\n select \n project_id,\n sum(case when not task_is_completed then 1 else 0 end) as number_of_open_tasks,\n sum(case when not task_is_completed and task_assignee_user_id is not null then 1 else 0 end) as number_of_assigned_open_tasks,\n sum(case when task_is_completed then 1 else 0 end) as number_of_tasks_completed,\n sum(case when task_is_completed and task_assignee_user_id is not null then 1 else 0 end) as number_of_assigned_tasks_completed,\n sum(case when task_is_completed then task_days_open else 0 end) as total_days_open,\n sum(case when task_is_completed then task_days_assigned_current_user else 0 end) as total_days_assigned_last_user -- will divde later for avg\n\n from project_task_history\n\n group by 1\n\n),\n\nfinal as (\n\n select\n agg_proj_tasks.*,\n round(nullif(total_days_open, 0) * 1.0 / nullif(number_of_tasks_completed, 0), 0) as avg_close_time_days,\n round(nullif(total_days_assigned_last_user, 0) * 1.0 / nullif(number_of_assigned_tasks_completed, 0), 0) as avg_close_time_assigned_days\n\n from agg_proj_tasks\n \n)\n\nselect * from final\n)"}], "relation_name": null, "column_name": "project_id", "file_key_name": "models.int_asana__project_task_metrics"}, "test.asana.dbt_utils_unique_combination_of_columns_int_asana__project_user_project_id__user_id__role__currently_working_on.f9493098e0": {"test_metadata": {"name": "unique_combination_of_columns", "kwargs": {"combination_of_columns": ["project_id", "user_id", "role", "currently_working_on"], "model": "{{ get_where_subquery(ref('int_asana__project_user')) }}"}, "namespace": "dbt_utils"}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt_utils.test_unique_combination_of_columns", "macro.dbt.get_where_subquery"], "nodes": ["model.asana.int_asana__project_user"]}, "config": {"enabled": true, "alias": "dbt_utils_unique_combination_o_2eee10354a4e647bd50fdf44bb16839c", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "postgres", "schema": "asana_integrations_tests_dbt_test__audit", "fqn": ["asana", "intermediate", "dbt_utils_unique_combination_of_columns_int_asana__project_user_project_id__user_id__role__currently_working_on"], "unique_id": "test.asana.dbt_utils_unique_combination_of_columns_int_asana__project_user_project_id__user_id__role__currently_working_on.f9493098e0", "raw_code": "{{ dbt_utils.test_unique_combination_of_columns(**_dbt_generic_test_kwargs) }}{{ config(alias=\"dbt_utils_unique_combination_o_2eee10354a4e647bd50fdf44bb16839c\") }}", "language": "sql", "package_name": "asana", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/asana", "path": "dbt_utils_unique_combination_o_2eee10354a4e647bd50fdf44bb16839c.sql", "original_file_path": "models/intermediate/intermediate_asana.yml", "name": "dbt_utils_unique_combination_of_columns_int_asana__project_user_project_id__user_id__role__currently_working_on", "alias": "dbt_utils_unique_combination_o_2eee10354a4e647bd50fdf44bb16839c", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["int_asana__project_user"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/asana/models/intermediate/intermediate_asana.yml/dbt_utils_unique_combination_o_2eee10354a4e647bd50fdf44bb16839c.sql", "build_path": null, "deferred": false, "unrendered_config": {"alias": "dbt_utils_unique_combination_o_2eee10354a4e647bd50fdf44bb16839c"}, "created_at": 1671481804.788992, "compiled_code": "\n\n\n\n\n\nwith __dbt__cte__int_asana__task_assignee as (\nwith task as (\n\n select * \n from \"postgres\".\"asana_integrations_tests_stg_asana\".\"stg_asana__task\"\n\n),\n\nasana_user as (\n\n select *\n from \"postgres\".\"asana_integrations_tests_stg_asana\".\"stg_asana__user\"\n),\n\ntask_assignee as (\n\n select\n task.*,\n assignee_user_id is not null as has_assignee,\n asana_user.user_name as assignee_name,\n asana_user.email as assignee_email\n\n from task \n left join asana_user \n on task.assignee_user_id = asana_user.user_id\n)\n\nselect * from task_assignee\n), __dbt__cte__int_asana__project_user as (\nwith project_tasks as (\n \n select *\n from \"postgres\".\"asana_integrations_tests_stg_asana\".\"stg_asana__project_task\"\n),\n\nassigned_tasks as (\n \n select * \n from __dbt__cte__int_asana__task_assignee\n where has_assignee\n \n),\n\nproject as (\n \n select *\n from \"postgres\".\"asana_integrations_tests_stg_asana\".\"stg_asana__project\"\n\n where not is_archived\n\n),\n\nproject_assignee as (\n\n select\n project_tasks.project_id,\n project_tasks.task_id,\n assigned_tasks.assignee_user_id,\n assigned_tasks.assignee_name,\n not assigned_tasks.is_completed as currently_working_on\n\n from project_tasks \n join assigned_tasks \n on assigned_tasks.task_id = project_tasks.task_id\n\n),\n\nproject_owner as (\n\n select \n project_id,\n project_name,\n owner_user_id\n\n from project\n \n where owner_user_id is not null\n),\n\nproject_user as (\n \n select\n project_id,\n project_name,\n owner_user_id as user_id,\n 'owner' as role,\n null as currently_working_on\n \n from project_owner\n\n union all\n\n select\n project.project_id,\n project.project_name,\n project_assignee.assignee_user_id as user_id,\n 'task assignee' as role,\n project_assignee.currently_working_on\n \n from project \n \n join project_assignee \n on project.project_id = project_assignee.project_id\n group by 1,2,3,4,5\n\n)\n\n\nselect * from project_user\n),validation_errors as (\n\n select\n project_id, user_id, role, currently_working_on\n from __dbt__cte__int_asana__project_user\n group by project_id, user_id, role, currently_working_on\n having count(*) > 1\n\n)\n\nselect *\nfrom validation_errors\n\n\n", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.asana.int_asana__task_assignee", "sql": " __dbt__cte__int_asana__task_assignee as (\nwith task as (\n\n select * \n from \"postgres\".\"asana_integrations_tests_stg_asana\".\"stg_asana__task\"\n\n),\n\nasana_user as (\n\n select *\n from \"postgres\".\"asana_integrations_tests_stg_asana\".\"stg_asana__user\"\n),\n\ntask_assignee as (\n\n select\n task.*,\n assignee_user_id is not null as has_assignee,\n asana_user.user_name as assignee_name,\n asana_user.email as assignee_email\n\n from task \n left join asana_user \n on task.assignee_user_id = asana_user.user_id\n)\n\nselect * from task_assignee\n)"}, {"id": "model.asana.int_asana__project_user", "sql": " __dbt__cte__int_asana__project_user as (\nwith project_tasks as (\n \n select *\n from \"postgres\".\"asana_integrations_tests_stg_asana\".\"stg_asana__project_task\"\n),\n\nassigned_tasks as (\n \n select * \n from __dbt__cte__int_asana__task_assignee\n where has_assignee\n \n),\n\nproject as (\n \n select *\n from \"postgres\".\"asana_integrations_tests_stg_asana\".\"stg_asana__project\"\n\n where not is_archived\n\n),\n\nproject_assignee as (\n\n select\n project_tasks.project_id,\n project_tasks.task_id,\n assigned_tasks.assignee_user_id,\n assigned_tasks.assignee_name,\n not assigned_tasks.is_completed as currently_working_on\n\n from project_tasks \n join assigned_tasks \n on assigned_tasks.task_id = project_tasks.task_id\n\n),\n\nproject_owner as (\n\n select \n project_id,\n project_name,\n owner_user_id\n\n from project\n \n where owner_user_id is not null\n),\n\nproject_user as (\n \n select\n project_id,\n project_name,\n owner_user_id as user_id,\n 'owner' as role,\n null as currently_working_on\n \n from project_owner\n\n union all\n\n select\n project.project_id,\n project.project_name,\n project_assignee.assignee_user_id as user_id,\n 'task assignee' as role,\n project_assignee.currently_working_on\n \n from project \n \n join project_assignee \n on project.project_id = project_assignee.project_id\n group by 1,2,3,4,5\n\n)\n\n\nselect * from project_user\n)"}], "relation_name": null, "column_name": null, "file_key_name": "models.int_asana__project_user"}, "test.asana.unique_int_asana__subtask_parent_subtask_id.641dfb3c8f": {"test_metadata": {"name": "unique", "kwargs": {"column_name": "subtask_id", "model": "{{ get_where_subquery(ref('int_asana__subtask_parent')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["model.asana.int_asana__subtask_parent"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "postgres", "schema": "asana_integrations_tests_dbt_test__audit", "fqn": ["asana", "intermediate", "unique_int_asana__subtask_parent_subtask_id"], "unique_id": "test.asana.unique_int_asana__subtask_parent_subtask_id.641dfb3c8f", "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "language": "sql", "package_name": "asana", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/asana", "path": "unique_int_asana__subtask_parent_subtask_id.sql", "original_file_path": "models/intermediate/intermediate_asana.yml", "name": "unique_int_asana__subtask_parent_subtask_id", "alias": "unique_int_asana__subtask_parent_subtask_id", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["int_asana__subtask_parent"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/asana/models/intermediate/intermediate_asana.yml/unique_int_asana__subtask_parent_subtask_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1671481804.796844, "compiled_code": "\n \n \n\nwith __dbt__cte__int_asana__task_assignee as (\nwith task as (\n\n select * \n from \"postgres\".\"asana_integrations_tests_stg_asana\".\"stg_asana__task\"\n\n),\n\nasana_user as (\n\n select *\n from \"postgres\".\"asana_integrations_tests_stg_asana\".\"stg_asana__user\"\n),\n\ntask_assignee as (\n\n select\n task.*,\n assignee_user_id is not null as has_assignee,\n asana_user.user_name as assignee_name,\n asana_user.email as assignee_email\n\n from task \n left join asana_user \n on task.assignee_user_id = asana_user.user_id\n)\n\nselect * from task_assignee\n), __dbt__cte__int_asana__subtask_parent as (\nwith task_assignee as (\n\n select * \n from __dbt__cte__int_asana__task_assignee\n\n),\n\n\nsubtask_parent as (\n\n select\n subtask.task_id as subtask_id,\n parent.task_id as parent_task_id,\n parent.task_name as parent_task_name,\n parent.due_date as parent_due_date,\n parent.created_at as parent_created_at,\n parent.assignee_user_id as parent_assignee_user_id,\n parent.assignee_name as parent_assignee_name\n\n from task_assignee as parent \n join task_assignee as subtask\n on parent.task_id = subtask.parent_task_id\n\n)\n\nselect * from subtask_parent\n)select\n subtask_id as unique_field,\n count(*) as n_records\n\nfrom __dbt__cte__int_asana__subtask_parent\nwhere subtask_id is not null\ngroup by subtask_id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.asana.int_asana__task_assignee", "sql": " __dbt__cte__int_asana__task_assignee as (\nwith task as (\n\n select * \n from \"postgres\".\"asana_integrations_tests_stg_asana\".\"stg_asana__task\"\n\n),\n\nasana_user as (\n\n select *\n from \"postgres\".\"asana_integrations_tests_stg_asana\".\"stg_asana__user\"\n),\n\ntask_assignee as (\n\n select\n task.*,\n assignee_user_id is not null as has_assignee,\n asana_user.user_name as assignee_name,\n asana_user.email as assignee_email\n\n from task \n left join asana_user \n on task.assignee_user_id = asana_user.user_id\n)\n\nselect * from task_assignee\n)"}, {"id": "model.asana.int_asana__subtask_parent", "sql": " __dbt__cte__int_asana__subtask_parent as (\nwith task_assignee as (\n\n select * \n from __dbt__cte__int_asana__task_assignee\n\n),\n\n\nsubtask_parent as (\n\n select\n subtask.task_id as subtask_id,\n parent.task_id as parent_task_id,\n parent.task_name as parent_task_name,\n parent.due_date as parent_due_date,\n parent.created_at as parent_created_at,\n parent.assignee_user_id as parent_assignee_user_id,\n parent.assignee_name as parent_assignee_name\n\n from task_assignee as parent \n join task_assignee as subtask\n on parent.task_id = subtask.parent_task_id\n\n)\n\nselect * from subtask_parent\n)"}], "relation_name": null, "column_name": "subtask_id", "file_key_name": "models.int_asana__subtask_parent"}, "test.asana.not_null_int_asana__subtask_parent_subtask_id.024565c768": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "subtask_id", "model": "{{ get_where_subquery(ref('int_asana__subtask_parent')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.asana.int_asana__subtask_parent"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "postgres", "schema": "asana_integrations_tests_dbt_test__audit", "fqn": ["asana", "intermediate", "not_null_int_asana__subtask_parent_subtask_id"], "unique_id": "test.asana.not_null_int_asana__subtask_parent_subtask_id.024565c768", "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "package_name": "asana", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/asana", "path": "not_null_int_asana__subtask_parent_subtask_id.sql", "original_file_path": "models/intermediate/intermediate_asana.yml", "name": "not_null_int_asana__subtask_parent_subtask_id", "alias": "not_null_int_asana__subtask_parent_subtask_id", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["int_asana__subtask_parent"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/asana/models/intermediate/intermediate_asana.yml/not_null_int_asana__subtask_parent_subtask_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1671481804.7979789, "compiled_code": "\n \n \n\n\n\nwith __dbt__cte__int_asana__task_assignee as (\nwith task as (\n\n select * \n from \"postgres\".\"asana_integrations_tests_stg_asana\".\"stg_asana__task\"\n\n),\n\nasana_user as (\n\n select *\n from \"postgres\".\"asana_integrations_tests_stg_asana\".\"stg_asana__user\"\n),\n\ntask_assignee as (\n\n select\n task.*,\n assignee_user_id is not null as has_assignee,\n asana_user.user_name as assignee_name,\n asana_user.email as assignee_email\n\n from task \n left join asana_user \n on task.assignee_user_id = asana_user.user_id\n)\n\nselect * from task_assignee\n), __dbt__cte__int_asana__subtask_parent as (\nwith task_assignee as (\n\n select * \n from __dbt__cte__int_asana__task_assignee\n\n),\n\n\nsubtask_parent as (\n\n select\n subtask.task_id as subtask_id,\n parent.task_id as parent_task_id,\n parent.task_name as parent_task_name,\n parent.due_date as parent_due_date,\n parent.created_at as parent_created_at,\n parent.assignee_user_id as parent_assignee_user_id,\n parent.assignee_name as parent_assignee_name\n\n from task_assignee as parent \n join task_assignee as subtask\n on parent.task_id = subtask.parent_task_id\n\n)\n\nselect * from subtask_parent\n)select subtask_id\nfrom __dbt__cte__int_asana__subtask_parent\nwhere subtask_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.asana.int_asana__task_assignee", "sql": " __dbt__cte__int_asana__task_assignee as (\nwith task as (\n\n select * \n from \"postgres\".\"asana_integrations_tests_stg_asana\".\"stg_asana__task\"\n\n),\n\nasana_user as (\n\n select *\n from \"postgres\".\"asana_integrations_tests_stg_asana\".\"stg_asana__user\"\n),\n\ntask_assignee as (\n\n select\n task.*,\n assignee_user_id is not null as has_assignee,\n asana_user.user_name as assignee_name,\n asana_user.email as assignee_email\n\n from task \n left join asana_user \n on task.assignee_user_id = asana_user.user_id\n)\n\nselect * from task_assignee\n)"}, {"id": "model.asana.int_asana__subtask_parent", "sql": " __dbt__cte__int_asana__subtask_parent as (\nwith task_assignee as (\n\n select * \n from __dbt__cte__int_asana__task_assignee\n\n),\n\n\nsubtask_parent as (\n\n select\n subtask.task_id as subtask_id,\n parent.task_id as parent_task_id,\n parent.task_name as parent_task_name,\n parent.due_date as parent_due_date,\n parent.created_at as parent_created_at,\n parent.assignee_user_id as parent_assignee_user_id,\n parent.assignee_name as parent_assignee_name\n\n from task_assignee as parent \n join task_assignee as subtask\n on parent.task_id = subtask.parent_task_id\n\n)\n\nselect * from subtask_parent\n)"}], "relation_name": null, "column_name": "subtask_id", "file_key_name": "models.int_asana__subtask_parent"}, "test.asana.unique_int_asana__task_assignee_task_id.b4e2ea04e1": {"test_metadata": {"name": "unique", "kwargs": {"column_name": "task_id", "model": "{{ get_where_subquery(ref('int_asana__task_assignee')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["model.asana.int_asana__task_assignee"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "postgres", "schema": "asana_integrations_tests_dbt_test__audit", "fqn": ["asana", "intermediate", "unique_int_asana__task_assignee_task_id"], "unique_id": "test.asana.unique_int_asana__task_assignee_task_id.b4e2ea04e1", "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "language": "sql", "package_name": "asana", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/asana", "path": "unique_int_asana__task_assignee_task_id.sql", "original_file_path": "models/intermediate/intermediate_asana.yml", "name": "unique_int_asana__task_assignee_task_id", "alias": "unique_int_asana__task_assignee_task_id", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["int_asana__task_assignee"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/asana/models/intermediate/intermediate_asana.yml/unique_int_asana__task_assignee_task_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1671481804.7989728, "compiled_code": "\n \n \n\nwith __dbt__cte__int_asana__task_assignee as (\nwith task as (\n\n select * \n from \"postgres\".\"asana_integrations_tests_stg_asana\".\"stg_asana__task\"\n\n),\n\nasana_user as (\n\n select *\n from \"postgres\".\"asana_integrations_tests_stg_asana\".\"stg_asana__user\"\n),\n\ntask_assignee as (\n\n select\n task.*,\n assignee_user_id is not null as has_assignee,\n asana_user.user_name as assignee_name,\n asana_user.email as assignee_email\n\n from task \n left join asana_user \n on task.assignee_user_id = asana_user.user_id\n)\n\nselect * from task_assignee\n)select\n task_id as unique_field,\n count(*) as n_records\n\nfrom __dbt__cte__int_asana__task_assignee\nwhere task_id is not null\ngroup by task_id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.asana.int_asana__task_assignee", "sql": " __dbt__cte__int_asana__task_assignee as (\nwith task as (\n\n select * \n from \"postgres\".\"asana_integrations_tests_stg_asana\".\"stg_asana__task\"\n\n),\n\nasana_user as (\n\n select *\n from \"postgres\".\"asana_integrations_tests_stg_asana\".\"stg_asana__user\"\n),\n\ntask_assignee as (\n\n select\n task.*,\n assignee_user_id is not null as has_assignee,\n asana_user.user_name as assignee_name,\n asana_user.email as assignee_email\n\n from task \n left join asana_user \n on task.assignee_user_id = asana_user.user_id\n)\n\nselect * from task_assignee\n)"}], "relation_name": null, "column_name": "task_id", "file_key_name": "models.int_asana__task_assignee"}, "test.asana.not_null_int_asana__task_assignee_task_id.a9c81bd443": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "task_id", "model": "{{ get_where_subquery(ref('int_asana__task_assignee')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.asana.int_asana__task_assignee"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "postgres", "schema": "asana_integrations_tests_dbt_test__audit", "fqn": ["asana", "intermediate", "not_null_int_asana__task_assignee_task_id"], "unique_id": "test.asana.not_null_int_asana__task_assignee_task_id.a9c81bd443", "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "package_name": "asana", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/asana", "path": "not_null_int_asana__task_assignee_task_id.sql", "original_file_path": "models/intermediate/intermediate_asana.yml", "name": "not_null_int_asana__task_assignee_task_id", "alias": "not_null_int_asana__task_assignee_task_id", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["int_asana__task_assignee"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/asana/models/intermediate/intermediate_asana.yml/not_null_int_asana__task_assignee_task_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1671481804.799959, "compiled_code": "\n \n \n\n\n\nwith __dbt__cte__int_asana__task_assignee as (\nwith task as (\n\n select * \n from \"postgres\".\"asana_integrations_tests_stg_asana\".\"stg_asana__task\"\n\n),\n\nasana_user as (\n\n select *\n from \"postgres\".\"asana_integrations_tests_stg_asana\".\"stg_asana__user\"\n),\n\ntask_assignee as (\n\n select\n task.*,\n assignee_user_id is not null as has_assignee,\n asana_user.user_name as assignee_name,\n asana_user.email as assignee_email\n\n from task \n left join asana_user \n on task.assignee_user_id = asana_user.user_id\n)\n\nselect * from task_assignee\n)select task_id\nfrom __dbt__cte__int_asana__task_assignee\nwhere task_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.asana.int_asana__task_assignee", "sql": " __dbt__cte__int_asana__task_assignee as (\nwith task as (\n\n select * \n from \"postgres\".\"asana_integrations_tests_stg_asana\".\"stg_asana__task\"\n\n),\n\nasana_user as (\n\n select *\n from \"postgres\".\"asana_integrations_tests_stg_asana\".\"stg_asana__user\"\n),\n\ntask_assignee as (\n\n select\n task.*,\n assignee_user_id is not null as has_assignee,\n asana_user.user_name as assignee_name,\n asana_user.email as assignee_email\n\n from task \n left join asana_user \n on task.assignee_user_id = asana_user.user_id\n)\n\nselect * from task_assignee\n)"}], "relation_name": null, "column_name": "task_id", "file_key_name": "models.int_asana__task_assignee"}, "test.asana.unique_int_asana__task_comments_task_id.f012fa6a04": {"test_metadata": {"name": "unique", "kwargs": {"column_name": "task_id", "model": "{{ get_where_subquery(ref('int_asana__task_comments')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["model.asana.int_asana__task_comments"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "postgres", "schema": "asana_integrations_tests_dbt_test__audit", "fqn": ["asana", "intermediate", "unique_int_asana__task_comments_task_id"], "unique_id": "test.asana.unique_int_asana__task_comments_task_id.f012fa6a04", "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "language": "sql", "package_name": "asana", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/asana", "path": "unique_int_asana__task_comments_task_id.sql", "original_file_path": "models/intermediate/intermediate_asana.yml", "name": "unique_int_asana__task_comments_task_id", "alias": "unique_int_asana__task_comments_task_id", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["int_asana__task_comments"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/asana/models/intermediate/intermediate_asana.yml/unique_int_asana__task_comments_task_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1671481804.800939, "compiled_code": "\n \n \n\nwith __dbt__cte__int_asana__task_story as (\nwith story as (\n \n select * \n from \"postgres\".\"asana_integrations_tests_stg_asana\".\"stg_asana__story\"\n\n),\n\nasana_user as (\n\n select * \n from \"postgres\".\"asana_integrations_tests_stg_asana\".\"stg_asana__user\"\n),\n\nstory_user as (\n select \n story.*,\n asana_user.user_name as created_by_name\n from story\n join asana_user \n on story.created_by_user_id = asana_user.user_id\n),\n\nsplit_comments as (\n\n select\n story_id,\n created_at,\n created_by_user_id,\n created_by_name,\n target_task_id,\n \n case when event_type = 'comment' then story_content \n else null end as comment_content,\n\n case when event_type = 'system' then story_content \n else 'comment' end as action_description\n \n from story_user\n\n),\n\n\n-- the next CTE uses this dictionary to parse the type of action out of the event descfription\n\n\nparse_actions as (\n select\n story_id,\n target_task_id,\n created_at,\n created_by_user_id,\n created_by_name,\n comment_content,\n case \n when action_description like 'added the name%' then 'added name' \n when action_description like 'changed the name%' then 'changed name' \n when action_description like 'removed the name' then 'removed name' \n when action_description like 'added the description%' then 'added description' \n when action_description like 'changed the description%' then 'changed description' \n when action_description like 'removed the description' then 'removed description' \n when action_description like 'added to%' then 'added to project' \n when action_description like 'removed from%' then 'removed from project' \n when action_description like 'assigned%' then 'assigned' \n when action_description like 'unassigned%' then 'unassigned' \n when action_description like 'changed the due date%' then 'changed due date' \n when action_description like 'changed the start date%due date%' then 'changed due date' \n when action_description like 'changed the start date%' then 'changed start date' \n when action_description like 'removed the due date%' then 'removed due date' \n when action_description like 'removed the date range%' then 'removed due date' \n when action_description like 'removed the start date' then 'removed start date' \n when action_description like 'added subtask%' then 'added subtask' \n when action_description like 'added%collaborator%' then 'added collaborator' \n when action_description like 'moved%' then 'moved to section' \n when action_description like 'duplicated task from%' then 'duplicated this from other task' \n when action_description like 'marked%as a duplicate of this' then 'marked other task as duplicate of this' \n when action_description like 'marked this a duplicate of%' then 'marked as duplicate' \n when action_description like 'marked this task complete' then 'completed' \n when action_description like 'completed this task' then 'completed' \n when action_description like 'marked incomplete' then 'marked incomplete' \n when action_description like 'marked this task as a milestone' then 'marked as milestone' \n when action_description like 'unmarked this task as a milestone' then 'unmarked as milestone' \n when action_description like 'marked this milestone complete' then 'completed milestone' \n when action_description like 'completed this milestone' then 'completed milestone' \n when action_description like 'attached%' then 'attachment' \n when action_description like 'liked your comment' then 'liked comment' \n when action_description like 'liked this task' then 'liked task' \n when action_description like 'liked your attachment' then 'liked attachment' \n when action_description like 'liked that you completed this task' then 'liked completion' \n when action_description like 'completed the last task you were waiting on%' then 'completed dependency' \n when action_description like 'added feedback to%' then 'added feedback' \n when action_description like 'changed%to%' then 'changed tag' \n when action_description like 'cleared%' then 'cleared tag' \n when action_description like 'comment' then 'comment' \n when action_description like 'have a task due on%' then ''\n else action_description end as action_taken,\n action_description\n \n from split_comments\n\n),\n\n\nfinal as (\n \n select * \n from parse_actions\n\n -- remove actions you don't care about (set to null in the actions dictionary above)\n where action_taken is not null \n\n)\n\n\nselect * from final\n), __dbt__cte__int_asana__task_comments as (\nwith comments as (\n \n select *\n from __dbt__cte__int_asana__task_story\n where comment_content is not null\n order by target_task_id, created_at asc\n\n),\n\ntask_conversation as (\n\n select\n target_task_id as task_id,\n -- creates a chronologically ordered conversation about the task\n \n string_agg(created_at || ' - ' || created_by_name || ': ' || comment_content, '\\n')\n\n as conversation,\n count(*) as number_of_comments\n\n from comments \n group by 1\n)\n\nselect * from task_conversation\n)select\n task_id as unique_field,\n count(*) as n_records\n\nfrom __dbt__cte__int_asana__task_comments\nwhere task_id is not null\ngroup by task_id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.asana.int_asana__task_story", "sql": " __dbt__cte__int_asana__task_story as (\nwith story as (\n \n select * \n from \"postgres\".\"asana_integrations_tests_stg_asana\".\"stg_asana__story\"\n\n),\n\nasana_user as (\n\n select * \n from \"postgres\".\"asana_integrations_tests_stg_asana\".\"stg_asana__user\"\n),\n\nstory_user as (\n select \n story.*,\n asana_user.user_name as created_by_name\n from story\n join asana_user \n on story.created_by_user_id = asana_user.user_id\n),\n\nsplit_comments as (\n\n select\n story_id,\n created_at,\n created_by_user_id,\n created_by_name,\n target_task_id,\n \n case when event_type = 'comment' then story_content \n else null end as comment_content,\n\n case when event_type = 'system' then story_content \n else 'comment' end as action_description\n \n from story_user\n\n),\n\n\n-- the next CTE uses this dictionary to parse the type of action out of the event descfription\n\n\nparse_actions as (\n select\n story_id,\n target_task_id,\n created_at,\n created_by_user_id,\n created_by_name,\n comment_content,\n case \n when action_description like 'added the name%' then 'added name' \n when action_description like 'changed the name%' then 'changed name' \n when action_description like 'removed the name' then 'removed name' \n when action_description like 'added the description%' then 'added description' \n when action_description like 'changed the description%' then 'changed description' \n when action_description like 'removed the description' then 'removed description' \n when action_description like 'added to%' then 'added to project' \n when action_description like 'removed from%' then 'removed from project' \n when action_description like 'assigned%' then 'assigned' \n when action_description like 'unassigned%' then 'unassigned' \n when action_description like 'changed the due date%' then 'changed due date' \n when action_description like 'changed the start date%due date%' then 'changed due date' \n when action_description like 'changed the start date%' then 'changed start date' \n when action_description like 'removed the due date%' then 'removed due date' \n when action_description like 'removed the date range%' then 'removed due date' \n when action_description like 'removed the start date' then 'removed start date' \n when action_description like 'added subtask%' then 'added subtask' \n when action_description like 'added%collaborator%' then 'added collaborator' \n when action_description like 'moved%' then 'moved to section' \n when action_description like 'duplicated task from%' then 'duplicated this from other task' \n when action_description like 'marked%as a duplicate of this' then 'marked other task as duplicate of this' \n when action_description like 'marked this a duplicate of%' then 'marked as duplicate' \n when action_description like 'marked this task complete' then 'completed' \n when action_description like 'completed this task' then 'completed' \n when action_description like 'marked incomplete' then 'marked incomplete' \n when action_description like 'marked this task as a milestone' then 'marked as milestone' \n when action_description like 'unmarked this task as a milestone' then 'unmarked as milestone' \n when action_description like 'marked this milestone complete' then 'completed milestone' \n when action_description like 'completed this milestone' then 'completed milestone' \n when action_description like 'attached%' then 'attachment' \n when action_description like 'liked your comment' then 'liked comment' \n when action_description like 'liked this task' then 'liked task' \n when action_description like 'liked your attachment' then 'liked attachment' \n when action_description like 'liked that you completed this task' then 'liked completion' \n when action_description like 'completed the last task you were waiting on%' then 'completed dependency' \n when action_description like 'added feedback to%' then 'added feedback' \n when action_description like 'changed%to%' then 'changed tag' \n when action_description like 'cleared%' then 'cleared tag' \n when action_description like 'comment' then 'comment' \n when action_description like 'have a task due on%' then ''\n else action_description end as action_taken,\n action_description\n \n from split_comments\n\n),\n\n\nfinal as (\n \n select * \n from parse_actions\n\n -- remove actions you don't care about (set to null in the actions dictionary above)\n where action_taken is not null \n\n)\n\n\nselect * from final\n)"}, {"id": "model.asana.int_asana__task_comments", "sql": " __dbt__cte__int_asana__task_comments as (\nwith comments as (\n \n select *\n from __dbt__cte__int_asana__task_story\n where comment_content is not null\n order by target_task_id, created_at asc\n\n),\n\ntask_conversation as (\n\n select\n target_task_id as task_id,\n -- creates a chronologically ordered conversation about the task\n \n string_agg(created_at || ' - ' || created_by_name || ': ' || comment_content, '\\n')\n\n as conversation,\n count(*) as number_of_comments\n\n from comments \n group by 1\n)\n\nselect * from task_conversation\n)"}], "relation_name": null, "column_name": "task_id", "file_key_name": "models.int_asana__task_comments"}, "test.asana.not_null_int_asana__task_comments_task_id.6986f1d77f": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "task_id", "model": "{{ get_where_subquery(ref('int_asana__task_comments')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.asana.int_asana__task_comments"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "postgres", "schema": "asana_integrations_tests_dbt_test__audit", "fqn": ["asana", "intermediate", "not_null_int_asana__task_comments_task_id"], "unique_id": "test.asana.not_null_int_asana__task_comments_task_id.6986f1d77f", "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "package_name": "asana", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/asana", "path": "not_null_int_asana__task_comments_task_id.sql", "original_file_path": "models/intermediate/intermediate_asana.yml", "name": "not_null_int_asana__task_comments_task_id", "alias": "not_null_int_asana__task_comments_task_id", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["int_asana__task_comments"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/asana/models/intermediate/intermediate_asana.yml/not_null_int_asana__task_comments_task_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1671481804.802047, "compiled_code": "\n \n \n\n\n\nwith __dbt__cte__int_asana__task_story as (\nwith story as (\n \n select * \n from \"postgres\".\"asana_integrations_tests_stg_asana\".\"stg_asana__story\"\n\n),\n\nasana_user as (\n\n select * \n from \"postgres\".\"asana_integrations_tests_stg_asana\".\"stg_asana__user\"\n),\n\nstory_user as (\n select \n story.*,\n asana_user.user_name as created_by_name\n from story\n join asana_user \n on story.created_by_user_id = asana_user.user_id\n),\n\nsplit_comments as (\n\n select\n story_id,\n created_at,\n created_by_user_id,\n created_by_name,\n target_task_id,\n \n case when event_type = 'comment' then story_content \n else null end as comment_content,\n\n case when event_type = 'system' then story_content \n else 'comment' end as action_description\n \n from story_user\n\n),\n\n\n-- the next CTE uses this dictionary to parse the type of action out of the event descfription\n\n\nparse_actions as (\n select\n story_id,\n target_task_id,\n created_at,\n created_by_user_id,\n created_by_name,\n comment_content,\n case \n when action_description like 'added the name%' then 'added name' \n when action_description like 'changed the name%' then 'changed name' \n when action_description like 'removed the name' then 'removed name' \n when action_description like 'added the description%' then 'added description' \n when action_description like 'changed the description%' then 'changed description' \n when action_description like 'removed the description' then 'removed description' \n when action_description like 'added to%' then 'added to project' \n when action_description like 'removed from%' then 'removed from project' \n when action_description like 'assigned%' then 'assigned' \n when action_description like 'unassigned%' then 'unassigned' \n when action_description like 'changed the due date%' then 'changed due date' \n when action_description like 'changed the start date%due date%' then 'changed due date' \n when action_description like 'changed the start date%' then 'changed start date' \n when action_description like 'removed the due date%' then 'removed due date' \n when action_description like 'removed the date range%' then 'removed due date' \n when action_description like 'removed the start date' then 'removed start date' \n when action_description like 'added subtask%' then 'added subtask' \n when action_description like 'added%collaborator%' then 'added collaborator' \n when action_description like 'moved%' then 'moved to section' \n when action_description like 'duplicated task from%' then 'duplicated this from other task' \n when action_description like 'marked%as a duplicate of this' then 'marked other task as duplicate of this' \n when action_description like 'marked this a duplicate of%' then 'marked as duplicate' \n when action_description like 'marked this task complete' then 'completed' \n when action_description like 'completed this task' then 'completed' \n when action_description like 'marked incomplete' then 'marked incomplete' \n when action_description like 'marked this task as a milestone' then 'marked as milestone' \n when action_description like 'unmarked this task as a milestone' then 'unmarked as milestone' \n when action_description like 'marked this milestone complete' then 'completed milestone' \n when action_description like 'completed this milestone' then 'completed milestone' \n when action_description like 'attached%' then 'attachment' \n when action_description like 'liked your comment' then 'liked comment' \n when action_description like 'liked this task' then 'liked task' \n when action_description like 'liked your attachment' then 'liked attachment' \n when action_description like 'liked that you completed this task' then 'liked completion' \n when action_description like 'completed the last task you were waiting on%' then 'completed dependency' \n when action_description like 'added feedback to%' then 'added feedback' \n when action_description like 'changed%to%' then 'changed tag' \n when action_description like 'cleared%' then 'cleared tag' \n when action_description like 'comment' then 'comment' \n when action_description like 'have a task due on%' then ''\n else action_description end as action_taken,\n action_description\n \n from split_comments\n\n),\n\n\nfinal as (\n \n select * \n from parse_actions\n\n -- remove actions you don't care about (set to null in the actions dictionary above)\n where action_taken is not null \n\n)\n\n\nselect * from final\n), __dbt__cte__int_asana__task_comments as (\nwith comments as (\n \n select *\n from __dbt__cte__int_asana__task_story\n where comment_content is not null\n order by target_task_id, created_at asc\n\n),\n\ntask_conversation as (\n\n select\n target_task_id as task_id,\n -- creates a chronologically ordered conversation about the task\n \n string_agg(created_at || ' - ' || created_by_name || ': ' || comment_content, '\\n')\n\n as conversation,\n count(*) as number_of_comments\n\n from comments \n group by 1\n)\n\nselect * from task_conversation\n)select task_id\nfrom __dbt__cte__int_asana__task_comments\nwhere task_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.asana.int_asana__task_story", "sql": " __dbt__cte__int_asana__task_story as (\nwith story as (\n \n select * \n from \"postgres\".\"asana_integrations_tests_stg_asana\".\"stg_asana__story\"\n\n),\n\nasana_user as (\n\n select * \n from \"postgres\".\"asana_integrations_tests_stg_asana\".\"stg_asana__user\"\n),\n\nstory_user as (\n select \n story.*,\n asana_user.user_name as created_by_name\n from story\n join asana_user \n on story.created_by_user_id = asana_user.user_id\n),\n\nsplit_comments as (\n\n select\n story_id,\n created_at,\n created_by_user_id,\n created_by_name,\n target_task_id,\n \n case when event_type = 'comment' then story_content \n else null end as comment_content,\n\n case when event_type = 'system' then story_content \n else 'comment' end as action_description\n \n from story_user\n\n),\n\n\n-- the next CTE uses this dictionary to parse the type of action out of the event descfription\n\n\nparse_actions as (\n select\n story_id,\n target_task_id,\n created_at,\n created_by_user_id,\n created_by_name,\n comment_content,\n case \n when action_description like 'added the name%' then 'added name' \n when action_description like 'changed the name%' then 'changed name' \n when action_description like 'removed the name' then 'removed name' \n when action_description like 'added the description%' then 'added description' \n when action_description like 'changed the description%' then 'changed description' \n when action_description like 'removed the description' then 'removed description' \n when action_description like 'added to%' then 'added to project' \n when action_description like 'removed from%' then 'removed from project' \n when action_description like 'assigned%' then 'assigned' \n when action_description like 'unassigned%' then 'unassigned' \n when action_description like 'changed the due date%' then 'changed due date' \n when action_description like 'changed the start date%due date%' then 'changed due date' \n when action_description like 'changed the start date%' then 'changed start date' \n when action_description like 'removed the due date%' then 'removed due date' \n when action_description like 'removed the date range%' then 'removed due date' \n when action_description like 'removed the start date' then 'removed start date' \n when action_description like 'added subtask%' then 'added subtask' \n when action_description like 'added%collaborator%' then 'added collaborator' \n when action_description like 'moved%' then 'moved to section' \n when action_description like 'duplicated task from%' then 'duplicated this from other task' \n when action_description like 'marked%as a duplicate of this' then 'marked other task as duplicate of this' \n when action_description like 'marked this a duplicate of%' then 'marked as duplicate' \n when action_description like 'marked this task complete' then 'completed' \n when action_description like 'completed this task' then 'completed' \n when action_description like 'marked incomplete' then 'marked incomplete' \n when action_description like 'marked this task as a milestone' then 'marked as milestone' \n when action_description like 'unmarked this task as a milestone' then 'unmarked as milestone' \n when action_description like 'marked this milestone complete' then 'completed milestone' \n when action_description like 'completed this milestone' then 'completed milestone' \n when action_description like 'attached%' then 'attachment' \n when action_description like 'liked your comment' then 'liked comment' \n when action_description like 'liked this task' then 'liked task' \n when action_description like 'liked your attachment' then 'liked attachment' \n when action_description like 'liked that you completed this task' then 'liked completion' \n when action_description like 'completed the last task you were waiting on%' then 'completed dependency' \n when action_description like 'added feedback to%' then 'added feedback' \n when action_description like 'changed%to%' then 'changed tag' \n when action_description like 'cleared%' then 'cleared tag' \n when action_description like 'comment' then 'comment' \n when action_description like 'have a task due on%' then ''\n else action_description end as action_taken,\n action_description\n \n from split_comments\n\n),\n\n\nfinal as (\n \n select * \n from parse_actions\n\n -- remove actions you don't care about (set to null in the actions dictionary above)\n where action_taken is not null \n\n)\n\n\nselect * from final\n)"}, {"id": "model.asana.int_asana__task_comments", "sql": " __dbt__cte__int_asana__task_comments as (\nwith comments as (\n \n select *\n from __dbt__cte__int_asana__task_story\n where comment_content is not null\n order by target_task_id, created_at asc\n\n),\n\ntask_conversation as (\n\n select\n target_task_id as task_id,\n -- creates a chronologically ordered conversation about the task\n \n string_agg(created_at || ' - ' || created_by_name || ': ' || comment_content, '\\n')\n\n as conversation,\n count(*) as number_of_comments\n\n from comments \n group by 1\n)\n\nselect * from task_conversation\n)"}], "relation_name": null, "column_name": "task_id", "file_key_name": "models.int_asana__task_comments"}, "test.asana.unique_int_asana__task_first_modifier_task_id.59583c6dc2": {"test_metadata": {"name": "unique", "kwargs": {"column_name": "task_id", "model": "{{ get_where_subquery(ref('int_asana__task_first_modifier')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["model.asana.int_asana__task_first_modifier"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "postgres", "schema": "asana_integrations_tests_dbt_test__audit", "fqn": ["asana", "intermediate", "unique_int_asana__task_first_modifier_task_id"], "unique_id": "test.asana.unique_int_asana__task_first_modifier_task_id.59583c6dc2", "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "language": "sql", "package_name": "asana", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/asana", "path": "unique_int_asana__task_first_modifier_task_id.sql", "original_file_path": "models/intermediate/intermediate_asana.yml", "name": "unique_int_asana__task_first_modifier_task_id", "alias": "unique_int_asana__task_first_modifier_task_id", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["int_asana__task_first_modifier"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/asana/models/intermediate/intermediate_asana.yml/unique_int_asana__task_first_modifier_task_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1671481804.803175, "compiled_code": "\n \n \n\nwith __dbt__cte__int_asana__task_story as (\nwith story as (\n \n select * \n from \"postgres\".\"asana_integrations_tests_stg_asana\".\"stg_asana__story\"\n\n),\n\nasana_user as (\n\n select * \n from \"postgres\".\"asana_integrations_tests_stg_asana\".\"stg_asana__user\"\n),\n\nstory_user as (\n select \n story.*,\n asana_user.user_name as created_by_name\n from story\n join asana_user \n on story.created_by_user_id = asana_user.user_id\n),\n\nsplit_comments as (\n\n select\n story_id,\n created_at,\n created_by_user_id,\n created_by_name,\n target_task_id,\n \n case when event_type = 'comment' then story_content \n else null end as comment_content,\n\n case when event_type = 'system' then story_content \n else 'comment' end as action_description\n \n from story_user\n\n),\n\n\n-- the next CTE uses this dictionary to parse the type of action out of the event descfription\n\n\nparse_actions as (\n select\n story_id,\n target_task_id,\n created_at,\n created_by_user_id,\n created_by_name,\n comment_content,\n case \n when action_description like 'added the name%' then 'added name' \n when action_description like 'changed the name%' then 'changed name' \n when action_description like 'removed the name' then 'removed name' \n when action_description like 'added the description%' then 'added description' \n when action_description like 'changed the description%' then 'changed description' \n when action_description like 'removed the description' then 'removed description' \n when action_description like 'added to%' then 'added to project' \n when action_description like 'removed from%' then 'removed from project' \n when action_description like 'assigned%' then 'assigned' \n when action_description like 'unassigned%' then 'unassigned' \n when action_description like 'changed the due date%' then 'changed due date' \n when action_description like 'changed the start date%due date%' then 'changed due date' \n when action_description like 'changed the start date%' then 'changed start date' \n when action_description like 'removed the due date%' then 'removed due date' \n when action_description like 'removed the date range%' then 'removed due date' \n when action_description like 'removed the start date' then 'removed start date' \n when action_description like 'added subtask%' then 'added subtask' \n when action_description like 'added%collaborator%' then 'added collaborator' \n when action_description like 'moved%' then 'moved to section' \n when action_description like 'duplicated task from%' then 'duplicated this from other task' \n when action_description like 'marked%as a duplicate of this' then 'marked other task as duplicate of this' \n when action_description like 'marked this a duplicate of%' then 'marked as duplicate' \n when action_description like 'marked this task complete' then 'completed' \n when action_description like 'completed this task' then 'completed' \n when action_description like 'marked incomplete' then 'marked incomplete' \n when action_description like 'marked this task as a milestone' then 'marked as milestone' \n when action_description like 'unmarked this task as a milestone' then 'unmarked as milestone' \n when action_description like 'marked this milestone complete' then 'completed milestone' \n when action_description like 'completed this milestone' then 'completed milestone' \n when action_description like 'attached%' then 'attachment' \n when action_description like 'liked your comment' then 'liked comment' \n when action_description like 'liked this task' then 'liked task' \n when action_description like 'liked your attachment' then 'liked attachment' \n when action_description like 'liked that you completed this task' then 'liked completion' \n when action_description like 'completed the last task you were waiting on%' then 'completed dependency' \n when action_description like 'added feedback to%' then 'added feedback' \n when action_description like 'changed%to%' then 'changed tag' \n when action_description like 'cleared%' then 'cleared tag' \n when action_description like 'comment' then 'comment' \n when action_description like 'have a task due on%' then ''\n else action_description end as action_taken,\n action_description\n \n from split_comments\n\n),\n\n\nfinal as (\n \n select * \n from parse_actions\n\n -- remove actions you don't care about (set to null in the actions dictionary above)\n where action_taken is not null \n\n)\n\n\nselect * from final\n), __dbt__cte__int_asana__task_first_modifier as (\nwith story as (\n\n select *\n from __dbt__cte__int_asana__task_story\n where created_by_user_id is not null -- sometimes user id can be null in story. limit to ones with associated users\n),\n\nordered_stories as (\n\n select \n target_task_id,\n created_by_user_id,\n created_by_name,\n created_at,\n row_number() over ( partition by target_task_id order by created_at asc ) as nth_story\n \n from story\n\n),\n\nfirst_modifier as (\n\n select \n target_task_id as task_id,\n created_by_user_id as first_modifier_user_id,\n created_by_name as first_modifier_name\n\n from ordered_stories \n where nth_story = 1\n)\n\nselect *\nfrom first_modifier\n)select\n task_id as unique_field,\n count(*) as n_records\n\nfrom __dbt__cte__int_asana__task_first_modifier\nwhere task_id is not null\ngroup by task_id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.asana.int_asana__task_story", "sql": " __dbt__cte__int_asana__task_story as (\nwith story as (\n \n select * \n from \"postgres\".\"asana_integrations_tests_stg_asana\".\"stg_asana__story\"\n\n),\n\nasana_user as (\n\n select * \n from \"postgres\".\"asana_integrations_tests_stg_asana\".\"stg_asana__user\"\n),\n\nstory_user as (\n select \n story.*,\n asana_user.user_name as created_by_name\n from story\n join asana_user \n on story.created_by_user_id = asana_user.user_id\n),\n\nsplit_comments as (\n\n select\n story_id,\n created_at,\n created_by_user_id,\n created_by_name,\n target_task_id,\n \n case when event_type = 'comment' then story_content \n else null end as comment_content,\n\n case when event_type = 'system' then story_content \n else 'comment' end as action_description\n \n from story_user\n\n),\n\n\n-- the next CTE uses this dictionary to parse the type of action out of the event descfription\n\n\nparse_actions as (\n select\n story_id,\n target_task_id,\n created_at,\n created_by_user_id,\n created_by_name,\n comment_content,\n case \n when action_description like 'added the name%' then 'added name' \n when action_description like 'changed the name%' then 'changed name' \n when action_description like 'removed the name' then 'removed name' \n when action_description like 'added the description%' then 'added description' \n when action_description like 'changed the description%' then 'changed description' \n when action_description like 'removed the description' then 'removed description' \n when action_description like 'added to%' then 'added to project' \n when action_description like 'removed from%' then 'removed from project' \n when action_description like 'assigned%' then 'assigned' \n when action_description like 'unassigned%' then 'unassigned' \n when action_description like 'changed the due date%' then 'changed due date' \n when action_description like 'changed the start date%due date%' then 'changed due date' \n when action_description like 'changed the start date%' then 'changed start date' \n when action_description like 'removed the due date%' then 'removed due date' \n when action_description like 'removed the date range%' then 'removed due date' \n when action_description like 'removed the start date' then 'removed start date' \n when action_description like 'added subtask%' then 'added subtask' \n when action_description like 'added%collaborator%' then 'added collaborator' \n when action_description like 'moved%' then 'moved to section' \n when action_description like 'duplicated task from%' then 'duplicated this from other task' \n when action_description like 'marked%as a duplicate of this' then 'marked other task as duplicate of this' \n when action_description like 'marked this a duplicate of%' then 'marked as duplicate' \n when action_description like 'marked this task complete' then 'completed' \n when action_description like 'completed this task' then 'completed' \n when action_description like 'marked incomplete' then 'marked incomplete' \n when action_description like 'marked this task as a milestone' then 'marked as milestone' \n when action_description like 'unmarked this task as a milestone' then 'unmarked as milestone' \n when action_description like 'marked this milestone complete' then 'completed milestone' \n when action_description like 'completed this milestone' then 'completed milestone' \n when action_description like 'attached%' then 'attachment' \n when action_description like 'liked your comment' then 'liked comment' \n when action_description like 'liked this task' then 'liked task' \n when action_description like 'liked your attachment' then 'liked attachment' \n when action_description like 'liked that you completed this task' then 'liked completion' \n when action_description like 'completed the last task you were waiting on%' then 'completed dependency' \n when action_description like 'added feedback to%' then 'added feedback' \n when action_description like 'changed%to%' then 'changed tag' \n when action_description like 'cleared%' then 'cleared tag' \n when action_description like 'comment' then 'comment' \n when action_description like 'have a task due on%' then ''\n else action_description end as action_taken,\n action_description\n \n from split_comments\n\n),\n\n\nfinal as (\n \n select * \n from parse_actions\n\n -- remove actions you don't care about (set to null in the actions dictionary above)\n where action_taken is not null \n\n)\n\n\nselect * from final\n)"}, {"id": "model.asana.int_asana__task_first_modifier", "sql": " __dbt__cte__int_asana__task_first_modifier as (\nwith story as (\n\n select *\n from __dbt__cte__int_asana__task_story\n where created_by_user_id is not null -- sometimes user id can be null in story. limit to ones with associated users\n),\n\nordered_stories as (\n\n select \n target_task_id,\n created_by_user_id,\n created_by_name,\n created_at,\n row_number() over ( partition by target_task_id order by created_at asc ) as nth_story\n \n from story\n\n),\n\nfirst_modifier as (\n\n select \n target_task_id as task_id,\n created_by_user_id as first_modifier_user_id,\n created_by_name as first_modifier_name\n\n from ordered_stories \n where nth_story = 1\n)\n\nselect *\nfrom first_modifier\n)"}], "relation_name": null, "column_name": "task_id", "file_key_name": "models.int_asana__task_first_modifier"}, "test.asana.not_null_int_asana__task_first_modifier_task_id.495738ff52": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "task_id", "model": "{{ get_where_subquery(ref('int_asana__task_first_modifier')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.asana.int_asana__task_first_modifier"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "postgres", "schema": "asana_integrations_tests_dbt_test__audit", "fqn": ["asana", "intermediate", "not_null_int_asana__task_first_modifier_task_id"], "unique_id": "test.asana.not_null_int_asana__task_first_modifier_task_id.495738ff52", "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "package_name": "asana", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/asana", "path": "not_null_int_asana__task_first_modifier_task_id.sql", "original_file_path": "models/intermediate/intermediate_asana.yml", "name": "not_null_int_asana__task_first_modifier_task_id", "alias": "not_null_int_asana__task_first_modifier_task_id", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["int_asana__task_first_modifier"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/asana/models/intermediate/intermediate_asana.yml/not_null_int_asana__task_first_modifier_task_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1671481804.804203, "compiled_code": "\n \n \n\n\n\nwith __dbt__cte__int_asana__task_story as (\nwith story as (\n \n select * \n from \"postgres\".\"asana_integrations_tests_stg_asana\".\"stg_asana__story\"\n\n),\n\nasana_user as (\n\n select * \n from \"postgres\".\"asana_integrations_tests_stg_asana\".\"stg_asana__user\"\n),\n\nstory_user as (\n select \n story.*,\n asana_user.user_name as created_by_name\n from story\n join asana_user \n on story.created_by_user_id = asana_user.user_id\n),\n\nsplit_comments as (\n\n select\n story_id,\n created_at,\n created_by_user_id,\n created_by_name,\n target_task_id,\n \n case when event_type = 'comment' then story_content \n else null end as comment_content,\n\n case when event_type = 'system' then story_content \n else 'comment' end as action_description\n \n from story_user\n\n),\n\n\n-- the next CTE uses this dictionary to parse the type of action out of the event descfription\n\n\nparse_actions as (\n select\n story_id,\n target_task_id,\n created_at,\n created_by_user_id,\n created_by_name,\n comment_content,\n case \n when action_description like 'added the name%' then 'added name' \n when action_description like 'changed the name%' then 'changed name' \n when action_description like 'removed the name' then 'removed name' \n when action_description like 'added the description%' then 'added description' \n when action_description like 'changed the description%' then 'changed description' \n when action_description like 'removed the description' then 'removed description' \n when action_description like 'added to%' then 'added to project' \n when action_description like 'removed from%' then 'removed from project' \n when action_description like 'assigned%' then 'assigned' \n when action_description like 'unassigned%' then 'unassigned' \n when action_description like 'changed the due date%' then 'changed due date' \n when action_description like 'changed the start date%due date%' then 'changed due date' \n when action_description like 'changed the start date%' then 'changed start date' \n when action_description like 'removed the due date%' then 'removed due date' \n when action_description like 'removed the date range%' then 'removed due date' \n when action_description like 'removed the start date' then 'removed start date' \n when action_description like 'added subtask%' then 'added subtask' \n when action_description like 'added%collaborator%' then 'added collaborator' \n when action_description like 'moved%' then 'moved to section' \n when action_description like 'duplicated task from%' then 'duplicated this from other task' \n when action_description like 'marked%as a duplicate of this' then 'marked other task as duplicate of this' \n when action_description like 'marked this a duplicate of%' then 'marked as duplicate' \n when action_description like 'marked this task complete' then 'completed' \n when action_description like 'completed this task' then 'completed' \n when action_description like 'marked incomplete' then 'marked incomplete' \n when action_description like 'marked this task as a milestone' then 'marked as milestone' \n when action_description like 'unmarked this task as a milestone' then 'unmarked as milestone' \n when action_description like 'marked this milestone complete' then 'completed milestone' \n when action_description like 'completed this milestone' then 'completed milestone' \n when action_description like 'attached%' then 'attachment' \n when action_description like 'liked your comment' then 'liked comment' \n when action_description like 'liked this task' then 'liked task' \n when action_description like 'liked your attachment' then 'liked attachment' \n when action_description like 'liked that you completed this task' then 'liked completion' \n when action_description like 'completed the last task you were waiting on%' then 'completed dependency' \n when action_description like 'added feedback to%' then 'added feedback' \n when action_description like 'changed%to%' then 'changed tag' \n when action_description like 'cleared%' then 'cleared tag' \n when action_description like 'comment' then 'comment' \n when action_description like 'have a task due on%' then ''\n else action_description end as action_taken,\n action_description\n \n from split_comments\n\n),\n\n\nfinal as (\n \n select * \n from parse_actions\n\n -- remove actions you don't care about (set to null in the actions dictionary above)\n where action_taken is not null \n\n)\n\n\nselect * from final\n), __dbt__cte__int_asana__task_first_modifier as (\nwith story as (\n\n select *\n from __dbt__cte__int_asana__task_story\n where created_by_user_id is not null -- sometimes user id can be null in story. limit to ones with associated users\n),\n\nordered_stories as (\n\n select \n target_task_id,\n created_by_user_id,\n created_by_name,\n created_at,\n row_number() over ( partition by target_task_id order by created_at asc ) as nth_story\n \n from story\n\n),\n\nfirst_modifier as (\n\n select \n target_task_id as task_id,\n created_by_user_id as first_modifier_user_id,\n created_by_name as first_modifier_name\n\n from ordered_stories \n where nth_story = 1\n)\n\nselect *\nfrom first_modifier\n)select task_id\nfrom __dbt__cte__int_asana__task_first_modifier\nwhere task_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.asana.int_asana__task_story", "sql": " __dbt__cte__int_asana__task_story as (\nwith story as (\n \n select * \n from \"postgres\".\"asana_integrations_tests_stg_asana\".\"stg_asana__story\"\n\n),\n\nasana_user as (\n\n select * \n from \"postgres\".\"asana_integrations_tests_stg_asana\".\"stg_asana__user\"\n),\n\nstory_user as (\n select \n story.*,\n asana_user.user_name as created_by_name\n from story\n join asana_user \n on story.created_by_user_id = asana_user.user_id\n),\n\nsplit_comments as (\n\n select\n story_id,\n created_at,\n created_by_user_id,\n created_by_name,\n target_task_id,\n \n case when event_type = 'comment' then story_content \n else null end as comment_content,\n\n case when event_type = 'system' then story_content \n else 'comment' end as action_description\n \n from story_user\n\n),\n\n\n-- the next CTE uses this dictionary to parse the type of action out of the event descfription\n\n\nparse_actions as (\n select\n story_id,\n target_task_id,\n created_at,\n created_by_user_id,\n created_by_name,\n comment_content,\n case \n when action_description like 'added the name%' then 'added name' \n when action_description like 'changed the name%' then 'changed name' \n when action_description like 'removed the name' then 'removed name' \n when action_description like 'added the description%' then 'added description' \n when action_description like 'changed the description%' then 'changed description' \n when action_description like 'removed the description' then 'removed description' \n when action_description like 'added to%' then 'added to project' \n when action_description like 'removed from%' then 'removed from project' \n when action_description like 'assigned%' then 'assigned' \n when action_description like 'unassigned%' then 'unassigned' \n when action_description like 'changed the due date%' then 'changed due date' \n when action_description like 'changed the start date%due date%' then 'changed due date' \n when action_description like 'changed the start date%' then 'changed start date' \n when action_description like 'removed the due date%' then 'removed due date' \n when action_description like 'removed the date range%' then 'removed due date' \n when action_description like 'removed the start date' then 'removed start date' \n when action_description like 'added subtask%' then 'added subtask' \n when action_description like 'added%collaborator%' then 'added collaborator' \n when action_description like 'moved%' then 'moved to section' \n when action_description like 'duplicated task from%' then 'duplicated this from other task' \n when action_description like 'marked%as a duplicate of this' then 'marked other task as duplicate of this' \n when action_description like 'marked this a duplicate of%' then 'marked as duplicate' \n when action_description like 'marked this task complete' then 'completed' \n when action_description like 'completed this task' then 'completed' \n when action_description like 'marked incomplete' then 'marked incomplete' \n when action_description like 'marked this task as a milestone' then 'marked as milestone' \n when action_description like 'unmarked this task as a milestone' then 'unmarked as milestone' \n when action_description like 'marked this milestone complete' then 'completed milestone' \n when action_description like 'completed this milestone' then 'completed milestone' \n when action_description like 'attached%' then 'attachment' \n when action_description like 'liked your comment' then 'liked comment' \n when action_description like 'liked this task' then 'liked task' \n when action_description like 'liked your attachment' then 'liked attachment' \n when action_description like 'liked that you completed this task' then 'liked completion' \n when action_description like 'completed the last task you were waiting on%' then 'completed dependency' \n when action_description like 'added feedback to%' then 'added feedback' \n when action_description like 'changed%to%' then 'changed tag' \n when action_description like 'cleared%' then 'cleared tag' \n when action_description like 'comment' then 'comment' \n when action_description like 'have a task due on%' then ''\n else action_description end as action_taken,\n action_description\n \n from split_comments\n\n),\n\n\nfinal as (\n \n select * \n from parse_actions\n\n -- remove actions you don't care about (set to null in the actions dictionary above)\n where action_taken is not null \n\n)\n\n\nselect * from final\n)"}, {"id": "model.asana.int_asana__task_first_modifier", "sql": " __dbt__cte__int_asana__task_first_modifier as (\nwith story as (\n\n select *\n from __dbt__cte__int_asana__task_story\n where created_by_user_id is not null -- sometimes user id can be null in story. limit to ones with associated users\n),\n\nordered_stories as (\n\n select \n target_task_id,\n created_by_user_id,\n created_by_name,\n created_at,\n row_number() over ( partition by target_task_id order by created_at asc ) as nth_story\n \n from story\n\n),\n\nfirst_modifier as (\n\n select \n target_task_id as task_id,\n created_by_user_id as first_modifier_user_id,\n created_by_name as first_modifier_name\n\n from ordered_stories \n where nth_story = 1\n)\n\nselect *\nfrom first_modifier\n)"}], "relation_name": null, "column_name": "task_id", "file_key_name": "models.int_asana__task_first_modifier"}, "test.asana.unique_int_asana__task_followers_task_id.eeb3667df9": {"test_metadata": {"name": "unique", "kwargs": {"column_name": "task_id", "model": "{{ get_where_subquery(ref('int_asana__task_followers')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["model.asana.int_asana__task_followers"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "postgres", "schema": "asana_integrations_tests_dbt_test__audit", "fqn": ["asana", "intermediate", "unique_int_asana__task_followers_task_id"], "unique_id": "test.asana.unique_int_asana__task_followers_task_id.eeb3667df9", "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "language": "sql", "package_name": "asana", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/asana", "path": "unique_int_asana__task_followers_task_id.sql", "original_file_path": "models/intermediate/intermediate_asana.yml", "name": "unique_int_asana__task_followers_task_id", "alias": "unique_int_asana__task_followers_task_id", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["int_asana__task_followers"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/asana/models/intermediate/intermediate_asana.yml/unique_int_asana__task_followers_task_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1671481804.8051982, "compiled_code": "\n \n \n\nwith __dbt__cte__int_asana__task_followers as (\nwith task_follower as (\n \n select *\n from \"postgres\".\"asana_integrations_tests_stg_asana\".\"stg_asana__task_follower\"\n\n),\n\nasana_user as (\n\n select * \n from \"postgres\".\"asana_integrations_tests_stg_asana\".\"stg_asana__user\"\n\n),\n\nagg_followers as (\n\n select\n task_follower.task_id,\n \n string_agg(asana_user.user_name, ', ')\n\n as followers,\n count(*) as number_of_followers\n from task_follower \n join asana_user \n on asana_user.user_id = task_follower.user_id\n group by 1\n \n)\n\nselect * from agg_followers\n)select\n task_id as unique_field,\n count(*) as n_records\n\nfrom __dbt__cte__int_asana__task_followers\nwhere task_id is not null\ngroup by task_id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.asana.int_asana__task_followers", "sql": " __dbt__cte__int_asana__task_followers as (\nwith task_follower as (\n \n select *\n from \"postgres\".\"asana_integrations_tests_stg_asana\".\"stg_asana__task_follower\"\n\n),\n\nasana_user as (\n\n select * \n from \"postgres\".\"asana_integrations_tests_stg_asana\".\"stg_asana__user\"\n\n),\n\nagg_followers as (\n\n select\n task_follower.task_id,\n \n string_agg(asana_user.user_name, ', ')\n\n as followers,\n count(*) as number_of_followers\n from task_follower \n join asana_user \n on asana_user.user_id = task_follower.user_id\n group by 1\n \n)\n\nselect * from agg_followers\n)"}], "relation_name": null, "column_name": "task_id", "file_key_name": "models.int_asana__task_followers"}, "test.asana.not_null_int_asana__task_followers_task_id.6791bf2573": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "task_id", "model": "{{ get_where_subquery(ref('int_asana__task_followers')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.asana.int_asana__task_followers"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "postgres", "schema": "asana_integrations_tests_dbt_test__audit", "fqn": ["asana", "intermediate", "not_null_int_asana__task_followers_task_id"], "unique_id": "test.asana.not_null_int_asana__task_followers_task_id.6791bf2573", "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "package_name": "asana", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/asana", "path": "not_null_int_asana__task_followers_task_id.sql", "original_file_path": "models/intermediate/intermediate_asana.yml", "name": "not_null_int_asana__task_followers_task_id", "alias": "not_null_int_asana__task_followers_task_id", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["int_asana__task_followers"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/asana/models/intermediate/intermediate_asana.yml/not_null_int_asana__task_followers_task_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1671481804.806346, "compiled_code": "\n \n \n\n\n\nwith __dbt__cte__int_asana__task_followers as (\nwith task_follower as (\n \n select *\n from \"postgres\".\"asana_integrations_tests_stg_asana\".\"stg_asana__task_follower\"\n\n),\n\nasana_user as (\n\n select * \n from \"postgres\".\"asana_integrations_tests_stg_asana\".\"stg_asana__user\"\n\n),\n\nagg_followers as (\n\n select\n task_follower.task_id,\n \n string_agg(asana_user.user_name, ', ')\n\n as followers,\n count(*) as number_of_followers\n from task_follower \n join asana_user \n on asana_user.user_id = task_follower.user_id\n group by 1\n \n)\n\nselect * from agg_followers\n)select task_id\nfrom __dbt__cte__int_asana__task_followers\nwhere task_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.asana.int_asana__task_followers", "sql": " __dbt__cte__int_asana__task_followers as (\nwith task_follower as (\n \n select *\n from \"postgres\".\"asana_integrations_tests_stg_asana\".\"stg_asana__task_follower\"\n\n),\n\nasana_user as (\n\n select * \n from \"postgres\".\"asana_integrations_tests_stg_asana\".\"stg_asana__user\"\n\n),\n\nagg_followers as (\n\n select\n task_follower.task_id,\n \n string_agg(asana_user.user_name, ', ')\n\n as followers,\n count(*) as number_of_followers\n from task_follower \n join asana_user \n on asana_user.user_id = task_follower.user_id\n group by 1\n \n)\n\nselect * from agg_followers\n)"}], "relation_name": null, "column_name": "task_id", "file_key_name": "models.int_asana__task_followers"}, "test.asana.unique_int_asana__task_open_length_task_id.f26c49b044": {"test_metadata": {"name": "unique", "kwargs": {"column_name": "task_id", "model": "{{ get_where_subquery(ref('int_asana__task_open_length')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["model.asana.int_asana__task_open_length"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "postgres", "schema": "asana_integrations_tests_dbt_test__audit", "fqn": ["asana", "intermediate", "unique_int_asana__task_open_length_task_id"], "unique_id": "test.asana.unique_int_asana__task_open_length_task_id.f26c49b044", "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "language": "sql", "package_name": "asana", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/asana", "path": "unique_int_asana__task_open_length_task_id.sql", "original_file_path": "models/intermediate/intermediate_asana.yml", "name": "unique_int_asana__task_open_length_task_id", "alias": "unique_int_asana__task_open_length_task_id", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["int_asana__task_open_length"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/asana/models/intermediate/intermediate_asana.yml/unique_int_asana__task_open_length_task_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1671481804.807347, "compiled_code": "\n \n \n\nwith __dbt__cte__int_asana__task_story as (\nwith story as (\n \n select * \n from \"postgres\".\"asana_integrations_tests_stg_asana\".\"stg_asana__story\"\n\n),\n\nasana_user as (\n\n select * \n from \"postgres\".\"asana_integrations_tests_stg_asana\".\"stg_asana__user\"\n),\n\nstory_user as (\n select \n story.*,\n asana_user.user_name as created_by_name\n from story\n join asana_user \n on story.created_by_user_id = asana_user.user_id\n),\n\nsplit_comments as (\n\n select\n story_id,\n created_at,\n created_by_user_id,\n created_by_name,\n target_task_id,\n \n case when event_type = 'comment' then story_content \n else null end as comment_content,\n\n case when event_type = 'system' then story_content \n else 'comment' end as action_description\n \n from story_user\n\n),\n\n\n-- the next CTE uses this dictionary to parse the type of action out of the event descfription\n\n\nparse_actions as (\n select\n story_id,\n target_task_id,\n created_at,\n created_by_user_id,\n created_by_name,\n comment_content,\n case \n when action_description like 'added the name%' then 'added name' \n when action_description like 'changed the name%' then 'changed name' \n when action_description like 'removed the name' then 'removed name' \n when action_description like 'added the description%' then 'added description' \n when action_description like 'changed the description%' then 'changed description' \n when action_description like 'removed the description' then 'removed description' \n when action_description like 'added to%' then 'added to project' \n when action_description like 'removed from%' then 'removed from project' \n when action_description like 'assigned%' then 'assigned' \n when action_description like 'unassigned%' then 'unassigned' \n when action_description like 'changed the due date%' then 'changed due date' \n when action_description like 'changed the start date%due date%' then 'changed due date' \n when action_description like 'changed the start date%' then 'changed start date' \n when action_description like 'removed the due date%' then 'removed due date' \n when action_description like 'removed the date range%' then 'removed due date' \n when action_description like 'removed the start date' then 'removed start date' \n when action_description like 'added subtask%' then 'added subtask' \n when action_description like 'added%collaborator%' then 'added collaborator' \n when action_description like 'moved%' then 'moved to section' \n when action_description like 'duplicated task from%' then 'duplicated this from other task' \n when action_description like 'marked%as a duplicate of this' then 'marked other task as duplicate of this' \n when action_description like 'marked this a duplicate of%' then 'marked as duplicate' \n when action_description like 'marked this task complete' then 'completed' \n when action_description like 'completed this task' then 'completed' \n when action_description like 'marked incomplete' then 'marked incomplete' \n when action_description like 'marked this task as a milestone' then 'marked as milestone' \n when action_description like 'unmarked this task as a milestone' then 'unmarked as milestone' \n when action_description like 'marked this milestone complete' then 'completed milestone' \n when action_description like 'completed this milestone' then 'completed milestone' \n when action_description like 'attached%' then 'attachment' \n when action_description like 'liked your comment' then 'liked comment' \n when action_description like 'liked this task' then 'liked task' \n when action_description like 'liked your attachment' then 'liked attachment' \n when action_description like 'liked that you completed this task' then 'liked completion' \n when action_description like 'completed the last task you were waiting on%' then 'completed dependency' \n when action_description like 'added feedback to%' then 'added feedback' \n when action_description like 'changed%to%' then 'changed tag' \n when action_description like 'cleared%' then 'cleared tag' \n when action_description like 'comment' then 'comment' \n when action_description like 'have a task due on%' then ''\n else action_description end as action_taken,\n action_description\n \n from split_comments\n\n),\n\n\nfinal as (\n \n select * \n from parse_actions\n\n -- remove actions you don't care about (set to null in the actions dictionary above)\n where action_taken is not null \n\n)\n\n\nselect * from final\n), __dbt__cte__int_asana__task_open_length as (\nwith task as (\n \n select *\n from \"postgres\".\"asana_integrations_tests_stg_asana\".\"stg_asana__task\"\n\n),\n\nstory as (\n\n select * \n from __dbt__cte__int_asana__task_story\n\n),\n\nassignments as (\n \n select \n target_task_id as task_id,\n min(created_at) as first_assigned_at,\n max(created_at) as last_assigned_at -- current assignment\n\n from story\n where action_taken = 'assigned'\n\n group by 1\n\n),\n\n\nopen_assigned_length as (\n\n \n\n select\n task.task_id,\n task.is_completed,\n task.completed_at,\n task.assignee_user_id is not null as is_currently_assigned,\n assignments.task_id is not null as has_been_assigned,\n assignments.last_assigned_at as last_assigned_at,\n assignments.first_assigned_at as first_assigned_at,\n \n ((\n current_timestamp::TIMESTAMP\n)::date - (task.created_at)::date)\n as days_open,\n\n -- if the task is currently assigned, this is the time it has been assigned to this current user.\n \n ((\n current_timestamp::TIMESTAMP\n)::date - (assignments.last_assigned_at)::date)\n as days_since_last_assignment,\n\n \n ((\n current_timestamp::TIMESTAMP\n)::date - (assignments.first_assigned_at)::date)\n as days_since_first_assignment\n \n\n from task\n left join assignments \n on task.task_id = assignments.task_id\n\n)\n\n\nselect * from open_assigned_length\n)select\n task_id as unique_field,\n count(*) as n_records\n\nfrom __dbt__cte__int_asana__task_open_length\nwhere task_id is not null\ngroup by task_id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.asana.int_asana__task_story", "sql": " __dbt__cte__int_asana__task_story as (\nwith story as (\n \n select * \n from \"postgres\".\"asana_integrations_tests_stg_asana\".\"stg_asana__story\"\n\n),\n\nasana_user as (\n\n select * \n from \"postgres\".\"asana_integrations_tests_stg_asana\".\"stg_asana__user\"\n),\n\nstory_user as (\n select \n story.*,\n asana_user.user_name as created_by_name\n from story\n join asana_user \n on story.created_by_user_id = asana_user.user_id\n),\n\nsplit_comments as (\n\n select\n story_id,\n created_at,\n created_by_user_id,\n created_by_name,\n target_task_id,\n \n case when event_type = 'comment' then story_content \n else null end as comment_content,\n\n case when event_type = 'system' then story_content \n else 'comment' end as action_description\n \n from story_user\n\n),\n\n\n-- the next CTE uses this dictionary to parse the type of action out of the event descfription\n\n\nparse_actions as (\n select\n story_id,\n target_task_id,\n created_at,\n created_by_user_id,\n created_by_name,\n comment_content,\n case \n when action_description like 'added the name%' then 'added name' \n when action_description like 'changed the name%' then 'changed name' \n when action_description like 'removed the name' then 'removed name' \n when action_description like 'added the description%' then 'added description' \n when action_description like 'changed the description%' then 'changed description' \n when action_description like 'removed the description' then 'removed description' \n when action_description like 'added to%' then 'added to project' \n when action_description like 'removed from%' then 'removed from project' \n when action_description like 'assigned%' then 'assigned' \n when action_description like 'unassigned%' then 'unassigned' \n when action_description like 'changed the due date%' then 'changed due date' \n when action_description like 'changed the start date%due date%' then 'changed due date' \n when action_description like 'changed the start date%' then 'changed start date' \n when action_description like 'removed the due date%' then 'removed due date' \n when action_description like 'removed the date range%' then 'removed due date' \n when action_description like 'removed the start date' then 'removed start date' \n when action_description like 'added subtask%' then 'added subtask' \n when action_description like 'added%collaborator%' then 'added collaborator' \n when action_description like 'moved%' then 'moved to section' \n when action_description like 'duplicated task from%' then 'duplicated this from other task' \n when action_description like 'marked%as a duplicate of this' then 'marked other task as duplicate of this' \n when action_description like 'marked this a duplicate of%' then 'marked as duplicate' \n when action_description like 'marked this task complete' then 'completed' \n when action_description like 'completed this task' then 'completed' \n when action_description like 'marked incomplete' then 'marked incomplete' \n when action_description like 'marked this task as a milestone' then 'marked as milestone' \n when action_description like 'unmarked this task as a milestone' then 'unmarked as milestone' \n when action_description like 'marked this milestone complete' then 'completed milestone' \n when action_description like 'completed this milestone' then 'completed milestone' \n when action_description like 'attached%' then 'attachment' \n when action_description like 'liked your comment' then 'liked comment' \n when action_description like 'liked this task' then 'liked task' \n when action_description like 'liked your attachment' then 'liked attachment' \n when action_description like 'liked that you completed this task' then 'liked completion' \n when action_description like 'completed the last task you were waiting on%' then 'completed dependency' \n when action_description like 'added feedback to%' then 'added feedback' \n when action_description like 'changed%to%' then 'changed tag' \n when action_description like 'cleared%' then 'cleared tag' \n when action_description like 'comment' then 'comment' \n when action_description like 'have a task due on%' then ''\n else action_description end as action_taken,\n action_description\n \n from split_comments\n\n),\n\n\nfinal as (\n \n select * \n from parse_actions\n\n -- remove actions you don't care about (set to null in the actions dictionary above)\n where action_taken is not null \n\n)\n\n\nselect * from final\n)"}, {"id": "model.asana.int_asana__task_open_length", "sql": " __dbt__cte__int_asana__task_open_length as (\nwith task as (\n \n select *\n from \"postgres\".\"asana_integrations_tests_stg_asana\".\"stg_asana__task\"\n\n),\n\nstory as (\n\n select * \n from __dbt__cte__int_asana__task_story\n\n),\n\nassignments as (\n \n select \n target_task_id as task_id,\n min(created_at) as first_assigned_at,\n max(created_at) as last_assigned_at -- current assignment\n\n from story\n where action_taken = 'assigned'\n\n group by 1\n\n),\n\n\nopen_assigned_length as (\n\n \n\n select\n task.task_id,\n task.is_completed,\n task.completed_at,\n task.assignee_user_id is not null as is_currently_assigned,\n assignments.task_id is not null as has_been_assigned,\n assignments.last_assigned_at as last_assigned_at,\n assignments.first_assigned_at as first_assigned_at,\n \n ((\n current_timestamp::TIMESTAMP\n)::date - (task.created_at)::date)\n as days_open,\n\n -- if the task is currently assigned, this is the time it has been assigned to this current user.\n \n ((\n current_timestamp::TIMESTAMP\n)::date - (assignments.last_assigned_at)::date)\n as days_since_last_assignment,\n\n \n ((\n current_timestamp::TIMESTAMP\n)::date - (assignments.first_assigned_at)::date)\n as days_since_first_assignment\n \n\n from task\n left join assignments \n on task.task_id = assignments.task_id\n\n)\n\n\nselect * from open_assigned_length\n)"}], "relation_name": null, "column_name": "task_id", "file_key_name": "models.int_asana__task_open_length"}, "test.asana.not_null_int_asana__task_open_length_task_id.23bb23b2e9": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "task_id", "model": "{{ get_where_subquery(ref('int_asana__task_open_length')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.asana.int_asana__task_open_length"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "postgres", "schema": "asana_integrations_tests_dbt_test__audit", "fqn": ["asana", "intermediate", "not_null_int_asana__task_open_length_task_id"], "unique_id": "test.asana.not_null_int_asana__task_open_length_task_id.23bb23b2e9", "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "package_name": "asana", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/asana", "path": "not_null_int_asana__task_open_length_task_id.sql", "original_file_path": "models/intermediate/intermediate_asana.yml", "name": "not_null_int_asana__task_open_length_task_id", "alias": "not_null_int_asana__task_open_length_task_id", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["int_asana__task_open_length"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/asana/models/intermediate/intermediate_asana.yml/not_null_int_asana__task_open_length_task_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1671481804.808345, "compiled_code": "\n \n \n\n\n\nwith __dbt__cte__int_asana__task_story as (\nwith story as (\n \n select * \n from \"postgres\".\"asana_integrations_tests_stg_asana\".\"stg_asana__story\"\n\n),\n\nasana_user as (\n\n select * \n from \"postgres\".\"asana_integrations_tests_stg_asana\".\"stg_asana__user\"\n),\n\nstory_user as (\n select \n story.*,\n asana_user.user_name as created_by_name\n from story\n join asana_user \n on story.created_by_user_id = asana_user.user_id\n),\n\nsplit_comments as (\n\n select\n story_id,\n created_at,\n created_by_user_id,\n created_by_name,\n target_task_id,\n \n case when event_type = 'comment' then story_content \n else null end as comment_content,\n\n case when event_type = 'system' then story_content \n else 'comment' end as action_description\n \n from story_user\n\n),\n\n\n-- the next CTE uses this dictionary to parse the type of action out of the event descfription\n\n\nparse_actions as (\n select\n story_id,\n target_task_id,\n created_at,\n created_by_user_id,\n created_by_name,\n comment_content,\n case \n when action_description like 'added the name%' then 'added name' \n when action_description like 'changed the name%' then 'changed name' \n when action_description like 'removed the name' then 'removed name' \n when action_description like 'added the description%' then 'added description' \n when action_description like 'changed the description%' then 'changed description' \n when action_description like 'removed the description' then 'removed description' \n when action_description like 'added to%' then 'added to project' \n when action_description like 'removed from%' then 'removed from project' \n when action_description like 'assigned%' then 'assigned' \n when action_description like 'unassigned%' then 'unassigned' \n when action_description like 'changed the due date%' then 'changed due date' \n when action_description like 'changed the start date%due date%' then 'changed due date' \n when action_description like 'changed the start date%' then 'changed start date' \n when action_description like 'removed the due date%' then 'removed due date' \n when action_description like 'removed the date range%' then 'removed due date' \n when action_description like 'removed the start date' then 'removed start date' \n when action_description like 'added subtask%' then 'added subtask' \n when action_description like 'added%collaborator%' then 'added collaborator' \n when action_description like 'moved%' then 'moved to section' \n when action_description like 'duplicated task from%' then 'duplicated this from other task' \n when action_description like 'marked%as a duplicate of this' then 'marked other task as duplicate of this' \n when action_description like 'marked this a duplicate of%' then 'marked as duplicate' \n when action_description like 'marked this task complete' then 'completed' \n when action_description like 'completed this task' then 'completed' \n when action_description like 'marked incomplete' then 'marked incomplete' \n when action_description like 'marked this task as a milestone' then 'marked as milestone' \n when action_description like 'unmarked this task as a milestone' then 'unmarked as milestone' \n when action_description like 'marked this milestone complete' then 'completed milestone' \n when action_description like 'completed this milestone' then 'completed milestone' \n when action_description like 'attached%' then 'attachment' \n when action_description like 'liked your comment' then 'liked comment' \n when action_description like 'liked this task' then 'liked task' \n when action_description like 'liked your attachment' then 'liked attachment' \n when action_description like 'liked that you completed this task' then 'liked completion' \n when action_description like 'completed the last task you were waiting on%' then 'completed dependency' \n when action_description like 'added feedback to%' then 'added feedback' \n when action_description like 'changed%to%' then 'changed tag' \n when action_description like 'cleared%' then 'cleared tag' \n when action_description like 'comment' then 'comment' \n when action_description like 'have a task due on%' then ''\n else action_description end as action_taken,\n action_description\n \n from split_comments\n\n),\n\n\nfinal as (\n \n select * \n from parse_actions\n\n -- remove actions you don't care about (set to null in the actions dictionary above)\n where action_taken is not null \n\n)\n\n\nselect * from final\n), __dbt__cte__int_asana__task_open_length as (\nwith task as (\n \n select *\n from \"postgres\".\"asana_integrations_tests_stg_asana\".\"stg_asana__task\"\n\n),\n\nstory as (\n\n select * \n from __dbt__cte__int_asana__task_story\n\n),\n\nassignments as (\n \n select \n target_task_id as task_id,\n min(created_at) as first_assigned_at,\n max(created_at) as last_assigned_at -- current assignment\n\n from story\n where action_taken = 'assigned'\n\n group by 1\n\n),\n\n\nopen_assigned_length as (\n\n \n\n select\n task.task_id,\n task.is_completed,\n task.completed_at,\n task.assignee_user_id is not null as is_currently_assigned,\n assignments.task_id is not null as has_been_assigned,\n assignments.last_assigned_at as last_assigned_at,\n assignments.first_assigned_at as first_assigned_at,\n \n ((\n current_timestamp::TIMESTAMP\n)::date - (task.created_at)::date)\n as days_open,\n\n -- if the task is currently assigned, this is the time it has been assigned to this current user.\n \n ((\n current_timestamp::TIMESTAMP\n)::date - (assignments.last_assigned_at)::date)\n as days_since_last_assignment,\n\n \n ((\n current_timestamp::TIMESTAMP\n)::date - (assignments.first_assigned_at)::date)\n as days_since_first_assignment\n \n\n from task\n left join assignments \n on task.task_id = assignments.task_id\n\n)\n\n\nselect * from open_assigned_length\n)select task_id\nfrom __dbt__cte__int_asana__task_open_length\nwhere task_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.asana.int_asana__task_story", "sql": " __dbt__cte__int_asana__task_story as (\nwith story as (\n \n select * \n from \"postgres\".\"asana_integrations_tests_stg_asana\".\"stg_asana__story\"\n\n),\n\nasana_user as (\n\n select * \n from \"postgres\".\"asana_integrations_tests_stg_asana\".\"stg_asana__user\"\n),\n\nstory_user as (\n select \n story.*,\n asana_user.user_name as created_by_name\n from story\n join asana_user \n on story.created_by_user_id = asana_user.user_id\n),\n\nsplit_comments as (\n\n select\n story_id,\n created_at,\n created_by_user_id,\n created_by_name,\n target_task_id,\n \n case when event_type = 'comment' then story_content \n else null end as comment_content,\n\n case when event_type = 'system' then story_content \n else 'comment' end as action_description\n \n from story_user\n\n),\n\n\n-- the next CTE uses this dictionary to parse the type of action out of the event descfription\n\n\nparse_actions as (\n select\n story_id,\n target_task_id,\n created_at,\n created_by_user_id,\n created_by_name,\n comment_content,\n case \n when action_description like 'added the name%' then 'added name' \n when action_description like 'changed the name%' then 'changed name' \n when action_description like 'removed the name' then 'removed name' \n when action_description like 'added the description%' then 'added description' \n when action_description like 'changed the description%' then 'changed description' \n when action_description like 'removed the description' then 'removed description' \n when action_description like 'added to%' then 'added to project' \n when action_description like 'removed from%' then 'removed from project' \n when action_description like 'assigned%' then 'assigned' \n when action_description like 'unassigned%' then 'unassigned' \n when action_description like 'changed the due date%' then 'changed due date' \n when action_description like 'changed the start date%due date%' then 'changed due date' \n when action_description like 'changed the start date%' then 'changed start date' \n when action_description like 'removed the due date%' then 'removed due date' \n when action_description like 'removed the date range%' then 'removed due date' \n when action_description like 'removed the start date' then 'removed start date' \n when action_description like 'added subtask%' then 'added subtask' \n when action_description like 'added%collaborator%' then 'added collaborator' \n when action_description like 'moved%' then 'moved to section' \n when action_description like 'duplicated task from%' then 'duplicated this from other task' \n when action_description like 'marked%as a duplicate of this' then 'marked other task as duplicate of this' \n when action_description like 'marked this a duplicate of%' then 'marked as duplicate' \n when action_description like 'marked this task complete' then 'completed' \n when action_description like 'completed this task' then 'completed' \n when action_description like 'marked incomplete' then 'marked incomplete' \n when action_description like 'marked this task as a milestone' then 'marked as milestone' \n when action_description like 'unmarked this task as a milestone' then 'unmarked as milestone' \n when action_description like 'marked this milestone complete' then 'completed milestone' \n when action_description like 'completed this milestone' then 'completed milestone' \n when action_description like 'attached%' then 'attachment' \n when action_description like 'liked your comment' then 'liked comment' \n when action_description like 'liked this task' then 'liked task' \n when action_description like 'liked your attachment' then 'liked attachment' \n when action_description like 'liked that you completed this task' then 'liked completion' \n when action_description like 'completed the last task you were waiting on%' then 'completed dependency' \n when action_description like 'added feedback to%' then 'added feedback' \n when action_description like 'changed%to%' then 'changed tag' \n when action_description like 'cleared%' then 'cleared tag' \n when action_description like 'comment' then 'comment' \n when action_description like 'have a task due on%' then ''\n else action_description end as action_taken,\n action_description\n \n from split_comments\n\n),\n\n\nfinal as (\n \n select * \n from parse_actions\n\n -- remove actions you don't care about (set to null in the actions dictionary above)\n where action_taken is not null \n\n)\n\n\nselect * from final\n)"}, {"id": "model.asana.int_asana__task_open_length", "sql": " __dbt__cte__int_asana__task_open_length as (\nwith task as (\n \n select *\n from \"postgres\".\"asana_integrations_tests_stg_asana\".\"stg_asana__task\"\n\n),\n\nstory as (\n\n select * \n from __dbt__cte__int_asana__task_story\n\n),\n\nassignments as (\n \n select \n target_task_id as task_id,\n min(created_at) as first_assigned_at,\n max(created_at) as last_assigned_at -- current assignment\n\n from story\n where action_taken = 'assigned'\n\n group by 1\n\n),\n\n\nopen_assigned_length as (\n\n \n\n select\n task.task_id,\n task.is_completed,\n task.completed_at,\n task.assignee_user_id is not null as is_currently_assigned,\n assignments.task_id is not null as has_been_assigned,\n assignments.last_assigned_at as last_assigned_at,\n assignments.first_assigned_at as first_assigned_at,\n \n ((\n current_timestamp::TIMESTAMP\n)::date - (task.created_at)::date)\n as days_open,\n\n -- if the task is currently assigned, this is the time it has been assigned to this current user.\n \n ((\n current_timestamp::TIMESTAMP\n)::date - (assignments.last_assigned_at)::date)\n as days_since_last_assignment,\n\n \n ((\n current_timestamp::TIMESTAMP\n)::date - (assignments.first_assigned_at)::date)\n as days_since_first_assignment\n \n\n from task\n left join assignments \n on task.task_id = assignments.task_id\n\n)\n\n\nselect * from open_assigned_length\n)"}], "relation_name": null, "column_name": "task_id", "file_key_name": "models.int_asana__task_open_length"}, "test.asana.unique_int_asana__task_projects_task_id.8a6b2f262d": {"test_metadata": {"name": "unique", "kwargs": {"column_name": "task_id", "model": "{{ get_where_subquery(ref('int_asana__task_projects')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["model.asana.int_asana__task_projects"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "postgres", "schema": "asana_integrations_tests_dbt_test__audit", "fqn": ["asana", "intermediate", "unique_int_asana__task_projects_task_id"], "unique_id": "test.asana.unique_int_asana__task_projects_task_id.8a6b2f262d", "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "language": "sql", "package_name": "asana", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/asana", "path": "unique_int_asana__task_projects_task_id.sql", "original_file_path": "models/intermediate/intermediate_asana.yml", "name": "unique_int_asana__task_projects_task_id", "alias": "unique_int_asana__task_projects_task_id", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["int_asana__task_projects"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/asana/models/intermediate/intermediate_asana.yml/unique_int_asana__task_projects_task_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1671481804.809344, "compiled_code": "\n \n \n\nwith __dbt__cte__int_asana__task_projects as (\nwith task_project as (\n\n select * \n from \"postgres\".\"asana_integrations_tests_stg_asana\".\"stg_asana__project_task\"\n\n),\n\nproject as (\n \n select * \n from \"postgres\".\"asana_integrations_tests_stg_asana\".\"stg_asana__project\"\n),\n\ntask_section as (\n\n select * \n from \"postgres\".\"asana_integrations_tests_stg_asana\".\"stg_asana__task_section\"\n\n),\n\nsection as (\n \n select * \n from \"postgres\".\"asana_integrations_tests_stg_asana\".\"stg_asana__section\"\n\n),\n\ntask_project_section as (\n\n select \n task_project.task_id,\n project.project_name || (case when section.section_name = '(no section)' then ''\n else ': ' || section.section_name end) as project_section, \n project.project_id\n from\n task_project \n join project \n on project.project_id = task_project.project_id\n join task_section\n on task_section.task_id = task_project.task_id\n join section \n on section.section_id = task_section.section_id \n and section.project_id = project.project_id\n),\n\nagg_project_sections as (\n select \n task_id,\n \n string_agg(task_project_section.project_section, ', ')\n\n as projects_sections,\n count(project_id) as number_of_projects\n\n from task_project_section \n\n group by 1\n)\n\nselect * from agg_project_sections\n)select\n task_id as unique_field,\n count(*) as n_records\n\nfrom __dbt__cte__int_asana__task_projects\nwhere task_id is not null\ngroup by task_id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.asana.int_asana__task_projects", "sql": " __dbt__cte__int_asana__task_projects as (\nwith task_project as (\n\n select * \n from \"postgres\".\"asana_integrations_tests_stg_asana\".\"stg_asana__project_task\"\n\n),\n\nproject as (\n \n select * \n from \"postgres\".\"asana_integrations_tests_stg_asana\".\"stg_asana__project\"\n),\n\ntask_section as (\n\n select * \n from \"postgres\".\"asana_integrations_tests_stg_asana\".\"stg_asana__task_section\"\n\n),\n\nsection as (\n \n select * \n from \"postgres\".\"asana_integrations_tests_stg_asana\".\"stg_asana__section\"\n\n),\n\ntask_project_section as (\n\n select \n task_project.task_id,\n project.project_name || (case when section.section_name = '(no section)' then ''\n else ': ' || section.section_name end) as project_section, \n project.project_id\n from\n task_project \n join project \n on project.project_id = task_project.project_id\n join task_section\n on task_section.task_id = task_project.task_id\n join section \n on section.section_id = task_section.section_id \n and section.project_id = project.project_id\n),\n\nagg_project_sections as (\n select \n task_id,\n \n string_agg(task_project_section.project_section, ', ')\n\n as projects_sections,\n count(project_id) as number_of_projects\n\n from task_project_section \n\n group by 1\n)\n\nselect * from agg_project_sections\n)"}], "relation_name": null, "column_name": "task_id", "file_key_name": "models.int_asana__task_projects"}, "test.asana.not_null_int_asana__task_projects_task_id.322519ee10": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "task_id", "model": "{{ get_where_subquery(ref('int_asana__task_projects')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.asana.int_asana__task_projects"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "postgres", "schema": "asana_integrations_tests_dbt_test__audit", "fqn": ["asana", "intermediate", "not_null_int_asana__task_projects_task_id"], "unique_id": "test.asana.not_null_int_asana__task_projects_task_id.322519ee10", "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "package_name": "asana", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/asana", "path": "not_null_int_asana__task_projects_task_id.sql", "original_file_path": "models/intermediate/intermediate_asana.yml", "name": "not_null_int_asana__task_projects_task_id", "alias": "not_null_int_asana__task_projects_task_id", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["int_asana__task_projects"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/asana/models/intermediate/intermediate_asana.yml/not_null_int_asana__task_projects_task_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1671481804.810464, "compiled_code": "\n \n \n\n\n\nwith __dbt__cte__int_asana__task_projects as (\nwith task_project as (\n\n select * \n from \"postgres\".\"asana_integrations_tests_stg_asana\".\"stg_asana__project_task\"\n\n),\n\nproject as (\n \n select * \n from \"postgres\".\"asana_integrations_tests_stg_asana\".\"stg_asana__project\"\n),\n\ntask_section as (\n\n select * \n from \"postgres\".\"asana_integrations_tests_stg_asana\".\"stg_asana__task_section\"\n\n),\n\nsection as (\n \n select * \n from \"postgres\".\"asana_integrations_tests_stg_asana\".\"stg_asana__section\"\n\n),\n\ntask_project_section as (\n\n select \n task_project.task_id,\n project.project_name || (case when section.section_name = '(no section)' then ''\n else ': ' || section.section_name end) as project_section, \n project.project_id\n from\n task_project \n join project \n on project.project_id = task_project.project_id\n join task_section\n on task_section.task_id = task_project.task_id\n join section \n on section.section_id = task_section.section_id \n and section.project_id = project.project_id\n),\n\nagg_project_sections as (\n select \n task_id,\n \n string_agg(task_project_section.project_section, ', ')\n\n as projects_sections,\n count(project_id) as number_of_projects\n\n from task_project_section \n\n group by 1\n)\n\nselect * from agg_project_sections\n)select task_id\nfrom __dbt__cte__int_asana__task_projects\nwhere task_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.asana.int_asana__task_projects", "sql": " __dbt__cte__int_asana__task_projects as (\nwith task_project as (\n\n select * \n from \"postgres\".\"asana_integrations_tests_stg_asana\".\"stg_asana__project_task\"\n\n),\n\nproject as (\n \n select * \n from \"postgres\".\"asana_integrations_tests_stg_asana\".\"stg_asana__project\"\n),\n\ntask_section as (\n\n select * \n from \"postgres\".\"asana_integrations_tests_stg_asana\".\"stg_asana__task_section\"\n\n),\n\nsection as (\n \n select * \n from \"postgres\".\"asana_integrations_tests_stg_asana\".\"stg_asana__section\"\n\n),\n\ntask_project_section as (\n\n select \n task_project.task_id,\n project.project_name || (case when section.section_name = '(no section)' then ''\n else ': ' || section.section_name end) as project_section, \n project.project_id\n from\n task_project \n join project \n on project.project_id = task_project.project_id\n join task_section\n on task_section.task_id = task_project.task_id\n join section \n on section.section_id = task_section.section_id \n and section.project_id = project.project_id\n),\n\nagg_project_sections as (\n select \n task_id,\n \n string_agg(task_project_section.project_section, ', ')\n\n as projects_sections,\n count(project_id) as number_of_projects\n\n from task_project_section \n\n group by 1\n)\n\nselect * from agg_project_sections\n)"}], "relation_name": null, "column_name": "task_id", "file_key_name": "models.int_asana__task_projects"}, "test.asana.unique_int_asana__task_story_story_id.92d7adbcf6": {"test_metadata": {"name": "unique", "kwargs": {"column_name": "story_id", "model": "{{ get_where_subquery(ref('int_asana__task_story')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["model.asana.int_asana__task_story"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "postgres", "schema": "asana_integrations_tests_dbt_test__audit", "fqn": ["asana", "intermediate", "unique_int_asana__task_story_story_id"], "unique_id": "test.asana.unique_int_asana__task_story_story_id.92d7adbcf6", "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "language": "sql", "package_name": "asana", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/asana", "path": "unique_int_asana__task_story_story_id.sql", "original_file_path": "models/intermediate/intermediate_asana.yml", "name": "unique_int_asana__task_story_story_id", "alias": "unique_int_asana__task_story_story_id", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["int_asana__task_story"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/asana/models/intermediate/intermediate_asana.yml/unique_int_asana__task_story_story_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1671481804.811523, "compiled_code": "\n \n \n\nwith __dbt__cte__int_asana__task_story as (\nwith story as (\n \n select * \n from \"postgres\".\"asana_integrations_tests_stg_asana\".\"stg_asana__story\"\n\n),\n\nasana_user as (\n\n select * \n from \"postgres\".\"asana_integrations_tests_stg_asana\".\"stg_asana__user\"\n),\n\nstory_user as (\n select \n story.*,\n asana_user.user_name as created_by_name\n from story\n join asana_user \n on story.created_by_user_id = asana_user.user_id\n),\n\nsplit_comments as (\n\n select\n story_id,\n created_at,\n created_by_user_id,\n created_by_name,\n target_task_id,\n \n case when event_type = 'comment' then story_content \n else null end as comment_content,\n\n case when event_type = 'system' then story_content \n else 'comment' end as action_description\n \n from story_user\n\n),\n\n\n-- the next CTE uses this dictionary to parse the type of action out of the event descfription\n\n\nparse_actions as (\n select\n story_id,\n target_task_id,\n created_at,\n created_by_user_id,\n created_by_name,\n comment_content,\n case \n when action_description like 'added the name%' then 'added name' \n when action_description like 'changed the name%' then 'changed name' \n when action_description like 'removed the name' then 'removed name' \n when action_description like 'added the description%' then 'added description' \n when action_description like 'changed the description%' then 'changed description' \n when action_description like 'removed the description' then 'removed description' \n when action_description like 'added to%' then 'added to project' \n when action_description like 'removed from%' then 'removed from project' \n when action_description like 'assigned%' then 'assigned' \n when action_description like 'unassigned%' then 'unassigned' \n when action_description like 'changed the due date%' then 'changed due date' \n when action_description like 'changed the start date%due date%' then 'changed due date' \n when action_description like 'changed the start date%' then 'changed start date' \n when action_description like 'removed the due date%' then 'removed due date' \n when action_description like 'removed the date range%' then 'removed due date' \n when action_description like 'removed the start date' then 'removed start date' \n when action_description like 'added subtask%' then 'added subtask' \n when action_description like 'added%collaborator%' then 'added collaborator' \n when action_description like 'moved%' then 'moved to section' \n when action_description like 'duplicated task from%' then 'duplicated this from other task' \n when action_description like 'marked%as a duplicate of this' then 'marked other task as duplicate of this' \n when action_description like 'marked this a duplicate of%' then 'marked as duplicate' \n when action_description like 'marked this task complete' then 'completed' \n when action_description like 'completed this task' then 'completed' \n when action_description like 'marked incomplete' then 'marked incomplete' \n when action_description like 'marked this task as a milestone' then 'marked as milestone' \n when action_description like 'unmarked this task as a milestone' then 'unmarked as milestone' \n when action_description like 'marked this milestone complete' then 'completed milestone' \n when action_description like 'completed this milestone' then 'completed milestone' \n when action_description like 'attached%' then 'attachment' \n when action_description like 'liked your comment' then 'liked comment' \n when action_description like 'liked this task' then 'liked task' \n when action_description like 'liked your attachment' then 'liked attachment' \n when action_description like 'liked that you completed this task' then 'liked completion' \n when action_description like 'completed the last task you were waiting on%' then 'completed dependency' \n when action_description like 'added feedback to%' then 'added feedback' \n when action_description like 'changed%to%' then 'changed tag' \n when action_description like 'cleared%' then 'cleared tag' \n when action_description like 'comment' then 'comment' \n when action_description like 'have a task due on%' then ''\n else action_description end as action_taken,\n action_description\n \n from split_comments\n\n),\n\n\nfinal as (\n \n select * \n from parse_actions\n\n -- remove actions you don't care about (set to null in the actions dictionary above)\n where action_taken is not null \n\n)\n\n\nselect * from final\n)select\n story_id as unique_field,\n count(*) as n_records\n\nfrom __dbt__cte__int_asana__task_story\nwhere story_id is not null\ngroup by story_id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.asana.int_asana__task_story", "sql": " __dbt__cte__int_asana__task_story as (\nwith story as (\n \n select * \n from \"postgres\".\"asana_integrations_tests_stg_asana\".\"stg_asana__story\"\n\n),\n\nasana_user as (\n\n select * \n from \"postgres\".\"asana_integrations_tests_stg_asana\".\"stg_asana__user\"\n),\n\nstory_user as (\n select \n story.*,\n asana_user.user_name as created_by_name\n from story\n join asana_user \n on story.created_by_user_id = asana_user.user_id\n),\n\nsplit_comments as (\n\n select\n story_id,\n created_at,\n created_by_user_id,\n created_by_name,\n target_task_id,\n \n case when event_type = 'comment' then story_content \n else null end as comment_content,\n\n case when event_type = 'system' then story_content \n else 'comment' end as action_description\n \n from story_user\n\n),\n\n\n-- the next CTE uses this dictionary to parse the type of action out of the event descfription\n\n\nparse_actions as (\n select\n story_id,\n target_task_id,\n created_at,\n created_by_user_id,\n created_by_name,\n comment_content,\n case \n when action_description like 'added the name%' then 'added name' \n when action_description like 'changed the name%' then 'changed name' \n when action_description like 'removed the name' then 'removed name' \n when action_description like 'added the description%' then 'added description' \n when action_description like 'changed the description%' then 'changed description' \n when action_description like 'removed the description' then 'removed description' \n when action_description like 'added to%' then 'added to project' \n when action_description like 'removed from%' then 'removed from project' \n when action_description like 'assigned%' then 'assigned' \n when action_description like 'unassigned%' then 'unassigned' \n when action_description like 'changed the due date%' then 'changed due date' \n when action_description like 'changed the start date%due date%' then 'changed due date' \n when action_description like 'changed the start date%' then 'changed start date' \n when action_description like 'removed the due date%' then 'removed due date' \n when action_description like 'removed the date range%' then 'removed due date' \n when action_description like 'removed the start date' then 'removed start date' \n when action_description like 'added subtask%' then 'added subtask' \n when action_description like 'added%collaborator%' then 'added collaborator' \n when action_description like 'moved%' then 'moved to section' \n when action_description like 'duplicated task from%' then 'duplicated this from other task' \n when action_description like 'marked%as a duplicate of this' then 'marked other task as duplicate of this' \n when action_description like 'marked this a duplicate of%' then 'marked as duplicate' \n when action_description like 'marked this task complete' then 'completed' \n when action_description like 'completed this task' then 'completed' \n when action_description like 'marked incomplete' then 'marked incomplete' \n when action_description like 'marked this task as a milestone' then 'marked as milestone' \n when action_description like 'unmarked this task as a milestone' then 'unmarked as milestone' \n when action_description like 'marked this milestone complete' then 'completed milestone' \n when action_description like 'completed this milestone' then 'completed milestone' \n when action_description like 'attached%' then 'attachment' \n when action_description like 'liked your comment' then 'liked comment' \n when action_description like 'liked this task' then 'liked task' \n when action_description like 'liked your attachment' then 'liked attachment' \n when action_description like 'liked that you completed this task' then 'liked completion' \n when action_description like 'completed the last task you were waiting on%' then 'completed dependency' \n when action_description like 'added feedback to%' then 'added feedback' \n when action_description like 'changed%to%' then 'changed tag' \n when action_description like 'cleared%' then 'cleared tag' \n when action_description like 'comment' then 'comment' \n when action_description like 'have a task due on%' then ''\n else action_description end as action_taken,\n action_description\n \n from split_comments\n\n),\n\n\nfinal as (\n \n select * \n from parse_actions\n\n -- remove actions you don't care about (set to null in the actions dictionary above)\n where action_taken is not null \n\n)\n\n\nselect * from final\n)"}], "relation_name": null, "column_name": "story_id", "file_key_name": "models.int_asana__task_story"}, "test.asana.not_null_int_asana__task_story_story_id.1ffdb99927": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "story_id", "model": "{{ get_where_subquery(ref('int_asana__task_story')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.asana.int_asana__task_story"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "postgres", "schema": "asana_integrations_tests_dbt_test__audit", "fqn": ["asana", "intermediate", "not_null_int_asana__task_story_story_id"], "unique_id": "test.asana.not_null_int_asana__task_story_story_id.1ffdb99927", "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "package_name": "asana", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/asana", "path": "not_null_int_asana__task_story_story_id.sql", "original_file_path": "models/intermediate/intermediate_asana.yml", "name": "not_null_int_asana__task_story_story_id", "alias": "not_null_int_asana__task_story_story_id", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["int_asana__task_story"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/asana/models/intermediate/intermediate_asana.yml/not_null_int_asana__task_story_story_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1671481804.8125172, "compiled_code": "\n \n \n\n\n\nwith __dbt__cte__int_asana__task_story as (\nwith story as (\n \n select * \n from \"postgres\".\"asana_integrations_tests_stg_asana\".\"stg_asana__story\"\n\n),\n\nasana_user as (\n\n select * \n from \"postgres\".\"asana_integrations_tests_stg_asana\".\"stg_asana__user\"\n),\n\nstory_user as (\n select \n story.*,\n asana_user.user_name as created_by_name\n from story\n join asana_user \n on story.created_by_user_id = asana_user.user_id\n),\n\nsplit_comments as (\n\n select\n story_id,\n created_at,\n created_by_user_id,\n created_by_name,\n target_task_id,\n \n case when event_type = 'comment' then story_content \n else null end as comment_content,\n\n case when event_type = 'system' then story_content \n else 'comment' end as action_description\n \n from story_user\n\n),\n\n\n-- the next CTE uses this dictionary to parse the type of action out of the event descfription\n\n\nparse_actions as (\n select\n story_id,\n target_task_id,\n created_at,\n created_by_user_id,\n created_by_name,\n comment_content,\n case \n when action_description like 'added the name%' then 'added name' \n when action_description like 'changed the name%' then 'changed name' \n when action_description like 'removed the name' then 'removed name' \n when action_description like 'added the description%' then 'added description' \n when action_description like 'changed the description%' then 'changed description' \n when action_description like 'removed the description' then 'removed description' \n when action_description like 'added to%' then 'added to project' \n when action_description like 'removed from%' then 'removed from project' \n when action_description like 'assigned%' then 'assigned' \n when action_description like 'unassigned%' then 'unassigned' \n when action_description like 'changed the due date%' then 'changed due date' \n when action_description like 'changed the start date%due date%' then 'changed due date' \n when action_description like 'changed the start date%' then 'changed start date' \n when action_description like 'removed the due date%' then 'removed due date' \n when action_description like 'removed the date range%' then 'removed due date' \n when action_description like 'removed the start date' then 'removed start date' \n when action_description like 'added subtask%' then 'added subtask' \n when action_description like 'added%collaborator%' then 'added collaborator' \n when action_description like 'moved%' then 'moved to section' \n when action_description like 'duplicated task from%' then 'duplicated this from other task' \n when action_description like 'marked%as a duplicate of this' then 'marked other task as duplicate of this' \n when action_description like 'marked this a duplicate of%' then 'marked as duplicate' \n when action_description like 'marked this task complete' then 'completed' \n when action_description like 'completed this task' then 'completed' \n when action_description like 'marked incomplete' then 'marked incomplete' \n when action_description like 'marked this task as a milestone' then 'marked as milestone' \n when action_description like 'unmarked this task as a milestone' then 'unmarked as milestone' \n when action_description like 'marked this milestone complete' then 'completed milestone' \n when action_description like 'completed this milestone' then 'completed milestone' \n when action_description like 'attached%' then 'attachment' \n when action_description like 'liked your comment' then 'liked comment' \n when action_description like 'liked this task' then 'liked task' \n when action_description like 'liked your attachment' then 'liked attachment' \n when action_description like 'liked that you completed this task' then 'liked completion' \n when action_description like 'completed the last task you were waiting on%' then 'completed dependency' \n when action_description like 'added feedback to%' then 'added feedback' \n when action_description like 'changed%to%' then 'changed tag' \n when action_description like 'cleared%' then 'cleared tag' \n when action_description like 'comment' then 'comment' \n when action_description like 'have a task due on%' then ''\n else action_description end as action_taken,\n action_description\n \n from split_comments\n\n),\n\n\nfinal as (\n \n select * \n from parse_actions\n\n -- remove actions you don't care about (set to null in the actions dictionary above)\n where action_taken is not null \n\n)\n\n\nselect * from final\n)select story_id\nfrom __dbt__cte__int_asana__task_story\nwhere story_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.asana.int_asana__task_story", "sql": " __dbt__cte__int_asana__task_story as (\nwith story as (\n \n select * \n from \"postgres\".\"asana_integrations_tests_stg_asana\".\"stg_asana__story\"\n\n),\n\nasana_user as (\n\n select * \n from \"postgres\".\"asana_integrations_tests_stg_asana\".\"stg_asana__user\"\n),\n\nstory_user as (\n select \n story.*,\n asana_user.user_name as created_by_name\n from story\n join asana_user \n on story.created_by_user_id = asana_user.user_id\n),\n\nsplit_comments as (\n\n select\n story_id,\n created_at,\n created_by_user_id,\n created_by_name,\n target_task_id,\n \n case when event_type = 'comment' then story_content \n else null end as comment_content,\n\n case when event_type = 'system' then story_content \n else 'comment' end as action_description\n \n from story_user\n\n),\n\n\n-- the next CTE uses this dictionary to parse the type of action out of the event descfription\n\n\nparse_actions as (\n select\n story_id,\n target_task_id,\n created_at,\n created_by_user_id,\n created_by_name,\n comment_content,\n case \n when action_description like 'added the name%' then 'added name' \n when action_description like 'changed the name%' then 'changed name' \n when action_description like 'removed the name' then 'removed name' \n when action_description like 'added the description%' then 'added description' \n when action_description like 'changed the description%' then 'changed description' \n when action_description like 'removed the description' then 'removed description' \n when action_description like 'added to%' then 'added to project' \n when action_description like 'removed from%' then 'removed from project' \n when action_description like 'assigned%' then 'assigned' \n when action_description like 'unassigned%' then 'unassigned' \n when action_description like 'changed the due date%' then 'changed due date' \n when action_description like 'changed the start date%due date%' then 'changed due date' \n when action_description like 'changed the start date%' then 'changed start date' \n when action_description like 'removed the due date%' then 'removed due date' \n when action_description like 'removed the date range%' then 'removed due date' \n when action_description like 'removed the start date' then 'removed start date' \n when action_description like 'added subtask%' then 'added subtask' \n when action_description like 'added%collaborator%' then 'added collaborator' \n when action_description like 'moved%' then 'moved to section' \n when action_description like 'duplicated task from%' then 'duplicated this from other task' \n when action_description like 'marked%as a duplicate of this' then 'marked other task as duplicate of this' \n when action_description like 'marked this a duplicate of%' then 'marked as duplicate' \n when action_description like 'marked this task complete' then 'completed' \n when action_description like 'completed this task' then 'completed' \n when action_description like 'marked incomplete' then 'marked incomplete' \n when action_description like 'marked this task as a milestone' then 'marked as milestone' \n when action_description like 'unmarked this task as a milestone' then 'unmarked as milestone' \n when action_description like 'marked this milestone complete' then 'completed milestone' \n when action_description like 'completed this milestone' then 'completed milestone' \n when action_description like 'attached%' then 'attachment' \n when action_description like 'liked your comment' then 'liked comment' \n when action_description like 'liked this task' then 'liked task' \n when action_description like 'liked your attachment' then 'liked attachment' \n when action_description like 'liked that you completed this task' then 'liked completion' \n when action_description like 'completed the last task you were waiting on%' then 'completed dependency' \n when action_description like 'added feedback to%' then 'added feedback' \n when action_description like 'changed%to%' then 'changed tag' \n when action_description like 'cleared%' then 'cleared tag' \n when action_description like 'comment' then 'comment' \n when action_description like 'have a task due on%' then ''\n else action_description end as action_taken,\n action_description\n \n from split_comments\n\n),\n\n\nfinal as (\n \n select * \n from parse_actions\n\n -- remove actions you don't care about (set to null in the actions dictionary above)\n where action_taken is not null \n\n)\n\n\nselect * from final\n)"}], "relation_name": null, "column_name": "story_id", "file_key_name": "models.int_asana__task_story"}, "test.asana.unique_int_asana__task_tags_task_id.f28aff2685": {"test_metadata": {"name": "unique", "kwargs": {"column_name": "task_id", "model": "{{ get_where_subquery(ref('int_asana__task_tags')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["model.asana.int_asana__task_tags"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "postgres", "schema": "asana_integrations_tests_dbt_test__audit", "fqn": ["asana", "intermediate", "unique_int_asana__task_tags_task_id"], "unique_id": "test.asana.unique_int_asana__task_tags_task_id.f28aff2685", "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "language": "sql", "package_name": "asana", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/asana", "path": "unique_int_asana__task_tags_task_id.sql", "original_file_path": "models/intermediate/intermediate_asana.yml", "name": "unique_int_asana__task_tags_task_id", "alias": "unique_int_asana__task_tags_task_id", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["int_asana__task_tags"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/asana/models/intermediate/intermediate_asana.yml/unique_int_asana__task_tags_task_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1671481804.813513, "compiled_code": "\n \n \n\nwith __dbt__cte__int_asana__task_tags as (\nwith task_tag as (\n \n select *\n from \"postgres\".\"asana_integrations_tests_stg_asana\".\"stg_asana__task_tag\"\n\n),\n\nasana_tag as (\n\n select * \n from \"postgres\".\"asana_integrations_tests_stg_asana\".\"stg_asana__tag\"\n\n),\n\nagg_tags as (\n\n select\n task_tag.task_id,\n \n string_agg(asana_tag.tag_name, ', ')\n\n as tags,\n count(*) as number_of_tags\n from task_tag \n join asana_tag \n on asana_tag.tag_id = task_tag.tag_id\n group by 1\n \n)\n\nselect * from agg_tags\n)select\n task_id as unique_field,\n count(*) as n_records\n\nfrom __dbt__cte__int_asana__task_tags\nwhere task_id is not null\ngroup by task_id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.asana.int_asana__task_tags", "sql": " __dbt__cte__int_asana__task_tags as (\nwith task_tag as (\n \n select *\n from \"postgres\".\"asana_integrations_tests_stg_asana\".\"stg_asana__task_tag\"\n\n),\n\nasana_tag as (\n\n select * \n from \"postgres\".\"asana_integrations_tests_stg_asana\".\"stg_asana__tag\"\n\n),\n\nagg_tags as (\n\n select\n task_tag.task_id,\n \n string_agg(asana_tag.tag_name, ', ')\n\n as tags,\n count(*) as number_of_tags\n from task_tag \n join asana_tag \n on asana_tag.tag_id = task_tag.tag_id\n group by 1\n \n)\n\nselect * from agg_tags\n)"}], "relation_name": null, "column_name": "task_id", "file_key_name": "models.int_asana__task_tags"}, "test.asana.not_null_int_asana__task_tags_task_id.34eec2b834": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "task_id", "model": "{{ get_where_subquery(ref('int_asana__task_tags')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.asana.int_asana__task_tags"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "postgres", "schema": "asana_integrations_tests_dbt_test__audit", "fqn": ["asana", "intermediate", "not_null_int_asana__task_tags_task_id"], "unique_id": "test.asana.not_null_int_asana__task_tags_task_id.34eec2b834", "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "package_name": "asana", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/asana", "path": "not_null_int_asana__task_tags_task_id.sql", "original_file_path": "models/intermediate/intermediate_asana.yml", "name": "not_null_int_asana__task_tags_task_id", "alias": "not_null_int_asana__task_tags_task_id", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["int_asana__task_tags"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/asana/models/intermediate/intermediate_asana.yml/not_null_int_asana__task_tags_task_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1671481804.81472, "compiled_code": "\n \n \n\n\n\nwith __dbt__cte__int_asana__task_tags as (\nwith task_tag as (\n \n select *\n from \"postgres\".\"asana_integrations_tests_stg_asana\".\"stg_asana__task_tag\"\n\n),\n\nasana_tag as (\n\n select * \n from \"postgres\".\"asana_integrations_tests_stg_asana\".\"stg_asana__tag\"\n\n),\n\nagg_tags as (\n\n select\n task_tag.task_id,\n \n string_agg(asana_tag.tag_name, ', ')\n\n as tags,\n count(*) as number_of_tags\n from task_tag \n join asana_tag \n on asana_tag.tag_id = task_tag.tag_id\n group by 1\n \n)\n\nselect * from agg_tags\n)select task_id\nfrom __dbt__cte__int_asana__task_tags\nwhere task_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.asana.int_asana__task_tags", "sql": " __dbt__cte__int_asana__task_tags as (\nwith task_tag as (\n \n select *\n from \"postgres\".\"asana_integrations_tests_stg_asana\".\"stg_asana__task_tag\"\n\n),\n\nasana_tag as (\n\n select * \n from \"postgres\".\"asana_integrations_tests_stg_asana\".\"stg_asana__tag\"\n\n),\n\nagg_tags as (\n\n select\n task_tag.task_id,\n \n string_agg(asana_tag.tag_name, ', ')\n\n as tags,\n count(*) as number_of_tags\n from task_tag \n join asana_tag \n on asana_tag.tag_id = task_tag.tag_id\n group by 1\n \n)\n\nselect * from agg_tags\n)"}], "relation_name": null, "column_name": "task_id", "file_key_name": "models.int_asana__task_tags"}, "test.asana.unique_int_asana__user_task_metrics_user_id.06a6a270b8": {"test_metadata": {"name": "unique", "kwargs": {"column_name": "user_id", "model": "{{ get_where_subquery(ref('int_asana__user_task_metrics')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["model.asana.int_asana__user_task_metrics"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "postgres", "schema": "asana_integrations_tests_dbt_test__audit", "fqn": ["asana", "intermediate", "unique_int_asana__user_task_metrics_user_id"], "unique_id": "test.asana.unique_int_asana__user_task_metrics_user_id.06a6a270b8", "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "language": "sql", "package_name": "asana", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/asana", "path": "unique_int_asana__user_task_metrics_user_id.sql", "original_file_path": "models/intermediate/intermediate_asana.yml", "name": "unique_int_asana__user_task_metrics_user_id", "alias": "unique_int_asana__user_task_metrics_user_id", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["int_asana__user_task_metrics"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/asana/models/intermediate/intermediate_asana.yml/unique_int_asana__user_task_metrics_user_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1671481804.8157408, "compiled_code": "\n \n \n\nwith __dbt__cte__int_asana__user_task_metrics as (\nwith tasks as (\n\n select * \n from \"postgres\".\"asana_integrations_tests_asana\".\"asana__task\"\n where assignee_user_id is not null\n\n), \n\nagg_user_tasks as (\n\n select \n assignee_user_id as user_id,\n sum(case when not is_completed then 1 else 0 end) as number_of_open_tasks,\n sum(case when is_completed then 1 else 0 end) as number_of_tasks_completed,\n sum(case when is_completed then days_since_last_assignment else 0 end) as days_assigned_this_user -- will divde later for avg\n\n from tasks\n\n group by 1\n\n),\n\nfinal as (\n select\n agg_user_tasks.user_id,\n agg_user_tasks.number_of_open_tasks,\n agg_user_tasks.number_of_tasks_completed,\n nullif(agg_user_tasks.days_assigned_this_user, 0) * 1.0 / nullif(agg_user_tasks.number_of_tasks_completed, 0) as avg_close_time_days\n\n from \n agg_user_tasks \n)\n\nselect * from final\n)select\n user_id as unique_field,\n count(*) as n_records\n\nfrom __dbt__cte__int_asana__user_task_metrics\nwhere user_id is not null\ngroup by user_id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.asana.int_asana__user_task_metrics", "sql": " __dbt__cte__int_asana__user_task_metrics as (\nwith tasks as (\n\n select * \n from \"postgres\".\"asana_integrations_tests_asana\".\"asana__task\"\n where assignee_user_id is not null\n\n), \n\nagg_user_tasks as (\n\n select \n assignee_user_id as user_id,\n sum(case when not is_completed then 1 else 0 end) as number_of_open_tasks,\n sum(case when is_completed then 1 else 0 end) as number_of_tasks_completed,\n sum(case when is_completed then days_since_last_assignment else 0 end) as days_assigned_this_user -- will divde later for avg\n\n from tasks\n\n group by 1\n\n),\n\nfinal as (\n select\n agg_user_tasks.user_id,\n agg_user_tasks.number_of_open_tasks,\n agg_user_tasks.number_of_tasks_completed,\n nullif(agg_user_tasks.days_assigned_this_user, 0) * 1.0 / nullif(agg_user_tasks.number_of_tasks_completed, 0) as avg_close_time_days\n\n from \n agg_user_tasks \n)\n\nselect * from final\n)"}], "relation_name": null, "column_name": "user_id", "file_key_name": "models.int_asana__user_task_metrics"}, "test.asana.not_null_int_asana__user_task_metrics_user_id.54eae7d721": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "user_id", "model": "{{ get_where_subquery(ref('int_asana__user_task_metrics')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.asana.int_asana__user_task_metrics"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "postgres", "schema": "asana_integrations_tests_dbt_test__audit", "fqn": ["asana", "intermediate", "not_null_int_asana__user_task_metrics_user_id"], "unique_id": "test.asana.not_null_int_asana__user_task_metrics_user_id.54eae7d721", "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "package_name": "asana", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/asana", "path": "not_null_int_asana__user_task_metrics_user_id.sql", "original_file_path": "models/intermediate/intermediate_asana.yml", "name": "not_null_int_asana__user_task_metrics_user_id", "alias": "not_null_int_asana__user_task_metrics_user_id", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["int_asana__user_task_metrics"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/asana/models/intermediate/intermediate_asana.yml/not_null_int_asana__user_task_metrics_user_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1671481804.816733, "compiled_code": "\n \n \n\n\n\nwith __dbt__cte__int_asana__user_task_metrics as (\nwith tasks as (\n\n select * \n from \"postgres\".\"asana_integrations_tests_asana\".\"asana__task\"\n where assignee_user_id is not null\n\n), \n\nagg_user_tasks as (\n\n select \n assignee_user_id as user_id,\n sum(case when not is_completed then 1 else 0 end) as number_of_open_tasks,\n sum(case when is_completed then 1 else 0 end) as number_of_tasks_completed,\n sum(case when is_completed then days_since_last_assignment else 0 end) as days_assigned_this_user -- will divde later for avg\n\n from tasks\n\n group by 1\n\n),\n\nfinal as (\n select\n agg_user_tasks.user_id,\n agg_user_tasks.number_of_open_tasks,\n agg_user_tasks.number_of_tasks_completed,\n nullif(agg_user_tasks.days_assigned_this_user, 0) * 1.0 / nullif(agg_user_tasks.number_of_tasks_completed, 0) as avg_close_time_days\n\n from \n agg_user_tasks \n)\n\nselect * from final\n)select user_id\nfrom __dbt__cte__int_asana__user_task_metrics\nwhere user_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.asana.int_asana__user_task_metrics", "sql": " __dbt__cte__int_asana__user_task_metrics as (\nwith tasks as (\n\n select * \n from \"postgres\".\"asana_integrations_tests_asana\".\"asana__task\"\n where assignee_user_id is not null\n\n), \n\nagg_user_tasks as (\n\n select \n assignee_user_id as user_id,\n sum(case when not is_completed then 1 else 0 end) as number_of_open_tasks,\n sum(case when is_completed then 1 else 0 end) as number_of_tasks_completed,\n sum(case when is_completed then days_since_last_assignment else 0 end) as days_assigned_this_user -- will divde later for avg\n\n from tasks\n\n group by 1\n\n),\n\nfinal as (\n select\n agg_user_tasks.user_id,\n agg_user_tasks.number_of_open_tasks,\n agg_user_tasks.number_of_tasks_completed,\n nullif(agg_user_tasks.days_assigned_this_user, 0) * 1.0 / nullif(agg_user_tasks.number_of_tasks_completed, 0) as avg_close_time_days\n\n from \n agg_user_tasks \n)\n\nselect * from final\n)"}], "relation_name": null, "column_name": "user_id", "file_key_name": "models.int_asana__user_task_metrics"}}, "sources": {"source.asana_source.asana.user": {"fqn": ["asana_source", "asana", "user"], "database": "postgres", "schema": "asana_integrations_tests", "unique_id": "source.asana_source.asana.user", "package_name": "asana_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/asana_source", "path": "models/src_asana.yml", "original_file_path": "models/src_asana.yml", "name": "user", "source_name": "asana", "source_description": "", "loader": "fivetran", "identifier": "user_data", "resource_type": "source", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "_fivetran_synced", "freshness": null, "external": null, "description": "Table of all accounts in the organization", "columns": {"id": {"name": "id", "description": "System generated unique ID for a user", "meta": {}, "data_type": null, "quote": null, "tags": []}, "email": {"name": "email", "description": "Email associated with the user", "meta": {}, "data_type": null, "quote": null, "tags": []}, "name": {"name": "name", "description": "Given name for the user as it appears in the UI", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true}, "patch_path": null, "unrendered_config": {}, "relation_name": "\"postgres\".\"asana_integrations_tests\".\"user_data\"", "created_at": 1671481804.817606}, "source.asana_source.asana.task": {"fqn": ["asana_source", "asana", "task"], "database": "postgres", "schema": "asana_integrations_tests", "unique_id": "source.asana_source.asana.task", "package_name": "asana_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/asana_source", "path": "models/src_asana.yml", "original_file_path": "models/src_asana.yml", "name": "task", "source_name": "asana", "source_description": "", "loader": "fivetran", "identifier": "task_data", "resource_type": "source", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "_fivetran_synced", "freshness": {"warn_after": {"count": 72, "period": "hour"}, "error_after": {"count": 96, "period": "hour"}, "filter": null}, "external": null, "description": "Table containing all created tasks", "columns": {"id": {"name": "id", "description": "System generated unique identifier for the task", "meta": {}, "data_type": null, "quote": null, "tags": []}, "assignee_id": {"name": "assignee_id", "description": "Foreign key referencing the USER assigned to this task (note that a task may not have an assignee)", "meta": {}, "data_type": null, "quote": null, "tags": []}, "completed": {"name": "completed", "description": "Boolean that's true if the task is *currently* marked completed. Note that a task can be unmarked complete", "meta": {}, "data_type": null, "quote": null, "tags": []}, "completed_at": {"name": "completed_at", "description": "Timestamp of when the task was completed, if still currently completed.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "completed_by_id": {"name": "completed_by_id", "description": "Foreign key that references the USER who completed the task, if currently completed.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "created_at": {"name": "created_at", "description": "Timestamp of when the task was first made", "meta": {}, "data_type": null, "quote": null, "tags": []}, "due_on": {"name": "due_on", "description": "The date on which the task is due. Note that not tasks may not have a due date", "meta": {}, "data_type": null, "quote": null, "tags": []}, "due_at": {"name": "due_at", "description": "The date and time at which the task is due, only if a specific time is given.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "modified_at": {"name": "modified_at", "description": "The last time the task was updated. Does not include comments nor changes in associations (ie their projects)", "meta": {}, "data_type": null, "quote": null, "tags": []}, "name": {"name": "name", "description": "The title of the task", "meta": {}, "data_type": null, "quote": null, "tags": []}, "notes": {"name": "notes", "description": "Free-form textual description of the task (as seen in the UI).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "liked": {"name": "liked", "description": "A boolean that's true if the task has been liked.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "num_likes": {"name": "num_likes", "description": "An integer indicating the number of likes on a task.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "parent_id": {"name": "parent_id", "description": "The ID of the parent of the task, if it is a subtask. Self-refers to TASK", "meta": {}, "data_type": null, "quote": null, "tags": []}, "start_on": {"name": "start_on", "description": "The start date of the task, if given with the due date", "meta": {}, "data_type": null, "quote": null, "tags": []}, "workspace_id": {"name": "workspace_id", "description": "The id of an organization's workspace in asana. Not necessary unless you have access to multiple organization's asanas.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true}, "patch_path": null, "unrendered_config": {}, "relation_name": "\"postgres\".\"asana_integrations_tests\".\"task_data\"", "created_at": 1671481804.817724}, "source.asana_source.asana.project": {"fqn": ["asana_source", "asana", "project"], "database": "postgres", "schema": "asana_integrations_tests", "unique_id": "source.asana_source.asana.project", "package_name": "asana_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/asana_source", "path": "models/src_asana.yml", "original_file_path": "models/src_asana.yml", "name": "project", "source_name": "asana", "source_description": "", "loader": "fivetran", "identifier": "project_data", "resource_type": "source", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "_fivetran_synced", "freshness": null, "external": null, "description": "Table containing all projects", "columns": {"id": {"name": "id", "description": "System generated unique ID of the project.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "archived": {"name": "archived", "description": "Boolean representing whether the project has been archived (removed from asana UI).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "color": {"name": "color", "description": "Color of the project as seen in the UI.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "created_at": {"name": "created_at", "description": "Timestamp of when the story was made/the action was logged.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "current_status": {"name": "current_status", "description": "The most recent progress status update for the project. This is sent to all project followers.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "due_date": {"name": "due_date", "description": "The date the project is due.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "modified_at": {"name": "modified_at", "description": "The last time the project was updated. Does not include comments nor changes in associations (ie new tasks).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "name": {"name": "name", "description": "The given name of the project.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "notes": {"name": "notes", "description": "Free-form textual notes associated with the project.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "owner_id": {"name": "owner_id", "description": "Foreign key referencing the USER who owns the project.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "public": {"name": "public", "description": "Boolean that is true if the project is public to the whole organization, false if not.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "team_id": {"name": "team_id", "description": "Foreign key referencing the TEAM that the project is shared with.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "workspace_id": {"name": "workspace_id", "description": "The id of an organization's workspace in asana. Not necessary unless you have access to multiple asana workspaces.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true}, "patch_path": null, "unrendered_config": {}, "relation_name": "\"postgres\".\"asana_integrations_tests\".\"project_data\"", "created_at": 1671481804.8178}, "source.asana_source.asana.story": {"fqn": ["asana_source", "asana", "story"], "database": "postgres", "schema": "asana_integrations_tests", "unique_id": "source.asana_source.asana.story", "package_name": "asana_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/asana_source", "path": "models/src_asana.yml", "original_file_path": "models/src_asana.yml", "name": "story", "source_name": "asana", "source_description": "", "loader": "fivetran", "identifier": "story_data", "resource_type": "source", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "_fivetran_synced", "freshness": {"warn_after": {"count": 72, "period": "hour"}, "error_after": {"count": 96, "period": "hour"}, "filter": null}, "external": null, "description": "Table containing all stories -- stories are actions taken on tasks", "columns": {"id": {"name": "id", "description": "System generated unique ID of the story/action taken", "meta": {}, "data_type": null, "quote": null, "tags": []}, "created_at": {"name": "created_at", "description": "Timestamp of when the story was made/the action was logged", "meta": {}, "data_type": null, "quote": null, "tags": []}, "created_by_id": {"name": "created_by_id", "description": "Foreign key referencing the USER who created the story/took the action on the task (sometimes null)", "meta": {}, "data_type": null, "quote": null, "tags": []}, "target_id": {"name": "target_id", "description": "Foreign key referencing the TASK that the story is about.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "text": {"name": "text", "description": "Free-form text describing the action that was taken (if type = system), or the content of a comment (if type = comment)", "meta": {}, "data_type": null, "quote": null, "tags": []}, "type": {"name": "type", "description": "The origin type of the story - a comment or change to the backend/altering a task", "meta": {}, "data_type": null, "quote": null, "tags": []}, "source": {"name": "source", "description": "Where the story occurred (web, mobile, email, or api)", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true}, "patch_path": null, "unrendered_config": {}, "relation_name": "\"postgres\".\"asana_integrations_tests\".\"story_data\"", "created_at": 1671481804.8178701}, "source.asana_source.asana.team": {"fqn": ["asana_source", "asana", "team"], "database": "postgres", "schema": "asana_integrations_tests", "unique_id": "source.asana_source.asana.team", "package_name": "asana_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/asana_source", "path": "models/src_asana.yml", "original_file_path": "models/src_asana.yml", "name": "team", "source_name": "asana", "source_description": "", "loader": "fivetran", "identifier": "team_data", "resource_type": "source", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "_fivetran_synced", "freshness": null, "external": null, "description": "Table of the teams within the organization", "columns": {"id": {"name": "id", "description": "System generated unique ID for each team", "meta": {}, "data_type": null, "quote": null, "tags": []}, "name": {"name": "name", "description": "Provided name for each team. There can be duplicates", "meta": {}, "data_type": null, "quote": null, "tags": []}, "organization_id": {"name": "organization_id", "description": "Equivalent to the workspace_id, as organizations are a kind of workspace. Probably not relevant unless working with multiple orgs.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true}, "patch_path": null, "unrendered_config": {}, "relation_name": "\"postgres\".\"asana_integrations_tests\".\"team_data\"", "created_at": 1671481804.81793}, "source.asana_source.asana.tag": {"fqn": ["asana_source", "asana", "tag"], "database": "postgres", "schema": "asana_integrations_tests", "unique_id": "source.asana_source.asana.tag", "package_name": "asana_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/asana_source", "path": "models/src_asana.yml", "original_file_path": "models/src_asana.yml", "name": "tag", "source_name": "asana", "source_description": "", "loader": "fivetran", "identifier": "tag_data", "resource_type": "source", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "_fivetran_synced", "freshness": null, "external": null, "description": "Table of the custom tags made in the organization", "columns": {"id": {"name": "id", "description": "System generated ID for each tag", "meta": {}, "data_type": null, "quote": null, "tags": []}, "name": {"name": "name", "description": "The name of the tag as it appears in the UI. There can be duplicates.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "created_at": {"name": "created_at", "description": "Timestamp of when the tag was created", "meta": {}, "data_type": null, "quote": null, "tags": []}, "color": {"name": "color", "description": "Chosen color of the tag as it appears in the UI", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true}, "patch_path": null, "unrendered_config": {}, "relation_name": "\"postgres\".\"asana_integrations_tests\".\"tag_data\"", "created_at": 1671481804.8179898}, "source.asana_source.asana.section": {"fqn": ["asana_source", "asana", "section"], "database": "postgres", "schema": "asana_integrations_tests", "unique_id": "source.asana_source.asana.section", "package_name": "asana_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/asana_source", "path": "models/src_asana.yml", "original_file_path": "models/src_asana.yml", "name": "section", "source_name": "asana", "source_description": "", "loader": "fivetran", "identifier": "section_data", "resource_type": "source", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "_fivetran_synced", "freshness": null, "external": null, "description": "Table of all sections within projects. If tasks in a project are not in an explicit user-made section, a default section called \"(no section)\" is created here", "columns": {"id": {"name": "id", "description": "System generated unique ID for each section", "meta": {}, "data_type": null, "quote": null, "tags": []}, "created_at": {"name": "created_at", "description": "Timestamp of when the section was created by a user", "meta": {}, "data_type": null, "quote": null, "tags": []}, "name": {"name": "name", "description": "The given name of the section as it appears in the UI. Is stored as \"(no section)\" when this is the default bucket for tasks with a section in a project", "meta": {}, "data_type": null, "quote": null, "tags": []}, "project_id": {"name": "project_id", "description": "Foreign key referencing the PROJECT that the section lives in", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true}, "patch_path": null, "unrendered_config": {}, "relation_name": "\"postgres\".\"asana_integrations_tests\".\"section_data\"", "created_at": 1671481804.8180501}, "source.asana_source.asana.project_task": {"fqn": ["asana_source", "asana", "project_task"], "database": "postgres", "schema": "asana_integrations_tests", "unique_id": "source.asana_source.asana.project_task", "package_name": "asana_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/asana_source", "path": "models/src_asana.yml", "original_file_path": "models/src_asana.yml", "name": "project_task", "source_name": "asana", "source_description": "", "loader": "fivetran", "identifier": "project_task_data", "resource_type": "source", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "_fivetran_synced", "freshness": null, "external": null, "description": "Table of tasks and the project(s) they each belong to. If a project doesn't have a task, it won't be in here (and vice versa)", "columns": {"project_id": {"name": "project_id", "description": "Foreign key referencing a PROJECT the task belongs to", "meta": {}, "data_type": null, "quote": null, "tags": []}, "task_id": {"name": "task_id", "description": "Foreign key referencing the TASK in the project", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true}, "patch_path": null, "unrendered_config": {}, "relation_name": "\"postgres\".\"asana_integrations_tests\".\"project_task_data\"", "created_at": 1671481804.8181078}, "source.asana_source.asana.task_follower": {"fqn": ["asana_source", "asana", "task_follower"], "database": "postgres", "schema": "asana_integrations_tests", "unique_id": "source.asana_source.asana.task_follower", "package_name": "asana_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/asana_source", "path": "models/src_asana.yml", "original_file_path": "models/src_asana.yml", "name": "task_follower", "source_name": "asana", "source_description": "", "loader": "fivetran", "identifier": "task_follower_data", "resource_type": "source", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "_fivetran_synced", "freshness": null, "external": null, "description": "Table of tasks with the users that are following them. Tasks without users do not appear here.", "columns": {"task_id": {"name": "task_id", "description": "Foreign key referencing the TASK being followed", "meta": {}, "data_type": null, "quote": null, "tags": []}, "user_id": {"name": "user_id", "description": "Foreign key referencing the USER that is following the task", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true}, "patch_path": null, "unrendered_config": {}, "relation_name": "\"postgres\".\"asana_integrations_tests\".\"task_follower_data\"", "created_at": 1671481804.8181639}, "source.asana_source.asana.task_tag": {"fqn": ["asana_source", "asana", "task_tag"], "database": "postgres", "schema": "asana_integrations_tests", "unique_id": "source.asana_source.asana.task_tag", "package_name": "asana_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/asana_source", "path": "models/src_asana.yml", "original_file_path": "models/src_asana.yml", "name": "task_tag", "source_name": "asana", "source_description": "", "loader": "fivetran", "identifier": "task_tag_data", "resource_type": "source", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "_fivetran_synced", "freshness": null, "external": null, "description": "Table of tasks with the tags attached to them. Tasks without tags (and vice versa) do not appear here.", "columns": {"task_id": {"name": "task_id", "description": "Foreign key referencing the TASK that is tagged", "meta": {}, "data_type": null, "quote": null, "tags": []}, "tag_id": {"name": "tag_id", "description": "Foreign key referencing the TAG that is applied to the task", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true}, "patch_path": null, "unrendered_config": {}, "relation_name": "\"postgres\".\"asana_integrations_tests\".\"task_tag_data\"", "created_at": 1671481804.818225}, "source.asana_source.asana.task_section": {"fqn": ["asana_source", "asana", "task_section"], "database": "postgres", "schema": "asana_integrations_tests", "unique_id": "source.asana_source.asana.task_section", "package_name": "asana_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/asana_source", "path": "models/src_asana.yml", "original_file_path": "models/src_asana.yml", "name": "task_section", "source_name": "asana", "source_description": "", "loader": "fivetran", "identifier": "task_section_data", "resource_type": "source", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "_fivetran_synced", "freshness": null, "external": null, "description": "Table of tasks and the section that they live under. Section-less tasks within projects appear here, but project-less tasks do not", "columns": {"section_id": {"name": "section_id", "description": "Foreign key referencing the SECTION that the task lives under.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "task_id": {"name": "task_id", "description": "Foreign key referencing the TASK that lives in a section.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true}, "patch_path": null, "unrendered_config": {}, "relation_name": "\"postgres\".\"asana_integrations_tests\".\"task_section_data\"", "created_at": 1671481804.818284}}, "macros": {"macro.dbt_postgres.postgres__current_timestamp": {"unique_id": "macro.dbt_postgres.postgres__current_timestamp", "package_name": "dbt_postgres", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/postgres", "path": "macros/timestamps.sql", "original_file_path": "macros/timestamps.sql", "name": "postgres__current_timestamp", "macro_sql": "{% macro postgres__current_timestamp() -%}\n now()\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481803.853793, "supported_languages": null}, "macro.dbt_postgres.postgres__snapshot_string_as_time": {"unique_id": "macro.dbt_postgres.postgres__snapshot_string_as_time", "package_name": "dbt_postgres", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/postgres", "path": "macros/timestamps.sql", "original_file_path": "macros/timestamps.sql", "name": "postgres__snapshot_string_as_time", "macro_sql": "{% macro postgres__snapshot_string_as_time(timestamp) -%}\n {%- set result = \"'\" ~ timestamp ~ \"'::timestamp without time zone\" -%}\n {{ return(result) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481803.854042, "supported_languages": null}, "macro.dbt_postgres.postgres__snapshot_get_time": {"unique_id": "macro.dbt_postgres.postgres__snapshot_get_time", "package_name": "dbt_postgres", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/postgres", "path": "macros/timestamps.sql", "original_file_path": "macros/timestamps.sql", "name": "postgres__snapshot_get_time", "macro_sql": "{% macro postgres__snapshot_get_time() -%}\n {{ current_timestamp() }}::timestamp without time zone\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.current_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481803.854156, "supported_languages": null}, "macro.dbt_postgres.postgres__current_timestamp_backcompat": {"unique_id": "macro.dbt_postgres.postgres__current_timestamp_backcompat", "package_name": "dbt_postgres", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/postgres", "path": "macros/timestamps.sql", "original_file_path": "macros/timestamps.sql", "name": "postgres__current_timestamp_backcompat", "macro_sql": "{% macro postgres__current_timestamp_backcompat() %}\n current_timestamp::{{ type_timestamp() }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.type_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481803.854275, "supported_languages": null}, "macro.dbt_postgres.postgres__current_timestamp_in_utc_backcompat": {"unique_id": "macro.dbt_postgres.postgres__current_timestamp_in_utc_backcompat", "package_name": "dbt_postgres", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/postgres", "path": "macros/timestamps.sql", "original_file_path": "macros/timestamps.sql", "name": "postgres__current_timestamp_in_utc_backcompat", "macro_sql": "{% macro postgres__current_timestamp_in_utc_backcompat() %}\n (current_timestamp at time zone 'utc')::{{ type_timestamp() }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.type_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481803.854389, "supported_languages": null}, "macro.dbt_postgres.postgres__get_catalog": {"unique_id": "macro.dbt_postgres.postgres__get_catalog", "package_name": "dbt_postgres", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/postgres", "path": "macros/catalog.sql", "original_file_path": "macros/catalog.sql", "name": "postgres__get_catalog", "macro_sql": "{% macro postgres__get_catalog(information_schema, schemas) -%}\n\n {%- call statement('catalog', fetch_result=True) -%}\n {#\n If the user has multiple databases set and the first one is wrong, this will fail.\n But we won't fail in the case where there are multiple quoting-difference-only dbs, which is better.\n #}\n {% set database = information_schema.database %}\n {{ adapter.verify_database(database) }}\n\n select\n '{{ database }}' as table_database,\n sch.nspname as table_schema,\n tbl.relname as table_name,\n case tbl.relkind\n when 'v' then 'VIEW'\n else 'BASE TABLE'\n end as table_type,\n tbl_desc.description as table_comment,\n col.attname as column_name,\n col.attnum as column_index,\n pg_catalog.format_type(col.atttypid, col.atttypmod) as column_type,\n col_desc.description as column_comment,\n pg_get_userbyid(tbl.relowner) as table_owner\n\n from pg_catalog.pg_namespace sch\n join pg_catalog.pg_class tbl on tbl.relnamespace = sch.oid\n join pg_catalog.pg_attribute col on col.attrelid = tbl.oid\n left outer join pg_catalog.pg_description tbl_desc on (tbl_desc.objoid = tbl.oid and tbl_desc.objsubid = 0)\n left outer join pg_catalog.pg_description col_desc on (col_desc.objoid = tbl.oid and col_desc.objsubid = col.attnum)\n\n where (\n {%- for schema in schemas -%}\n upper(sch.nspname) = upper('{{ schema }}'){%- if not loop.last %} or {% endif -%}\n {%- endfor -%}\n )\n and not pg_is_other_temp_schema(sch.oid) -- not a temporary schema belonging to another session\n and tbl.relpersistence in ('p', 'u') -- [p]ermanent table or [u]nlogged table. Exclude [t]emporary tables\n and tbl.relkind in ('r', 'v', 'f', 'p') -- o[r]dinary table, [v]iew, [f]oreign table, [p]artitioned table. Other values are [i]ndex, [S]equence, [c]omposite type, [t]OAST table, [m]aterialized view\n and col.attnum > 0 -- negative numbers are used for system columns such as oid\n and not col.attisdropped -- column as not been dropped\n\n order by\n sch.nspname,\n tbl.relname,\n col.attnum\n\n {%- endcall -%}\n\n {{ return(load_result('catalog').table) }}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481803.855581, "supported_languages": null}, "macro.dbt_postgres.postgres_get_relations": {"unique_id": "macro.dbt_postgres.postgres_get_relations", "package_name": "dbt_postgres", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/postgres", "path": "macros/relations.sql", "original_file_path": "macros/relations.sql", "name": "postgres_get_relations", "macro_sql": "{% macro postgres_get_relations () -%}\n\n {#\n -- in pg_depend, objid is the dependent, refobjid is the referenced object\n -- > a pg_depend entry indicates that the referenced object cannot be\n -- > dropped without also dropping the dependent object.\n #}\n\n {%- call statement('relations', fetch_result=True) -%}\n with relation as (\n select\n pg_rewrite.ev_class as class,\n pg_rewrite.oid as id\n from pg_rewrite\n ),\n class as (\n select\n oid as id,\n relname as name,\n relnamespace as schema,\n relkind as kind\n from pg_class\n ),\n dependency as (\n select distinct\n pg_depend.objid as id,\n pg_depend.refobjid as ref\n from pg_depend\n ),\n schema as (\n select\n pg_namespace.oid as id,\n pg_namespace.nspname as name\n from pg_namespace\n where nspname != 'information_schema' and nspname not like 'pg\\_%'\n ),\n referenced as (\n select\n relation.id AS id,\n referenced_class.name ,\n referenced_class.schema ,\n referenced_class.kind\n from relation\n join class as referenced_class on relation.class=referenced_class.id\n where referenced_class.kind in ('r', 'v')\n ),\n relationships as (\n select\n referenced.name as referenced_name,\n referenced.schema as referenced_schema_id,\n dependent_class.name as dependent_name,\n dependent_class.schema as dependent_schema_id,\n referenced.kind as kind\n from referenced\n join dependency on referenced.id=dependency.id\n join class as dependent_class on dependency.ref=dependent_class.id\n where\n (referenced.name != dependent_class.name or\n referenced.schema != dependent_class.schema)\n )\n\n select\n referenced_schema.name as referenced_schema,\n relationships.referenced_name as referenced_name,\n dependent_schema.name as dependent_schema,\n relationships.dependent_name as dependent_name\n from relationships\n join schema as dependent_schema on relationships.dependent_schema_id=dependent_schema.id\n join schema as referenced_schema on relationships.referenced_schema_id=referenced_schema.id\n group by referenced_schema, referenced_name, dependent_schema, dependent_name\n order by referenced_schema, referenced_name, dependent_schema, dependent_name;\n\n {%- endcall -%}\n\n {{ return(load_result('relations').table) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481803.8562932, "supported_languages": null}, "macro.dbt_postgres.postgres__create_table_as": {"unique_id": "macro.dbt_postgres.postgres__create_table_as", "package_name": "dbt_postgres", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/postgres", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "name": "postgres__create_table_as", "macro_sql": "{% macro postgres__create_table_as(temporary, relation, sql) -%}\n {%- set unlogged = config.get('unlogged', default=false) -%}\n {%- set sql_header = config.get('sql_header', none) -%}\n\n {{ sql_header if sql_header is not none }}\n\n create {% if temporary -%}\n temporary\n {%- elif unlogged -%}\n unlogged\n {%- endif %} table {{ relation }}\n as (\n {{ sql }}\n );\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481803.861887, "supported_languages": null}, "macro.dbt_postgres.postgres__get_create_index_sql": {"unique_id": "macro.dbt_postgres.postgres__get_create_index_sql", "package_name": "dbt_postgres", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/postgres", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "name": "postgres__get_create_index_sql", "macro_sql": "{% macro postgres__get_create_index_sql(relation, index_dict) -%}\n {%- set index_config = adapter.parse_index(index_dict) -%}\n {%- set comma_separated_columns = \", \".join(index_config.columns) -%}\n {%- set index_name = index_config.render(relation) -%}\n\n create {% if index_config.unique -%}\n unique\n {%- endif %} index if not exists\n \"{{ index_name }}\"\n on {{ relation }} {% if index_config.type -%}\n using {{ index_config.type }}\n {%- endif %}\n ({{ comma_separated_columns }});\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481803.862394, "supported_languages": null}, "macro.dbt_postgres.postgres__create_schema": {"unique_id": "macro.dbt_postgres.postgres__create_schema", "package_name": "dbt_postgres", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/postgres", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "name": "postgres__create_schema", "macro_sql": "{% macro postgres__create_schema(relation) -%}\n {% if relation.database -%}\n {{ adapter.verify_database(relation.database) }}\n {%- endif -%}\n {%- call statement('create_schema') -%}\n create schema if not exists {{ relation.without_identifier().include(database=False) }}\n {%- endcall -%}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481803.8627121, "supported_languages": null}, "macro.dbt_postgres.postgres__drop_schema": {"unique_id": "macro.dbt_postgres.postgres__drop_schema", "package_name": "dbt_postgres", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/postgres", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "name": "postgres__drop_schema", "macro_sql": "{% macro postgres__drop_schema(relation) -%}\n {% if relation.database -%}\n {{ adapter.verify_database(relation.database) }}\n {%- endif -%}\n {%- call statement('drop_schema') -%}\n drop schema if exists {{ relation.without_identifier().include(database=False) }} cascade\n {%- endcall -%}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481803.863054, "supported_languages": null}, "macro.dbt_postgres.postgres__get_columns_in_relation": {"unique_id": "macro.dbt_postgres.postgres__get_columns_in_relation", "package_name": "dbt_postgres", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/postgres", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "name": "postgres__get_columns_in_relation", "macro_sql": "{% macro postgres__get_columns_in_relation(relation) -%}\n {% call statement('get_columns_in_relation', fetch_result=True) %}\n select\n column_name,\n data_type,\n character_maximum_length,\n numeric_precision,\n numeric_scale\n\n from {{ relation.information_schema('columns') }}\n where table_name = '{{ relation.identifier }}'\n {% if relation.schema %}\n and table_schema = '{{ relation.schema }}'\n {% endif %}\n order by ordinal_position\n\n {% endcall %}\n {% set table = load_result('get_columns_in_relation').table %}\n {{ return(sql_convert_columns_in_relation(table)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.statement", "macro.dbt.sql_convert_columns_in_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481803.863591, "supported_languages": null}, "macro.dbt_postgres.postgres__list_relations_without_caching": {"unique_id": "macro.dbt_postgres.postgres__list_relations_without_caching", "package_name": "dbt_postgres", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/postgres", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "name": "postgres__list_relations_without_caching", "macro_sql": "{% macro postgres__list_relations_without_caching(schema_relation) %}\n {% call statement('list_relations_without_caching', fetch_result=True) -%}\n select\n '{{ schema_relation.database }}' as database,\n tablename as name,\n schemaname as schema,\n 'table' as type\n from pg_tables\n where schemaname ilike '{{ schema_relation.schema }}'\n union all\n select\n '{{ schema_relation.database }}' as database,\n viewname as name,\n schemaname as schema,\n 'view' as type\n from pg_views\n where schemaname ilike '{{ schema_relation.schema }}'\n {% endcall %}\n {{ return(load_result('list_relations_without_caching').table) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481803.863981, "supported_languages": null}, "macro.dbt_postgres.postgres__information_schema_name": {"unique_id": "macro.dbt_postgres.postgres__information_schema_name", "package_name": "dbt_postgres", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/postgres", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "name": "postgres__information_schema_name", "macro_sql": "{% macro postgres__information_schema_name(database) -%}\n {% if database_name -%}\n {{ adapter.verify_database(database_name) }}\n {%- endif -%}\n information_schema\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481803.86416, "supported_languages": null}, "macro.dbt_postgres.postgres__list_schemas": {"unique_id": "macro.dbt_postgres.postgres__list_schemas", "package_name": "dbt_postgres", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/postgres", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "name": "postgres__list_schemas", "macro_sql": "{% macro postgres__list_schemas(database) %}\n {% if database -%}\n {{ adapter.verify_database(database) }}\n {%- endif -%}\n {% call statement('list_schemas', fetch_result=True, auto_begin=False) %}\n select distinct nspname from pg_namespace\n {% endcall %}\n {{ return(load_result('list_schemas').table) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481803.8645089, "supported_languages": null}, "macro.dbt_postgres.postgres__check_schema_exists": {"unique_id": "macro.dbt_postgres.postgres__check_schema_exists", "package_name": "dbt_postgres", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/postgres", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "name": "postgres__check_schema_exists", "macro_sql": "{% macro postgres__check_schema_exists(information_schema, schema) -%}\n {% if information_schema.database -%}\n {{ adapter.verify_database(information_schema.database) }}\n {%- endif -%}\n {% call statement('check_schema_exists', fetch_result=True, auto_begin=False) %}\n select count(*) from pg_namespace where nspname = '{{ schema }}'\n {% endcall %}\n {{ return(load_result('check_schema_exists').table) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481803.864981, "supported_languages": null}, "macro.dbt_postgres.postgres__make_relation_with_suffix": {"unique_id": "macro.dbt_postgres.postgres__make_relation_with_suffix", "package_name": "dbt_postgres", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/postgres", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "name": "postgres__make_relation_with_suffix", "macro_sql": "{% macro postgres__make_relation_with_suffix(base_relation, suffix, dstring) %}\n {% if dstring %}\n {% set dt = modules.datetime.datetime.now() %}\n {% set dtstring = dt.strftime(\"%H%M%S%f\") %}\n {% set suffix = suffix ~ dtstring %}\n {% endif %}\n {% set suffix_length = suffix|length %}\n {% set relation_max_name_length = base_relation.relation_max_name_length() %}\n {% if suffix_length > relation_max_name_length %}\n {% do exceptions.raise_compiler_error('Relation suffix is too long (' ~ suffix_length ~ ' characters). Maximum length is ' ~ relation_max_name_length ~ ' characters.') %}\n {% endif %}\n {% set identifier = base_relation.identifier[:relation_max_name_length - suffix_length] ~ suffix %}\n\n {{ return(base_relation.incorporate(path={\"identifier\": identifier })) }}\n\n {% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481803.8658419, "supported_languages": null}, "macro.dbt_postgres.postgres__make_intermediate_relation": {"unique_id": "macro.dbt_postgres.postgres__make_intermediate_relation", "package_name": "dbt_postgres", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/postgres", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "name": "postgres__make_intermediate_relation", "macro_sql": "{% macro postgres__make_intermediate_relation(base_relation, suffix) %}\n {{ return(postgres__make_relation_with_suffix(base_relation, suffix, dstring=False)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_postgres.postgres__make_relation_with_suffix"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481803.866048, "supported_languages": null}, "macro.dbt_postgres.postgres__make_temp_relation": {"unique_id": "macro.dbt_postgres.postgres__make_temp_relation", "package_name": "dbt_postgres", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/postgres", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "name": "postgres__make_temp_relation", "macro_sql": "{% macro postgres__make_temp_relation(base_relation, suffix) %}\n {% set temp_relation = postgres__make_relation_with_suffix(base_relation, suffix, dstring=True) %}\n {{ return(temp_relation.incorporate(path={\"schema\": none,\n \"database\": none})) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_postgres.postgres__make_relation_with_suffix"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481803.866365, "supported_languages": null}, "macro.dbt_postgres.postgres__make_backup_relation": {"unique_id": "macro.dbt_postgres.postgres__make_backup_relation", "package_name": "dbt_postgres", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/postgres", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "name": "postgres__make_backup_relation", "macro_sql": "{% macro postgres__make_backup_relation(base_relation, backup_relation_type, suffix) %}\n {% set backup_relation = postgres__make_relation_with_suffix(base_relation, suffix, dstring=False) %}\n {{ return(backup_relation.incorporate(type=backup_relation_type)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_postgres.postgres__make_relation_with_suffix"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481803.866643, "supported_languages": null}, "macro.dbt_postgres.postgres_escape_comment": {"unique_id": "macro.dbt_postgres.postgres_escape_comment", "package_name": "dbt_postgres", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/postgres", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "name": "postgres_escape_comment", "macro_sql": "{% macro postgres_escape_comment(comment) -%}\n {% if comment is not string %}\n {% do exceptions.raise_compiler_error('cannot escape a non-string: ' ~ comment) %}\n {% endif %}\n {%- set magic = '$dbt_comment_literal_block$' -%}\n {%- if magic in comment -%}\n {%- do exceptions.raise_compiler_error('The string ' ~ magic ~ ' is not allowed in comments.') -%}\n {%- endif -%}\n {{ magic }}{{ comment }}{{ magic }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481803.867072, "supported_languages": null}, "macro.dbt_postgres.postgres__alter_relation_comment": {"unique_id": "macro.dbt_postgres.postgres__alter_relation_comment", "package_name": "dbt_postgres", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/postgres", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "name": "postgres__alter_relation_comment", "macro_sql": "{% macro postgres__alter_relation_comment(relation, comment) %}\n {% set escaped_comment = postgres_escape_comment(comment) %}\n comment on {{ relation.type }} {{ relation }} is {{ escaped_comment }};\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_postgres.postgres_escape_comment"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481803.867296, "supported_languages": null}, "macro.dbt_postgres.postgres__alter_column_comment": {"unique_id": "macro.dbt_postgres.postgres__alter_column_comment", "package_name": "dbt_postgres", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/postgres", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "name": "postgres__alter_column_comment", "macro_sql": "{% macro postgres__alter_column_comment(relation, column_dict) %}\n {% set existing_columns = adapter.get_columns_in_relation(relation) | map(attribute=\"name\") | list %}\n {% for column_name in column_dict if (column_name in existing_columns) %}\n {% set comment = column_dict[column_name]['description'] %}\n {% set escaped_comment = postgres_escape_comment(comment) %}\n comment on column {{ relation }}.{{ adapter.quote(column_name) if column_dict[column_name]['quote'] else column_name }} is {{ escaped_comment }};\n {% endfor %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_postgres.postgres_escape_comment"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481803.867899, "supported_languages": null}, "macro.dbt_postgres.postgres__get_show_grant_sql": {"unique_id": "macro.dbt_postgres.postgres__get_show_grant_sql", "package_name": "dbt_postgres", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/postgres", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "name": "postgres__get_show_grant_sql", "macro_sql": "\n\n{%- macro postgres__get_show_grant_sql(relation) -%}\n select grantee, privilege_type\n from {{ relation.information_schema('role_table_grants') }}\n where grantor = current_role\n and grantee != current_role\n and table_schema = '{{ relation.schema }}'\n and table_name = '{{ relation.identifier }}'\n{%- endmacro -%}\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481803.8681018, "supported_languages": null}, "macro.dbt_postgres.postgres__copy_grants": {"unique_id": "macro.dbt_postgres.postgres__copy_grants", "package_name": "dbt_postgres", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/postgres", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "name": "postgres__copy_grants", "macro_sql": "{% macro postgres__copy_grants() %}\n {{ return(False) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481803.8682182, "supported_languages": null}, "macro.dbt_postgres.postgres__get_incremental_default_sql": {"unique_id": "macro.dbt_postgres.postgres__get_incremental_default_sql", "package_name": "dbt_postgres", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/postgres", "path": "macros/materializations/incremental_strategies.sql", "original_file_path": "macros/materializations/incremental_strategies.sql", "name": "postgres__get_incremental_default_sql", "macro_sql": "{% macro postgres__get_incremental_default_sql(arg_dict) %}\n\n {% if arg_dict[\"unique_key\"] %}\n {% do return(get_incremental_delete_insert_sql(arg_dict)) %}\n {% else %}\n {% do return(get_incremental_append_sql(arg_dict)) %}\n {% endif %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.get_incremental_delete_insert_sql", "macro.dbt.get_incremental_append_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481803.868732, "supported_languages": null}, "macro.dbt_postgres.postgres__snapshot_merge_sql": {"unique_id": "macro.dbt_postgres.postgres__snapshot_merge_sql", "package_name": "dbt_postgres", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/postgres", "path": "macros/materializations/snapshot_merge.sql", "original_file_path": "macros/materializations/snapshot_merge.sql", "name": "postgres__snapshot_merge_sql", "macro_sql": "{% macro postgres__snapshot_merge_sql(target, source, insert_cols) -%}\n {%- set insert_cols_csv = insert_cols | join(', ') -%}\n\n update {{ target }}\n set dbt_valid_to = DBT_INTERNAL_SOURCE.dbt_valid_to\n from {{ source }} as DBT_INTERNAL_SOURCE\n where DBT_INTERNAL_SOURCE.dbt_scd_id::text = {{ target }}.dbt_scd_id::text\n and DBT_INTERNAL_SOURCE.dbt_change_type::text in ('update'::text, 'delete'::text)\n and {{ target }}.dbt_valid_to is null;\n\n insert into {{ target }} ({{ insert_cols_csv }})\n select {% for column in insert_cols -%}\n DBT_INTERNAL_SOURCE.{{ column }} {%- if not loop.last %}, {%- endif %}\n {%- endfor %}\n from {{ source }} as DBT_INTERNAL_SOURCE\n where DBT_INTERNAL_SOURCE.dbt_change_type::text = 'insert'::text;\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481803.869579, "supported_languages": null}, "macro.dbt_postgres.postgres__dateadd": {"unique_id": "macro.dbt_postgres.postgres__dateadd", "package_name": "dbt_postgres", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/postgres", "path": "macros/utils/dateadd.sql", "original_file_path": "macros/utils/dateadd.sql", "name": "postgres__dateadd", "macro_sql": "{% macro postgres__dateadd(datepart, interval, from_date_or_timestamp) %}\n\n {{ from_date_or_timestamp }} + ((interval '1 {{ datepart }}') * ({{ interval }}))\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481803.869917, "supported_languages": null}, "macro.dbt_postgres.postgres__listagg": {"unique_id": "macro.dbt_postgres.postgres__listagg", "package_name": "dbt_postgres", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/postgres", "path": "macros/utils/listagg.sql", "original_file_path": "macros/utils/listagg.sql", "name": "postgres__listagg", "macro_sql": "{% macro postgres__listagg(measure, delimiter_text, order_by_clause, limit_num) -%}\n\n {% if limit_num -%}\n array_to_string(\n (array_agg(\n {{ measure }}\n {% if order_by_clause -%}\n {{ order_by_clause }}\n {%- endif %}\n ))[1:{{ limit_num }}],\n {{ delimiter_text }}\n )\n {%- else %}\n string_agg(\n {{ measure }},\n {{ delimiter_text }}\n {% if order_by_clause -%}\n {{ order_by_clause }}\n {%- endif %}\n )\n {%- endif %}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481803.8706188, "supported_languages": null}, "macro.dbt_postgres.postgres__datediff": {"unique_id": "macro.dbt_postgres.postgres__datediff", "package_name": "dbt_postgres", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/postgres", "path": "macros/utils/datediff.sql", "original_file_path": "macros/utils/datediff.sql", "name": "postgres__datediff", "macro_sql": "{% macro postgres__datediff(first_date, second_date, datepart) -%}\n\n {% if datepart == 'year' %}\n (date_part('year', ({{second_date}})::date) - date_part('year', ({{first_date}})::date))\n {% elif datepart == 'quarter' %}\n ({{ datediff(first_date, second_date, 'year') }} * 4 + date_part('quarter', ({{second_date}})::date) - date_part('quarter', ({{first_date}})::date))\n {% elif datepart == 'month' %}\n ({{ datediff(first_date, second_date, 'year') }} * 12 + date_part('month', ({{second_date}})::date) - date_part('month', ({{first_date}})::date))\n {% elif datepart == 'day' %}\n (({{second_date}})::date - ({{first_date}})::date)\n {% elif datepart == 'week' %}\n ({{ datediff(first_date, second_date, 'day') }} / 7 + case\n when date_part('dow', ({{first_date}})::timestamp) <= date_part('dow', ({{second_date}})::timestamp) then\n case when {{first_date}} <= {{second_date}} then 0 else -1 end\n else\n case when {{first_date}} <= {{second_date}} then 1 else 0 end\n end)\n {% elif datepart == 'hour' %}\n ({{ datediff(first_date, second_date, 'day') }} * 24 + date_part('hour', ({{second_date}})::timestamp) - date_part('hour', ({{first_date}})::timestamp))\n {% elif datepart == 'minute' %}\n ({{ datediff(first_date, second_date, 'hour') }} * 60 + date_part('minute', ({{second_date}})::timestamp) - date_part('minute', ({{first_date}})::timestamp))\n {% elif datepart == 'second' %}\n ({{ datediff(first_date, second_date, 'minute') }} * 60 + floor(date_part('second', ({{second_date}})::timestamp)) - floor(date_part('second', ({{first_date}})::timestamp)))\n {% elif datepart == 'millisecond' %}\n ({{ datediff(first_date, second_date, 'minute') }} * 60000 + floor(date_part('millisecond', ({{second_date}})::timestamp)) - floor(date_part('millisecond', ({{first_date}})::timestamp)))\n {% elif datepart == 'microsecond' %}\n ({{ datediff(first_date, second_date, 'minute') }} * 60000000 + floor(date_part('microsecond', ({{second_date}})::timestamp)) - floor(date_part('microsecond', ({{first_date}})::timestamp)))\n {% else %}\n {{ exceptions.raise_compiler_error(\"Unsupported datepart for macro datediff in postgres: {!r}\".format(datepart)) }}\n {% endif %}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.datediff"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481803.8739579, "supported_languages": null}, "macro.dbt_postgres.postgres__any_value": {"unique_id": "macro.dbt_postgres.postgres__any_value", "package_name": "dbt_postgres", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/postgres", "path": "macros/utils/any_value.sql", "original_file_path": "macros/utils/any_value.sql", "name": "postgres__any_value", "macro_sql": "{% macro postgres__any_value(expression) -%}\n\n min({{ expression }})\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481803.87426, "supported_languages": null}, "macro.dbt_postgres.postgres__last_day": {"unique_id": "macro.dbt_postgres.postgres__last_day", "package_name": "dbt_postgres", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/postgres", "path": "macros/utils/last_day.sql", "original_file_path": "macros/utils/last_day.sql", "name": "postgres__last_day", "macro_sql": "{% macro postgres__last_day(date, datepart) -%}\n\n {%- if datepart == 'quarter' -%}\n -- postgres dateadd does not support quarter interval.\n cast(\n {{dbt.dateadd('day', '-1',\n dbt.dateadd('month', '3', dbt.date_trunc(datepart, date))\n )}}\n as date)\n {%- else -%}\n {{dbt.default_last_day(date, datepart)}}\n {%- endif -%}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.dateadd", "macro.dbt.date_trunc", "macro.dbt.default_last_day"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481803.874871, "supported_languages": null}, "macro.dbt_postgres.postgres__split_part": {"unique_id": "macro.dbt_postgres.postgres__split_part", "package_name": "dbt_postgres", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/postgres", "path": "macros/utils/split_part.sql", "original_file_path": "macros/utils/split_part.sql", "name": "postgres__split_part", "macro_sql": "{% macro postgres__split_part(string_text, delimiter_text, part_number) %}\n\n {% if part_number >= 0 %}\n {{ dbt.default__split_part(string_text, delimiter_text, part_number) }}\n {% else %}\n {{ dbt._split_part_negative(string_text, delimiter_text, part_number) }}\n {% endif %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__split_part", "macro.dbt._split_part_negative"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481803.875372, "supported_languages": null}, "macro.dbt.run_hooks": {"unique_id": "macro.dbt.run_hooks", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/hooks.sql", "original_file_path": "macros/materializations/hooks.sql", "name": "run_hooks", "macro_sql": "{% macro run_hooks(hooks, inside_transaction=True) %}\n {% for hook in hooks | selectattr('transaction', 'equalto', inside_transaction) %}\n {% if not inside_transaction and loop.first %}\n {% call statement(auto_begin=inside_transaction) %}\n commit;\n {% endcall %}\n {% endif %}\n {% set rendered = render(hook.get('sql')) | trim %}\n {% if (rendered | length) > 0 %}\n {% call statement(auto_begin=inside_transaction) %}\n {{ rendered }}\n {% endcall %}\n {% endif %}\n {% endfor %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481803.87654, "supported_languages": null}, "macro.dbt.make_hook_config": {"unique_id": "macro.dbt.make_hook_config", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/hooks.sql", "original_file_path": "macros/materializations/hooks.sql", "name": "make_hook_config", "macro_sql": "{% macro make_hook_config(sql, inside_transaction) %}\n {{ tojson({\"sql\": sql, \"transaction\": inside_transaction}) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481803.876746, "supported_languages": null}, "macro.dbt.before_begin": {"unique_id": "macro.dbt.before_begin", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/hooks.sql", "original_file_path": "macros/materializations/hooks.sql", "name": "before_begin", "macro_sql": "{% macro before_begin(sql) %}\n {{ make_hook_config(sql, inside_transaction=False) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.make_hook_config"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481803.876926, "supported_languages": null}, "macro.dbt.in_transaction": {"unique_id": "macro.dbt.in_transaction", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/hooks.sql", "original_file_path": "macros/materializations/hooks.sql", "name": "in_transaction", "macro_sql": "{% macro in_transaction(sql) %}\n {{ make_hook_config(sql, inside_transaction=True) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.make_hook_config"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481803.877075, "supported_languages": null}, "macro.dbt.after_commit": {"unique_id": "macro.dbt.after_commit", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/hooks.sql", "original_file_path": "macros/materializations/hooks.sql", "name": "after_commit", "macro_sql": "{% macro after_commit(sql) %}\n {{ make_hook_config(sql, inside_transaction=False) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.make_hook_config"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481803.877216, "supported_languages": null}, "macro.dbt.set_sql_header": {"unique_id": "macro.dbt.set_sql_header", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/configs.sql", "original_file_path": "macros/materializations/configs.sql", "name": "set_sql_header", "macro_sql": "{% macro set_sql_header(config) -%}\n {{ config.set('sql_header', caller()) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481803.8776698, "supported_languages": null}, "macro.dbt.should_full_refresh": {"unique_id": "macro.dbt.should_full_refresh", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/configs.sql", "original_file_path": "macros/materializations/configs.sql", "name": "should_full_refresh", "macro_sql": "{% macro should_full_refresh() %}\n {% set config_full_refresh = config.get('full_refresh') %}\n {% if config_full_refresh is none %}\n {% set config_full_refresh = flags.FULL_REFRESH %}\n {% endif %}\n {% do return(config_full_refresh) %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481803.877974, "supported_languages": null}, "macro.dbt.should_store_failures": {"unique_id": "macro.dbt.should_store_failures", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/configs.sql", "original_file_path": "macros/materializations/configs.sql", "name": "should_store_failures", "macro_sql": "{% macro should_store_failures() %}\n {% set config_store_failures = config.get('store_failures') %}\n {% if config_store_failures is none %}\n {% set config_store_failures = flags.STORE_FAILURES %}\n {% endif %}\n {% do return(config_store_failures) %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481803.8782778, "supported_languages": null}, "macro.dbt.snapshot_merge_sql": {"unique_id": "macro.dbt.snapshot_merge_sql", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshots/snapshot_merge.sql", "original_file_path": "macros/materializations/snapshots/snapshot_merge.sql", "name": "snapshot_merge_sql", "macro_sql": "{% macro snapshot_merge_sql(target, source, insert_cols) -%}\n {{ adapter.dispatch('snapshot_merge_sql', 'dbt')(target, source, insert_cols) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_postgres.postgres__snapshot_merge_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481803.878788, "supported_languages": null}, "macro.dbt.default__snapshot_merge_sql": {"unique_id": "macro.dbt.default__snapshot_merge_sql", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshots/snapshot_merge.sql", "original_file_path": "macros/materializations/snapshots/snapshot_merge.sql", "name": "default__snapshot_merge_sql", "macro_sql": "{% macro default__snapshot_merge_sql(target, source, insert_cols) -%}\n {%- set insert_cols_csv = insert_cols | join(', ') -%}\n\n merge into {{ target }} as DBT_INTERNAL_DEST\n using {{ source }} as DBT_INTERNAL_SOURCE\n on DBT_INTERNAL_SOURCE.dbt_scd_id = DBT_INTERNAL_DEST.dbt_scd_id\n\n when matched\n and DBT_INTERNAL_DEST.dbt_valid_to is null\n and DBT_INTERNAL_SOURCE.dbt_change_type in ('update', 'delete')\n then update\n set dbt_valid_to = DBT_INTERNAL_SOURCE.dbt_valid_to\n\n when not matched\n and DBT_INTERNAL_SOURCE.dbt_change_type = 'insert'\n then insert ({{ insert_cols_csv }})\n values ({{ insert_cols_csv }})\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481803.879061, "supported_languages": null}, "macro.dbt.strategy_dispatch": {"unique_id": "macro.dbt.strategy_dispatch", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshots/strategies.sql", "original_file_path": "macros/materializations/snapshots/strategies.sql", "name": "strategy_dispatch", "macro_sql": "{% macro strategy_dispatch(name) -%}\n{% set original_name = name %}\n {% if '.' in name %}\n {% set package_name, name = name.split(\".\", 1) %}\n {% else %}\n {% set package_name = none %}\n {% endif %}\n\n {% if package_name is none %}\n {% set package_context = context %}\n {% elif package_name in context %}\n {% set package_context = context[package_name] %}\n {% else %}\n {% set error_msg %}\n Could not find package '{{package_name}}', called with '{{original_name}}'\n {% endset %}\n {{ exceptions.raise_compiler_error(error_msg | trim) }}\n {% endif %}\n\n {%- set search_name = 'snapshot_' ~ name ~ '_strategy' -%}\n\n {% if search_name not in package_context %}\n {% set error_msg %}\n The specified strategy macro '{{name}}' was not found in package '{{ package_name }}'\n {% endset %}\n {{ exceptions.raise_compiler_error(error_msg | trim) }}\n {% endif %}\n {{ return(package_context[search_name]) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481803.8825002, "supported_languages": null}, "macro.dbt.snapshot_hash_arguments": {"unique_id": "macro.dbt.snapshot_hash_arguments", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshots/strategies.sql", "original_file_path": "macros/materializations/snapshots/strategies.sql", "name": "snapshot_hash_arguments", "macro_sql": "{% macro snapshot_hash_arguments(args) -%}\n {{ adapter.dispatch('snapshot_hash_arguments', 'dbt')(args) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__snapshot_hash_arguments"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481803.882672, "supported_languages": null}, "macro.dbt.default__snapshot_hash_arguments": {"unique_id": "macro.dbt.default__snapshot_hash_arguments", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshots/strategies.sql", "original_file_path": "macros/materializations/snapshots/strategies.sql", "name": "default__snapshot_hash_arguments", "macro_sql": "{% macro default__snapshot_hash_arguments(args) -%}\n md5({%- for arg in args -%}\n coalesce(cast({{ arg }} as varchar ), '')\n {% if not loop.last %} || '|' || {% endif %}\n {%- endfor -%})\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481803.8829172, "supported_languages": null}, "macro.dbt.snapshot_timestamp_strategy": {"unique_id": "macro.dbt.snapshot_timestamp_strategy", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshots/strategies.sql", "original_file_path": "macros/materializations/snapshots/strategies.sql", "name": "snapshot_timestamp_strategy", "macro_sql": "{% macro snapshot_timestamp_strategy(node, snapshotted_rel, current_rel, config, target_exists) %}\n {% set primary_key = config['unique_key'] %}\n {% set updated_at = config['updated_at'] %}\n {% set invalidate_hard_deletes = config.get('invalidate_hard_deletes', false) %}\n\n {#/*\n The snapshot relation might not have an {{ updated_at }} value if the\n snapshot strategy is changed from `check` to `timestamp`. We\n should use a dbt-created column for the comparison in the snapshot\n table instead of assuming that the user-supplied {{ updated_at }}\n will be present in the historical data.\n\n See https://github.com/dbt-labs/dbt-core/issues/2350\n */ #}\n {% set row_changed_expr -%}\n ({{ snapshotted_rel }}.dbt_valid_from < {{ current_rel }}.{{ updated_at }})\n {%- endset %}\n\n {% set scd_id_expr = snapshot_hash_arguments([primary_key, updated_at]) %}\n\n {% do return({\n \"unique_key\": primary_key,\n \"updated_at\": updated_at,\n \"row_changed\": row_changed_expr,\n \"scd_id\": scd_id_expr,\n \"invalidate_hard_deletes\": invalidate_hard_deletes\n }) %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.snapshot_hash_arguments"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481803.883661, "supported_languages": null}, "macro.dbt.snapshot_string_as_time": {"unique_id": "macro.dbt.snapshot_string_as_time", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshots/strategies.sql", "original_file_path": "macros/materializations/snapshots/strategies.sql", "name": "snapshot_string_as_time", "macro_sql": "{% macro snapshot_string_as_time(timestamp) -%}\n {{ adapter.dispatch('snapshot_string_as_time', 'dbt')(timestamp) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_postgres.postgres__snapshot_string_as_time"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481803.883838, "supported_languages": null}, "macro.dbt.default__snapshot_string_as_time": {"unique_id": "macro.dbt.default__snapshot_string_as_time", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshots/strategies.sql", "original_file_path": "macros/materializations/snapshots/strategies.sql", "name": "default__snapshot_string_as_time", "macro_sql": "{% macro default__snapshot_string_as_time(timestamp) %}\n {% do exceptions.raise_not_implemented(\n 'snapshot_string_as_time macro not implemented for adapter '+adapter.type()\n ) %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481803.884016, "supported_languages": null}, "macro.dbt.snapshot_check_all_get_existing_columns": {"unique_id": "macro.dbt.snapshot_check_all_get_existing_columns", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshots/strategies.sql", "original_file_path": "macros/materializations/snapshots/strategies.sql", "name": "snapshot_check_all_get_existing_columns", "macro_sql": "{% macro snapshot_check_all_get_existing_columns(node, target_exists, check_cols_config) -%}\n {%- if not target_exists -%}\n {#-- no table yet -> return whatever the query does --#}\n {{ return((false, query_columns)) }}\n {%- endif -%}\n\n {#-- handle any schema changes --#}\n {%- set target_relation = adapter.get_relation(database=node.database, schema=node.schema, identifier=node.alias) -%}\n\n {% if check_cols_config == 'all' %}\n {%- set query_columns = get_columns_in_query(node['compiled_code']) -%}\n\n {% elif check_cols_config is iterable and (check_cols_config | length) > 0 %}\n {#-- query for proper casing/quoting, to support comparison below --#}\n {%- set select_check_cols_from_target -%}\n select {{ check_cols_config | join(', ') }} from ({{ node['compiled_code'] }}) subq\n {%- endset -%}\n {% set query_columns = get_columns_in_query(select_check_cols_from_target) %}\n\n {% else %}\n {% do exceptions.raise_compiler_error(\"Invalid value for 'check_cols': \" ~ check_cols_config) %}\n {% endif %}\n\n {%- set existing_cols = adapter.get_columns_in_relation(target_relation) | map(attribute = 'name') | list -%}\n {%- set ns = namespace() -%} {#-- handle for-loop scoping with a namespace --#}\n {%- set ns.column_added = false -%}\n\n {%- set intersection = [] -%}\n {%- for col in query_columns -%}\n {%- if col in existing_cols -%}\n {%- do intersection.append(adapter.quote(col)) -%}\n {%- else -%}\n {% set ns.column_added = true %}\n {%- endif -%}\n {%- endfor -%}\n {{ return((ns.column_added, intersection)) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.get_columns_in_query"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481803.885453, "supported_languages": null}, "macro.dbt.snapshot_check_strategy": {"unique_id": "macro.dbt.snapshot_check_strategy", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshots/strategies.sql", "original_file_path": "macros/materializations/snapshots/strategies.sql", "name": "snapshot_check_strategy", "macro_sql": "{% macro snapshot_check_strategy(node, snapshotted_rel, current_rel, config, target_exists) %}\n {% set check_cols_config = config['check_cols'] %}\n {% set primary_key = config['unique_key'] %}\n {% set invalidate_hard_deletes = config.get('invalidate_hard_deletes', false) %}\n {% set updated_at = config.get('updated_at', snapshot_get_time()) %}\n\n {% set column_added = false %}\n\n {% set column_added, check_cols = snapshot_check_all_get_existing_columns(node, target_exists, check_cols_config) %}\n\n {%- set row_changed_expr -%}\n (\n {%- if column_added -%}\n {{ get_true_sql() }}\n {%- else -%}\n {%- for col in check_cols -%}\n {{ snapshotted_rel }}.{{ col }} != {{ current_rel }}.{{ col }}\n or\n (\n (({{ snapshotted_rel }}.{{ col }} is null) and not ({{ current_rel }}.{{ col }} is null))\n or\n ((not {{ snapshotted_rel }}.{{ col }} is null) and ({{ current_rel }}.{{ col }} is null))\n )\n {%- if not loop.last %} or {% endif -%}\n {%- endfor -%}\n {%- endif -%}\n )\n {%- endset %}\n\n {% set scd_id_expr = snapshot_hash_arguments([primary_key, updated_at]) %}\n\n {% do return({\n \"unique_key\": primary_key,\n \"updated_at\": updated_at,\n \"row_changed\": row_changed_expr,\n \"scd_id\": scd_id_expr,\n \"invalidate_hard_deletes\": invalidate_hard_deletes\n }) %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.snapshot_get_time", "macro.dbt.snapshot_check_all_get_existing_columns", "macro.dbt.get_true_sql", "macro.dbt.snapshot_hash_arguments"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481803.886813, "supported_languages": null}, "macro.dbt.create_columns": {"unique_id": "macro.dbt.create_columns", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshots/helpers.sql", "original_file_path": "macros/materializations/snapshots/helpers.sql", "name": "create_columns", "macro_sql": "{% macro create_columns(relation, columns) %}\n {{ adapter.dispatch('create_columns', 'dbt')(relation, columns) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__create_columns"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481803.8906739, "supported_languages": null}, "macro.dbt.default__create_columns": {"unique_id": "macro.dbt.default__create_columns", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshots/helpers.sql", "original_file_path": "macros/materializations/snapshots/helpers.sql", "name": "default__create_columns", "macro_sql": "{% macro default__create_columns(relation, columns) %}\n {% for column in columns %}\n {% call statement() %}\n alter table {{ relation }} add column \"{{ column.name }}\" {{ column.data_type }};\n {% endcall %}\n {% endfor %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481803.890965, "supported_languages": null}, "macro.dbt.post_snapshot": {"unique_id": "macro.dbt.post_snapshot", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshots/helpers.sql", "original_file_path": "macros/materializations/snapshots/helpers.sql", "name": "post_snapshot", "macro_sql": "{% macro post_snapshot(staging_relation) %}\n {{ adapter.dispatch('post_snapshot', 'dbt')(staging_relation) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__post_snapshot"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481803.891134, "supported_languages": null}, "macro.dbt.default__post_snapshot": {"unique_id": "macro.dbt.default__post_snapshot", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshots/helpers.sql", "original_file_path": "macros/materializations/snapshots/helpers.sql", "name": "default__post_snapshot", "macro_sql": "{% macro default__post_snapshot(staging_relation) %}\n {# no-op #}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481803.891221, "supported_languages": null}, "macro.dbt.get_true_sql": {"unique_id": "macro.dbt.get_true_sql", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshots/helpers.sql", "original_file_path": "macros/materializations/snapshots/helpers.sql", "name": "get_true_sql", "macro_sql": "{% macro get_true_sql() %}\n {{ adapter.dispatch('get_true_sql', 'dbt')() }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__get_true_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481803.89137, "supported_languages": null}, "macro.dbt.default__get_true_sql": {"unique_id": "macro.dbt.default__get_true_sql", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshots/helpers.sql", "original_file_path": "macros/materializations/snapshots/helpers.sql", "name": "default__get_true_sql", "macro_sql": "{% macro default__get_true_sql() %}\n {{ return('TRUE') }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481803.891482, "supported_languages": null}, "macro.dbt.snapshot_staging_table": {"unique_id": "macro.dbt.snapshot_staging_table", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshots/helpers.sql", "original_file_path": "macros/materializations/snapshots/helpers.sql", "name": "snapshot_staging_table", "macro_sql": "{% macro snapshot_staging_table(strategy, source_sql, target_relation) -%}\n {{ adapter.dispatch('snapshot_staging_table', 'dbt')(strategy, source_sql, target_relation) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__snapshot_staging_table"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481803.891687, "supported_languages": null}, "macro.dbt.default__snapshot_staging_table": {"unique_id": "macro.dbt.default__snapshot_staging_table", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshots/helpers.sql", "original_file_path": "macros/materializations/snapshots/helpers.sql", "name": "default__snapshot_staging_table", "macro_sql": "{% macro default__snapshot_staging_table(strategy, source_sql, target_relation) -%}\n\n with snapshot_query as (\n\n {{ source_sql }}\n\n ),\n\n snapshotted_data as (\n\n select *,\n {{ strategy.unique_key }} as dbt_unique_key\n\n from {{ target_relation }}\n where dbt_valid_to is null\n\n ),\n\n insertions_source_data as (\n\n select\n *,\n {{ strategy.unique_key }} as dbt_unique_key,\n {{ strategy.updated_at }} as dbt_updated_at,\n {{ strategy.updated_at }} as dbt_valid_from,\n nullif({{ strategy.updated_at }}, {{ strategy.updated_at }}) as dbt_valid_to,\n {{ strategy.scd_id }} as dbt_scd_id\n\n from snapshot_query\n ),\n\n updates_source_data as (\n\n select\n *,\n {{ strategy.unique_key }} as dbt_unique_key,\n {{ strategy.updated_at }} as dbt_updated_at,\n {{ strategy.updated_at }} as dbt_valid_from,\n {{ strategy.updated_at }} as dbt_valid_to\n\n from snapshot_query\n ),\n\n {%- if strategy.invalidate_hard_deletes %}\n\n deletes_source_data as (\n\n select\n *,\n {{ strategy.unique_key }} as dbt_unique_key\n from snapshot_query\n ),\n {% endif %}\n\n insertions as (\n\n select\n 'insert' as dbt_change_type,\n source_data.*\n\n from insertions_source_data as source_data\n left outer join snapshotted_data on snapshotted_data.dbt_unique_key = source_data.dbt_unique_key\n where snapshotted_data.dbt_unique_key is null\n or (\n snapshotted_data.dbt_unique_key is not null\n and (\n {{ strategy.row_changed }}\n )\n )\n\n ),\n\n updates as (\n\n select\n 'update' as dbt_change_type,\n source_data.*,\n snapshotted_data.dbt_scd_id\n\n from updates_source_data as source_data\n join snapshotted_data on snapshotted_data.dbt_unique_key = source_data.dbt_unique_key\n where (\n {{ strategy.row_changed }}\n )\n )\n\n {%- if strategy.invalidate_hard_deletes -%}\n ,\n\n deletes as (\n\n select\n 'delete' as dbt_change_type,\n source_data.*,\n {{ snapshot_get_time() }} as dbt_valid_from,\n {{ snapshot_get_time() }} as dbt_updated_at,\n {{ snapshot_get_time() }} as dbt_valid_to,\n snapshotted_data.dbt_scd_id\n\n from snapshotted_data\n left join deletes_source_data as source_data on snapshotted_data.dbt_unique_key = source_data.dbt_unique_key\n where source_data.dbt_unique_key is null\n )\n {%- endif %}\n\n select * from insertions\n union all\n select * from updates\n {%- if strategy.invalidate_hard_deletes %}\n union all\n select * from deletes\n {%- endif %}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.snapshot_get_time"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481803.8925812, "supported_languages": null}, "macro.dbt.build_snapshot_table": {"unique_id": "macro.dbt.build_snapshot_table", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshots/helpers.sql", "original_file_path": "macros/materializations/snapshots/helpers.sql", "name": "build_snapshot_table", "macro_sql": "{% macro build_snapshot_table(strategy, sql) -%}\n {{ adapter.dispatch('build_snapshot_table', 'dbt')(strategy, sql) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__build_snapshot_table"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481803.892788, "supported_languages": null}, "macro.dbt.default__build_snapshot_table": {"unique_id": "macro.dbt.default__build_snapshot_table", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshots/helpers.sql", "original_file_path": "macros/materializations/snapshots/helpers.sql", "name": "default__build_snapshot_table", "macro_sql": "{% macro default__build_snapshot_table(strategy, sql) %}\n\n select *,\n {{ strategy.scd_id }} as dbt_scd_id,\n {{ strategy.updated_at }} as dbt_updated_at,\n {{ strategy.updated_at }} as dbt_valid_from,\n nullif({{ strategy.updated_at }}, {{ strategy.updated_at }}) as dbt_valid_to\n from (\n {{ sql }}\n ) sbq\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481803.893045, "supported_languages": null}, "macro.dbt.build_snapshot_staging_table": {"unique_id": "macro.dbt.build_snapshot_staging_table", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshots/helpers.sql", "original_file_path": "macros/materializations/snapshots/helpers.sql", "name": "build_snapshot_staging_table", "macro_sql": "{% macro build_snapshot_staging_table(strategy, sql, target_relation) %}\n {% set temp_relation = make_temp_relation(target_relation) %}\n\n {% set select = snapshot_staging_table(strategy, sql, target_relation) %}\n\n {% call statement('build_snapshot_staging_relation') %}\n {{ create_table_as(True, temp_relation, select) }}\n {% endcall %}\n\n {% do return(temp_relation) %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.make_temp_relation", "macro.dbt.snapshot_staging_table", "macro.dbt.statement", "macro.dbt.create_table_as"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481803.8934798, "supported_languages": null}, "macro.dbt.materialization_snapshot_default": {"unique_id": "macro.dbt.materialization_snapshot_default", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshots/snapshot.sql", "original_file_path": "macros/materializations/snapshots/snapshot.sql", "name": "materialization_snapshot_default", "macro_sql": "{% materialization snapshot, default %}\n {%- set config = model['config'] -%}\n\n {%- set target_table = model.get('alias', model.get('name')) -%}\n\n {%- set strategy_name = config.get('strategy') -%}\n {%- set unique_key = config.get('unique_key') %}\n -- grab current tables grants config for comparision later on\n {%- set grant_config = config.get('grants') -%}\n\n {% set target_relation_exists, target_relation = get_or_create_relation(\n database=model.database,\n schema=model.schema,\n identifier=target_table,\n type='table') -%}\n\n {%- if not target_relation.is_table -%}\n {% do exceptions.relation_wrong_type(target_relation, 'table') %}\n {%- endif -%}\n\n\n {{ run_hooks(pre_hooks, inside_transaction=False) }}\n\n {{ run_hooks(pre_hooks, inside_transaction=True) }}\n\n {% set strategy_macro = strategy_dispatch(strategy_name) %}\n {% set strategy = strategy_macro(model, \"snapshotted_data\", \"source_data\", config, target_relation_exists) %}\n\n {% if not target_relation_exists %}\n\n {% set build_sql = build_snapshot_table(strategy, model['compiled_code']) %}\n {% set final_sql = create_table_as(False, target_relation, build_sql) %}\n\n {% else %}\n\n {{ adapter.valid_snapshot_target(target_relation) }}\n\n {% set staging_table = build_snapshot_staging_table(strategy, sql, target_relation) %}\n\n -- this may no-op if the database does not require column expansion\n {% do adapter.expand_target_column_types(from_relation=staging_table,\n to_relation=target_relation) %}\n\n {% set missing_columns = adapter.get_missing_columns(staging_table, target_relation)\n | rejectattr('name', 'equalto', 'dbt_change_type')\n | rejectattr('name', 'equalto', 'DBT_CHANGE_TYPE')\n | rejectattr('name', 'equalto', 'dbt_unique_key')\n | rejectattr('name', 'equalto', 'DBT_UNIQUE_KEY')\n | list %}\n\n {% do create_columns(target_relation, missing_columns) %}\n\n {% set source_columns = adapter.get_columns_in_relation(staging_table)\n | rejectattr('name', 'equalto', 'dbt_change_type')\n | rejectattr('name', 'equalto', 'DBT_CHANGE_TYPE')\n | rejectattr('name', 'equalto', 'dbt_unique_key')\n | rejectattr('name', 'equalto', 'DBT_UNIQUE_KEY')\n | list %}\n\n {% set quoted_source_columns = [] %}\n {% for column in source_columns %}\n {% do quoted_source_columns.append(adapter.quote(column.name)) %}\n {% endfor %}\n\n {% set final_sql = snapshot_merge_sql(\n target = target_relation,\n source = staging_table,\n insert_cols = quoted_source_columns\n )\n %}\n\n {% endif %}\n\n {% call statement('main') %}\n {{ final_sql }}\n {% endcall %}\n\n {% set should_revoke = should_revoke(target_relation_exists, full_refresh_mode=False) %}\n {% do apply_grants(target_relation, grant_config, should_revoke=should_revoke) %}\n\n {% do persist_docs(target_relation, model) %}\n\n {% if not target_relation_exists %}\n {% do create_indexes(target_relation) %}\n {% endif %}\n\n {{ run_hooks(post_hooks, inside_transaction=True) }}\n\n {{ adapter.commit() }}\n\n {% if staging_table is defined %}\n {% do post_snapshot(staging_table) %}\n {% endif %}\n\n {{ run_hooks(post_hooks, inside_transaction=False) }}\n\n {{ return({'relations': [target_relation]}) }}\n\n{% endmaterialization %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.get_or_create_relation", "macro.dbt.run_hooks", "macro.dbt.strategy_dispatch", "macro.dbt.build_snapshot_table", "macro.dbt.create_table_as", "macro.dbt.build_snapshot_staging_table", "macro.dbt.create_columns", "macro.dbt.snapshot_merge_sql", "macro.dbt.statement", "macro.dbt.should_revoke", "macro.dbt.apply_grants", "macro.dbt.persist_docs", "macro.dbt.create_indexes", "macro.dbt.post_snapshot"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481803.899441, "supported_languages": ["sql"]}, "macro.dbt.materialization_test_default": {"unique_id": "macro.dbt.materialization_test_default", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/tests/test.sql", "original_file_path": "macros/materializations/tests/test.sql", "name": "materialization_test_default", "macro_sql": "{%- materialization test, default -%}\n\n {% set relations = [] %}\n\n {% if should_store_failures() %}\n\n {% set identifier = model['alias'] %}\n {% set old_relation = adapter.get_relation(database=database, schema=schema, identifier=identifier) %}\n {% set target_relation = api.Relation.create(\n identifier=identifier, schema=schema, database=database, type='table') -%} %}\n\n {% if old_relation %}\n {% do adapter.drop_relation(old_relation) %}\n {% endif %}\n\n {% call statement(auto_begin=True) %}\n {{ create_table_as(False, target_relation, sql) }}\n {% endcall %}\n\n {% do relations.append(target_relation) %}\n\n {% set main_sql %}\n select *\n from {{ target_relation }}\n {% endset %}\n\n {{ adapter.commit() }}\n\n {% else %}\n\n {% set main_sql = sql %}\n\n {% endif %}\n\n {% set limit = config.get('limit') %}\n {% set fail_calc = config.get('fail_calc') %}\n {% set warn_if = config.get('warn_if') %}\n {% set error_if = config.get('error_if') %}\n\n {% call statement('main', fetch_result=True) -%}\n\n {{ get_test_sql(main_sql, fail_calc, warn_if, error_if, limit)}}\n\n {%- endcall %}\n\n {{ return({'relations': relations}) }}\n\n{%- endmaterialization -%}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.should_store_failures", "macro.dbt.statement", "macro.dbt.create_table_as", "macro.dbt.get_test_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481803.9015691, "supported_languages": ["sql"]}, "macro.dbt.get_test_sql": {"unique_id": "macro.dbt.get_test_sql", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/tests/helpers.sql", "original_file_path": "macros/materializations/tests/helpers.sql", "name": "get_test_sql", "macro_sql": "{% macro get_test_sql(main_sql, fail_calc, warn_if, error_if, limit) -%}\n {{ adapter.dispatch('get_test_sql', 'dbt')(main_sql, fail_calc, warn_if, error_if, limit) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__get_test_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481803.9021142, "supported_languages": null}, "macro.dbt.default__get_test_sql": {"unique_id": "macro.dbt.default__get_test_sql", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/tests/helpers.sql", "original_file_path": "macros/materializations/tests/helpers.sql", "name": "default__get_test_sql", "macro_sql": "{% macro default__get_test_sql(main_sql, fail_calc, warn_if, error_if, limit) -%}\n select\n {{ fail_calc }} as failures,\n {{ fail_calc }} {{ warn_if }} as should_warn,\n {{ fail_calc }} {{ error_if }} as should_error\n from (\n {{ main_sql }}\n {{ \"limit \" ~ limit if limit != none }}\n ) dbt_internal_test\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481803.902425, "supported_languages": null}, "macro.dbt.get_where_subquery": {"unique_id": "macro.dbt.get_where_subquery", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/tests/where_subquery.sql", "original_file_path": "macros/materializations/tests/where_subquery.sql", "name": "get_where_subquery", "macro_sql": "{% macro get_where_subquery(relation) -%}\n {% do return(adapter.dispatch('get_where_subquery', 'dbt')(relation)) %}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__get_where_subquery"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481803.902876, "supported_languages": null}, "macro.dbt.default__get_where_subquery": {"unique_id": "macro.dbt.default__get_where_subquery", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/tests/where_subquery.sql", "original_file_path": "macros/materializations/tests/where_subquery.sql", "name": "default__get_where_subquery", "macro_sql": "{% macro default__get_where_subquery(relation) -%}\n {% set where = config.get('where', '') %}\n {% if where %}\n {%- set filtered -%}\n (select * from {{ relation }} where {{ where }}) dbt_subquery\n {%- endset -%}\n {% do return(filtered) %}\n {%- else -%}\n {% do return(relation) %}\n {%- endif -%}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481803.9032588, "supported_languages": null}, "macro.dbt.get_quoted_csv": {"unique_id": "macro.dbt.get_quoted_csv", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/incremental/column_helpers.sql", "original_file_path": "macros/materializations/models/incremental/column_helpers.sql", "name": "get_quoted_csv", "macro_sql": "{% macro get_quoted_csv(column_names) %}\n\n {% set quoted = [] %}\n {% for col in column_names -%}\n {%- do quoted.append(adapter.quote(col)) -%}\n {%- endfor %}\n\n {%- set dest_cols_csv = quoted | join(', ') -%}\n {{ return(dest_cols_csv) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481803.904844, "supported_languages": null}, "macro.dbt.diff_columns": {"unique_id": "macro.dbt.diff_columns", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/incremental/column_helpers.sql", "original_file_path": "macros/materializations/models/incremental/column_helpers.sql", "name": "diff_columns", "macro_sql": "{% macro diff_columns(source_columns, target_columns) %}\n\n {% set result = [] %}\n {% set source_names = source_columns | map(attribute = 'column') | list %}\n {% set target_names = target_columns | map(attribute = 'column') | list %}\n\n {# --check whether the name attribute exists in the target - this does not perform a data type check #}\n {% for sc in source_columns %}\n {% if sc.name not in target_names %}\n {{ result.append(sc) }}\n {% endif %}\n {% endfor %}\n\n {{ return(result) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481803.9054, "supported_languages": null}, "macro.dbt.diff_column_data_types": {"unique_id": "macro.dbt.diff_column_data_types", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/incremental/column_helpers.sql", "original_file_path": "macros/materializations/models/incremental/column_helpers.sql", "name": "diff_column_data_types", "macro_sql": "{% macro diff_column_data_types(source_columns, target_columns) %}\n\n {% set result = [] %}\n {% for sc in source_columns %}\n {% set tc = target_columns | selectattr(\"name\", \"equalto\", sc.name) | list | first %}\n {% if tc %}\n {% if sc.data_type != tc.data_type and not sc.can_expand_to(other_column=tc) %}\n {{ result.append( { 'column_name': tc.name, 'new_type': sc.data_type } ) }}\n {% endif %}\n {% endif %}\n {% endfor %}\n\n {{ return(result) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481803.906087, "supported_languages": null}, "macro.dbt.get_merge_update_columns": {"unique_id": "macro.dbt.get_merge_update_columns", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/incremental/column_helpers.sql", "original_file_path": "macros/materializations/models/incremental/column_helpers.sql", "name": "get_merge_update_columns", "macro_sql": "{% macro get_merge_update_columns(merge_update_columns, merge_exclude_columns, dest_columns) %}\n {{ return(adapter.dispatch('get_merge_update_columns', 'dbt')(merge_update_columns, merge_exclude_columns, dest_columns)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__get_merge_update_columns"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481803.906328, "supported_languages": null}, "macro.dbt.default__get_merge_update_columns": {"unique_id": "macro.dbt.default__get_merge_update_columns", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/incremental/column_helpers.sql", "original_file_path": "macros/materializations/models/incremental/column_helpers.sql", "name": "default__get_merge_update_columns", "macro_sql": "{% macro default__get_merge_update_columns(merge_update_columns, merge_exclude_columns, dest_columns) %}\n {%- set default_cols = dest_columns | map(attribute=\"quoted\") | list -%}\n\n {%- if merge_update_columns and merge_exclude_columns -%}\n {{ exceptions.raise_compiler_error(\n 'Model cannot specify merge_update_columns and merge_exclude_columns. Please update model to use only one config'\n )}}\n {%- elif merge_update_columns -%}\n {%- set update_columns = merge_update_columns -%}\n {%- elif merge_exclude_columns -%}\n {%- set update_columns = [] -%}\n {%- for column in dest_columns -%}\n {% if column.column | lower not in merge_exclude_columns | map(\"lower\") | list %}\n {%- do update_columns.append(column.quoted) -%}\n {% endif %}\n {%- endfor -%}\n {%- else -%}\n {%- set update_columns = default_cols -%}\n {%- endif -%}\n\n {{ return(update_columns) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481803.907079, "supported_languages": null}, "macro.dbt.get_merge_sql": {"unique_id": "macro.dbt.get_merge_sql", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/incremental/merge.sql", "original_file_path": "macros/materializations/models/incremental/merge.sql", "name": "get_merge_sql", "macro_sql": "{% macro get_merge_sql(target, source, unique_key, dest_columns, predicates=none) -%}\n {{ adapter.dispatch('get_merge_sql', 'dbt')(target, source, unique_key, dest_columns, predicates) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__get_merge_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481803.91138, "supported_languages": null}, "macro.dbt.default__get_merge_sql": {"unique_id": "macro.dbt.default__get_merge_sql", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/incremental/merge.sql", "original_file_path": "macros/materializations/models/incremental/merge.sql", "name": "default__get_merge_sql", "macro_sql": "{% macro default__get_merge_sql(target, source, unique_key, dest_columns, predicates) -%}\n {%- set predicates = [] if predicates is none else [] + predicates -%}\n {%- set dest_cols_csv = get_quoted_csv(dest_columns | map(attribute=\"name\")) -%}\n {%- set merge_update_columns = config.get('merge_update_columns') -%}\n {%- set merge_exclude_columns = config.get('merge_exclude_columns') -%}\n {%- set update_columns = get_merge_update_columns(merge_update_columns, merge_exclude_columns, dest_columns) -%}\n {%- set sql_header = config.get('sql_header', none) -%}\n\n {% if unique_key %}\n {% if unique_key is sequence and unique_key is not mapping and unique_key is not string %}\n {% for key in unique_key %}\n {% set this_key_match %}\n DBT_INTERNAL_SOURCE.{{ key }} = DBT_INTERNAL_DEST.{{ key }}\n {% endset %}\n {% do predicates.append(this_key_match) %}\n {% endfor %}\n {% else %}\n {% set unique_key_match %}\n DBT_INTERNAL_SOURCE.{{ unique_key }} = DBT_INTERNAL_DEST.{{ unique_key }}\n {% endset %}\n {% do predicates.append(unique_key_match) %}\n {% endif %}\n {% else %}\n {% do predicates.append('FALSE') %}\n {% endif %}\n\n {{ sql_header if sql_header is not none }}\n\n merge into {{ target }} as DBT_INTERNAL_DEST\n using {{ source }} as DBT_INTERNAL_SOURCE\n on {{ predicates | join(' and ') }}\n\n {% if unique_key %}\n when matched then update set\n {% for column_name in update_columns -%}\n {{ column_name }} = DBT_INTERNAL_SOURCE.{{ column_name }}\n {%- if not loop.last %}, {%- endif %}\n {%- endfor %}\n {% endif %}\n\n when not matched then insert\n ({{ dest_cols_csv }})\n values\n ({{ dest_cols_csv }})\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.get_quoted_csv", "macro.dbt.get_merge_update_columns"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481803.913067, "supported_languages": null}, "macro.dbt.get_delete_insert_merge_sql": {"unique_id": "macro.dbt.get_delete_insert_merge_sql", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/incremental/merge.sql", "original_file_path": "macros/materializations/models/incremental/merge.sql", "name": "get_delete_insert_merge_sql", "macro_sql": "{% macro get_delete_insert_merge_sql(target, source, unique_key, dest_columns) -%}\n {{ adapter.dispatch('get_delete_insert_merge_sql', 'dbt')(target, source, unique_key, dest_columns) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__get_delete_insert_merge_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481803.913321, "supported_languages": null}, "macro.dbt.default__get_delete_insert_merge_sql": {"unique_id": "macro.dbt.default__get_delete_insert_merge_sql", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/incremental/merge.sql", "original_file_path": "macros/materializations/models/incremental/merge.sql", "name": "default__get_delete_insert_merge_sql", "macro_sql": "{% macro default__get_delete_insert_merge_sql(target, source, unique_key, dest_columns) -%}\n\n {%- set dest_cols_csv = get_quoted_csv(dest_columns | map(attribute=\"name\")) -%}\n\n {% if unique_key %}\n {% if unique_key is sequence and unique_key is not string %}\n delete from {{target }}\n using {{ source }}\n where (\n {% for key in unique_key %}\n {{ source }}.{{ key }} = {{ target }}.{{ key }}\n {{ \"and \" if not loop.last }}\n {% endfor %}\n );\n {% else %}\n delete from {{ target }}\n where (\n {{ unique_key }}) in (\n select ({{ unique_key }})\n from {{ source }}\n );\n\n {% endif %}\n {% endif %}\n\n insert into {{ target }} ({{ dest_cols_csv }})\n (\n select {{ dest_cols_csv }}\n from {{ source }}\n )\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.get_quoted_csv"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481803.91409, "supported_languages": null}, "macro.dbt.get_insert_overwrite_merge_sql": {"unique_id": "macro.dbt.get_insert_overwrite_merge_sql", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/incremental/merge.sql", "original_file_path": "macros/materializations/models/incremental/merge.sql", "name": "get_insert_overwrite_merge_sql", "macro_sql": "{% macro get_insert_overwrite_merge_sql(target, source, dest_columns, predicates, include_sql_header=false) -%}\n {{ adapter.dispatch('get_insert_overwrite_merge_sql', 'dbt')(target, source, dest_columns, predicates, include_sql_header) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__get_insert_overwrite_merge_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481803.9143932, "supported_languages": null}, "macro.dbt.default__get_insert_overwrite_merge_sql": {"unique_id": "macro.dbt.default__get_insert_overwrite_merge_sql", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/incremental/merge.sql", "original_file_path": "macros/materializations/models/incremental/merge.sql", "name": "default__get_insert_overwrite_merge_sql", "macro_sql": "{% macro default__get_insert_overwrite_merge_sql(target, source, dest_columns, predicates, include_sql_header) -%}\n {#-- The only time include_sql_header is True: --#}\n {#-- BigQuery + insert_overwrite strategy + \"static\" partitions config --#}\n {#-- We should consider including the sql header at the materialization level instead --#}\n\n {%- set predicates = [] if predicates is none else [] + predicates -%}\n {%- set dest_cols_csv = get_quoted_csv(dest_columns | map(attribute=\"name\")) -%}\n {%- set sql_header = config.get('sql_header', none) -%}\n\n {{ sql_header if sql_header is not none and include_sql_header }}\n\n merge into {{ target }} as DBT_INTERNAL_DEST\n using {{ source }} as DBT_INTERNAL_SOURCE\n on FALSE\n\n when not matched by source\n {% if predicates %} and {{ predicates | join(' and ') }} {% endif %}\n then delete\n\n when not matched then insert\n ({{ dest_cols_csv }})\n values\n ({{ dest_cols_csv }})\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.get_quoted_csv"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481803.915062, "supported_languages": null}, "macro.dbt.is_incremental": {"unique_id": "macro.dbt.is_incremental", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/incremental/is_incremental.sql", "original_file_path": "macros/materializations/models/incremental/is_incremental.sql", "name": "is_incremental", "macro_sql": "{% macro is_incremental() %}\n {#-- do not run introspective queries in parsing #}\n {% if not execute %}\n {{ return(False) }}\n {% else %}\n {% set relation = adapter.get_relation(this.database, this.schema, this.table) %}\n {{ return(relation is not none\n and relation.type == 'table'\n and model.config.materialized == 'incremental'\n and not should_full_refresh()) }}\n {% endif %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.should_full_refresh"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481803.915814, "supported_languages": null}, "macro.dbt.get_incremental_append_sql": {"unique_id": "macro.dbt.get_incremental_append_sql", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/incremental/strategies.sql", "original_file_path": "macros/materializations/models/incremental/strategies.sql", "name": "get_incremental_append_sql", "macro_sql": "{% macro get_incremental_append_sql(arg_dict) %}\n\n {{ return(adapter.dispatch('get_incremental_append_sql', 'dbt')(arg_dict)) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__get_incremental_append_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481803.916738, "supported_languages": null}, "macro.dbt.default__get_incremental_append_sql": {"unique_id": "macro.dbt.default__get_incremental_append_sql", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/incremental/strategies.sql", "original_file_path": "macros/materializations/models/incremental/strategies.sql", "name": "default__get_incremental_append_sql", "macro_sql": "{% macro default__get_incremental_append_sql(arg_dict) %}\n\n {% do return(get_insert_into_sql(arg_dict[\"target_relation\"], arg_dict[\"temp_relation\"], arg_dict[\"dest_columns\"])) %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.get_insert_into_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481803.916982, "supported_languages": null}, "macro.dbt.get_incremental_delete_insert_sql": {"unique_id": "macro.dbt.get_incremental_delete_insert_sql", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/incremental/strategies.sql", "original_file_path": "macros/materializations/models/incremental/strategies.sql", "name": "get_incremental_delete_insert_sql", "macro_sql": "{% macro get_incremental_delete_insert_sql(arg_dict) %}\n\n {{ return(adapter.dispatch('get_incremental_delete_insert_sql', 'dbt')(arg_dict)) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__get_incremental_delete_insert_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481803.917173, "supported_languages": null}, "macro.dbt.default__get_incremental_delete_insert_sql": {"unique_id": "macro.dbt.default__get_incremental_delete_insert_sql", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/incremental/strategies.sql", "original_file_path": "macros/materializations/models/incremental/strategies.sql", "name": "default__get_incremental_delete_insert_sql", "macro_sql": "{% macro default__get_incremental_delete_insert_sql(arg_dict) %}\n\n {% do return(get_delete_insert_merge_sql(arg_dict[\"target_relation\"], arg_dict[\"temp_relation\"], arg_dict[\"unique_key\"], arg_dict[\"dest_columns\"])) %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.get_delete_insert_merge_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481803.917456, "supported_languages": null}, "macro.dbt.get_incremental_merge_sql": {"unique_id": "macro.dbt.get_incremental_merge_sql", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/incremental/strategies.sql", "original_file_path": "macros/materializations/models/incremental/strategies.sql", "name": "get_incremental_merge_sql", "macro_sql": "{% macro get_incremental_merge_sql(arg_dict) %}\n\n {{ return(adapter.dispatch('get_incremental_merge_sql', 'dbt')(arg_dict)) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__get_incremental_merge_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481803.917653, "supported_languages": null}, "macro.dbt.default__get_incremental_merge_sql": {"unique_id": "macro.dbt.default__get_incremental_merge_sql", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/incremental/strategies.sql", "original_file_path": "macros/materializations/models/incremental/strategies.sql", "name": "default__get_incremental_merge_sql", "macro_sql": "{% macro default__get_incremental_merge_sql(arg_dict) %}\n\n {% do return(get_merge_sql(arg_dict[\"target_relation\"], arg_dict[\"temp_relation\"], arg_dict[\"unique_key\"], arg_dict[\"dest_columns\"])) %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.get_merge_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481803.917922, "supported_languages": null}, "macro.dbt.get_incremental_insert_overwrite_sql": {"unique_id": "macro.dbt.get_incremental_insert_overwrite_sql", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/incremental/strategies.sql", "original_file_path": "macros/materializations/models/incremental/strategies.sql", "name": "get_incremental_insert_overwrite_sql", "macro_sql": "{% macro get_incremental_insert_overwrite_sql(arg_dict) %}\n\n {{ return(adapter.dispatch('get_incremental_insert_overwrite_sql', 'dbt')(arg_dict)) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__get_incremental_insert_overwrite_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481803.918114, "supported_languages": null}, "macro.dbt.default__get_incremental_insert_overwrite_sql": {"unique_id": "macro.dbt.default__get_incremental_insert_overwrite_sql", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/incremental/strategies.sql", "original_file_path": "macros/materializations/models/incremental/strategies.sql", "name": "default__get_incremental_insert_overwrite_sql", "macro_sql": "{% macro default__get_incremental_insert_overwrite_sql(arg_dict) %}\n\n {% do return(get_insert_overwrite_merge_sql(arg_dict[\"target_relation\"], arg_dict[\"temp_relation\"], arg_dict[\"dest_columns\"], arg_dict[\"predicates\"])) %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.get_insert_overwrite_merge_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481803.918384, "supported_languages": null}, "macro.dbt.get_incremental_default_sql": {"unique_id": "macro.dbt.get_incremental_default_sql", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/incremental/strategies.sql", "original_file_path": "macros/materializations/models/incremental/strategies.sql", "name": "get_incremental_default_sql", "macro_sql": "{% macro get_incremental_default_sql(arg_dict) %}\n\n {{ return(adapter.dispatch('get_incremental_default_sql', 'dbt')(arg_dict)) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_postgres.postgres__get_incremental_default_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481803.918581, "supported_languages": null}, "macro.dbt.default__get_incremental_default_sql": {"unique_id": "macro.dbt.default__get_incremental_default_sql", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/incremental/strategies.sql", "original_file_path": "macros/materializations/models/incremental/strategies.sql", "name": "default__get_incremental_default_sql", "macro_sql": "{% macro default__get_incremental_default_sql(arg_dict) %}\n\n {% do return(get_incremental_append_sql(arg_dict)) %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.get_incremental_append_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481803.918731, "supported_languages": null}, "macro.dbt.get_insert_into_sql": {"unique_id": "macro.dbt.get_insert_into_sql", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/incremental/strategies.sql", "original_file_path": "macros/materializations/models/incremental/strategies.sql", "name": "get_insert_into_sql", "macro_sql": "{% macro get_insert_into_sql(target_relation, temp_relation, dest_columns) %}\n\n {%- set dest_cols_csv = get_quoted_csv(dest_columns | map(attribute=\"name\")) -%}\n\n insert into {{ target_relation }} ({{ dest_cols_csv }})\n (\n select {{ dest_cols_csv }}\n from {{ temp_relation }}\n )\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.get_quoted_csv"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481803.919014, "supported_languages": null}, "macro.dbt.materialization_incremental_default": {"unique_id": "macro.dbt.materialization_incremental_default", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/incremental/incremental.sql", "original_file_path": "macros/materializations/models/incremental/incremental.sql", "name": "materialization_incremental_default", "macro_sql": "{% materialization incremental, default -%}\n\n -- relations\n {%- set existing_relation = load_cached_relation(this) -%}\n {%- set target_relation = this.incorporate(type='table') -%}\n {%- set temp_relation = make_temp_relation(target_relation)-%}\n {%- set intermediate_relation = make_intermediate_relation(target_relation)-%}\n {%- set backup_relation_type = 'table' if existing_relation is none else existing_relation.type -%}\n {%- set backup_relation = make_backup_relation(target_relation, backup_relation_type) -%}\n\n -- configs\n {%- set unique_key = config.get('unique_key') -%}\n {%- set full_refresh_mode = (should_full_refresh() or existing_relation.is_view) -%}\n {%- set on_schema_change = incremental_validate_on_schema_change(config.get('on_schema_change'), default='ignore') -%}\n\n -- the temp_ and backup_ relations should not already exist in the database; get_relation\n -- will return None in that case. Otherwise, we get a relation that we can drop\n -- later, before we try to use this name for the current operation. This has to happen before\n -- BEGIN, in a separate transaction\n {%- set preexisting_intermediate_relation = load_cached_relation(intermediate_relation)-%}\n {%- set preexisting_backup_relation = load_cached_relation(backup_relation) -%}\n -- grab current tables grants config for comparision later on\n {% set grant_config = config.get('grants') %}\n {{ drop_relation_if_exists(preexisting_intermediate_relation) }}\n {{ drop_relation_if_exists(preexisting_backup_relation) }}\n\n {{ run_hooks(pre_hooks, inside_transaction=False) }}\n\n -- `BEGIN` happens here:\n {{ run_hooks(pre_hooks, inside_transaction=True) }}\n\n {% set to_drop = [] %}\n\n {% if existing_relation is none %}\n {% set build_sql = get_create_table_as_sql(False, target_relation, sql) %}\n {% elif full_refresh_mode %}\n {% set build_sql = get_create_table_as_sql(False, intermediate_relation, sql) %}\n {% set need_swap = true %}\n {% else %}\n {% do run_query(get_create_table_as_sql(True, temp_relation, sql)) %}\n {% do adapter.expand_target_column_types(\n from_relation=temp_relation,\n to_relation=target_relation) %}\n {#-- Process schema changes. Returns dict of changes if successful. Use source columns for upserting/merging --#}\n {% set dest_columns = process_schema_changes(on_schema_change, temp_relation, existing_relation) %}\n {% if not dest_columns %}\n {% set dest_columns = adapter.get_columns_in_relation(existing_relation) %}\n {% endif %}\n\n {#-- Get the incremental_strategy, the macro to use for the strategy, and build the sql --#}\n {% set incremental_strategy = config.get('incremental_strategy') or 'default' %}\n {% set incremental_predicates = config.get('incremental_predicates', none) %}\n {% set strategy_sql_macro_func = adapter.get_incremental_strategy_macro(context, incremental_strategy) %}\n {% set strategy_arg_dict = ({'target_relation': target_relation, 'temp_relation': temp_relation, 'unique_key': unique_key, 'dest_columns': dest_columns, 'predicates': incremental_predicates }) %}\n {% set build_sql = strategy_sql_macro_func(strategy_arg_dict) %}\n\n {% endif %}\n\n {% call statement(\"main\") %}\n {{ build_sql }}\n {% endcall %}\n\n {% if need_swap %}\n {% do adapter.rename_relation(target_relation, backup_relation) %}\n {% do adapter.rename_relation(intermediate_relation, target_relation) %}\n {% do to_drop.append(backup_relation) %}\n {% endif %}\n\n {% set should_revoke = should_revoke(existing_relation, full_refresh_mode) %}\n {% do apply_grants(target_relation, grant_config, should_revoke=should_revoke) %}\n\n {% do persist_docs(target_relation, model) %}\n\n {% if existing_relation is none or existing_relation.is_view or should_full_refresh() %}\n {% do create_indexes(target_relation) %}\n {% endif %}\n\n {{ run_hooks(post_hooks, inside_transaction=True) }}\n\n -- `COMMIT` happens here\n {% do adapter.commit() %}\n\n {% for rel in to_drop %}\n {% do adapter.drop_relation(rel) %}\n {% endfor %}\n\n {{ run_hooks(post_hooks, inside_transaction=False) }}\n\n {{ return({'relations': [target_relation]}) }}\n\n{%- endmaterialization %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.load_cached_relation", "macro.dbt.make_temp_relation", "macro.dbt.make_intermediate_relation", "macro.dbt.make_backup_relation", "macro.dbt.should_full_refresh", "macro.dbt.incremental_validate_on_schema_change", "macro.dbt.drop_relation_if_exists", "macro.dbt.run_hooks", "macro.dbt.get_create_table_as_sql", "macro.dbt.run_query", "macro.dbt.process_schema_changes", "macro.dbt.statement", "macro.dbt.should_revoke", "macro.dbt.apply_grants", "macro.dbt.persist_docs", "macro.dbt.create_indexes"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481803.9242089, "supported_languages": ["sql"]}, "macro.dbt.incremental_validate_on_schema_change": {"unique_id": "macro.dbt.incremental_validate_on_schema_change", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/incremental/on_schema_change.sql", "original_file_path": "macros/materializations/models/incremental/on_schema_change.sql", "name": "incremental_validate_on_schema_change", "macro_sql": "{% macro incremental_validate_on_schema_change(on_schema_change, default='ignore') %}\n\n {% if on_schema_change not in ['sync_all_columns', 'append_new_columns', 'fail', 'ignore'] %}\n\n {% set log_message = 'Invalid value for on_schema_change (%s) specified. Setting default value of %s.' % (on_schema_change, default) %}\n {% do log(log_message) %}\n\n {{ return(default) }}\n\n {% else %}\n\n {{ return(on_schema_change) }}\n\n {% endif %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481803.929488, "supported_languages": null}, "macro.dbt.check_for_schema_changes": {"unique_id": "macro.dbt.check_for_schema_changes", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/incremental/on_schema_change.sql", "original_file_path": "macros/materializations/models/incremental/on_schema_change.sql", "name": "check_for_schema_changes", "macro_sql": "{% macro check_for_schema_changes(source_relation, target_relation) %}\n\n {% set schema_changed = False %}\n\n {%- set source_columns = adapter.get_columns_in_relation(source_relation) -%}\n {%- set target_columns = adapter.get_columns_in_relation(target_relation) -%}\n {%- set source_not_in_target = diff_columns(source_columns, target_columns) -%}\n {%- set target_not_in_source = diff_columns(target_columns, source_columns) -%}\n\n {% set new_target_types = diff_column_data_types(source_columns, target_columns) %}\n\n {% if source_not_in_target != [] %}\n {% set schema_changed = True %}\n {% elif target_not_in_source != [] or new_target_types != [] %}\n {% set schema_changed = True %}\n {% elif new_target_types != [] %}\n {% set schema_changed = True %}\n {% endif %}\n\n {% set changes_dict = {\n 'schema_changed': schema_changed,\n 'source_not_in_target': source_not_in_target,\n 'target_not_in_source': target_not_in_source,\n 'source_columns': source_columns,\n 'target_columns': target_columns,\n 'new_target_types': new_target_types\n } %}\n\n {% set msg %}\n In {{ target_relation }}:\n Schema changed: {{ schema_changed }}\n Source columns not in target: {{ source_not_in_target }}\n Target columns not in source: {{ target_not_in_source }}\n New column types: {{ new_target_types }}\n {% endset %}\n\n {% do log(msg) %}\n\n {{ return(changes_dict) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.diff_columns", "macro.dbt.diff_column_data_types"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481803.930743, "supported_languages": null}, "macro.dbt.sync_column_schemas": {"unique_id": "macro.dbt.sync_column_schemas", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/incremental/on_schema_change.sql", "original_file_path": "macros/materializations/models/incremental/on_schema_change.sql", "name": "sync_column_schemas", "macro_sql": "{% macro sync_column_schemas(on_schema_change, target_relation, schema_changes_dict) %}\n\n {%- set add_to_target_arr = schema_changes_dict['source_not_in_target'] -%}\n\n {%- if on_schema_change == 'append_new_columns'-%}\n {%- if add_to_target_arr | length > 0 -%}\n {%- do alter_relation_add_remove_columns(target_relation, add_to_target_arr, none) -%}\n {%- endif -%}\n\n {% elif on_schema_change == 'sync_all_columns' %}\n {%- set remove_from_target_arr = schema_changes_dict['target_not_in_source'] -%}\n {%- set new_target_types = schema_changes_dict['new_target_types'] -%}\n\n {% if add_to_target_arr | length > 0 or remove_from_target_arr | length > 0 %}\n {%- do alter_relation_add_remove_columns(target_relation, add_to_target_arr, remove_from_target_arr) -%}\n {% endif %}\n\n {% if new_target_types != [] %}\n {% for ntt in new_target_types %}\n {% set column_name = ntt['column_name'] %}\n {% set new_type = ntt['new_type'] %}\n {% do alter_column_type(target_relation, column_name, new_type) %}\n {% endfor %}\n {% endif %}\n\n {% endif %}\n\n {% set schema_change_message %}\n In {{ target_relation }}:\n Schema change approach: {{ on_schema_change }}\n Columns added: {{ add_to_target_arr }}\n Columns removed: {{ remove_from_target_arr }}\n Data types changed: {{ new_target_types }}\n {% endset %}\n\n {% do log(schema_change_message) %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.alter_relation_add_remove_columns", "macro.dbt.alter_column_type"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481803.931969, "supported_languages": null}, "macro.dbt.process_schema_changes": {"unique_id": "macro.dbt.process_schema_changes", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/incremental/on_schema_change.sql", "original_file_path": "macros/materializations/models/incremental/on_schema_change.sql", "name": "process_schema_changes", "macro_sql": "{% macro process_schema_changes(on_schema_change, source_relation, target_relation) %}\n\n {% if on_schema_change == 'ignore' %}\n\n {{ return({}) }}\n\n {% else %}\n\n {% set schema_changes_dict = check_for_schema_changes(source_relation, target_relation) %}\n\n {% if schema_changes_dict['schema_changed'] %}\n\n {% if on_schema_change == 'fail' %}\n\n {% set fail_msg %}\n The source and target schemas on this incremental model are out of sync!\n They can be reconciled in several ways:\n - set the `on_schema_change` config to either append_new_columns or sync_all_columns, depending on your situation.\n - Re-run the incremental model with `full_refresh: True` to update the target schema.\n - update the schema manually and re-run the process.\n\n Additional troubleshooting context:\n Source columns not in target: {{ schema_changes_dict['source_not_in_target'] }}\n Target columns not in source: {{ schema_changes_dict['target_not_in_source'] }}\n New column types: {{ schema_changes_dict['new_target_types'] }}\n {% endset %}\n\n {% do exceptions.raise_compiler_error(fail_msg) %}\n\n {# -- unless we ignore, run the sync operation per the config #}\n {% else %}\n\n {% do sync_column_schemas(on_schema_change, target_relation, schema_changes_dict) %}\n\n {% endif %}\n\n {% endif %}\n\n {{ return(schema_changes_dict['source_columns']) }}\n\n {% endif %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.check_for_schema_changes", "macro.dbt.sync_column_schemas"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481803.9328399, "supported_languages": null}, "macro.dbt.materialization_table_default": {"unique_id": "macro.dbt.materialization_table_default", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/table/table.sql", "original_file_path": "macros/materializations/models/table/table.sql", "name": "materialization_table_default", "macro_sql": "{% materialization table, default %}\n\n {%- set existing_relation = load_cached_relation(this) -%}\n {%- set target_relation = this.incorporate(type='table') %}\n {%- set intermediate_relation = make_intermediate_relation(target_relation) -%}\n -- the intermediate_relation should not already exist in the database; get_relation\n -- will return None in that case. Otherwise, we get a relation that we can drop\n -- later, before we try to use this name for the current operation\n {%- set preexisting_intermediate_relation = load_cached_relation(intermediate_relation) -%}\n /*\n See ../view/view.sql for more information about this relation.\n */\n {%- set backup_relation_type = 'table' if existing_relation is none else existing_relation.type -%}\n {%- set backup_relation = make_backup_relation(target_relation, backup_relation_type) -%}\n -- as above, the backup_relation should not already exist\n {%- set preexisting_backup_relation = load_cached_relation(backup_relation) -%}\n -- grab current tables grants config for comparision later on\n {% set grant_config = config.get('grants') %}\n\n -- drop the temp relations if they exist already in the database\n {{ drop_relation_if_exists(preexisting_intermediate_relation) }}\n {{ drop_relation_if_exists(preexisting_backup_relation) }}\n\n {{ run_hooks(pre_hooks, inside_transaction=False) }}\n\n -- `BEGIN` happens here:\n {{ run_hooks(pre_hooks, inside_transaction=True) }}\n\n -- build model\n {% call statement('main') -%}\n {{ get_create_table_as_sql(False, intermediate_relation, sql) }}\n {%- endcall %}\n\n -- cleanup\n {% if existing_relation is not none %}\n {{ adapter.rename_relation(existing_relation, backup_relation) }}\n {% endif %}\n\n {{ adapter.rename_relation(intermediate_relation, target_relation) }}\n\n {% do create_indexes(target_relation) %}\n\n {{ run_hooks(post_hooks, inside_transaction=True) }}\n\n {% set should_revoke = should_revoke(existing_relation, full_refresh_mode=True) %}\n {% do apply_grants(target_relation, grant_config, should_revoke=should_revoke) %}\n\n {% do persist_docs(target_relation, model) %}\n\n -- `COMMIT` happens here\n {{ adapter.commit() }}\n\n -- finally, drop the existing/backup relation after the commit\n {{ drop_relation_if_exists(backup_relation) }}\n\n {{ run_hooks(post_hooks, inside_transaction=False) }}\n\n {{ return({'relations': [target_relation]}) }}\n{% endmaterialization %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.load_cached_relation", "macro.dbt.make_intermediate_relation", "macro.dbt.make_backup_relation", "macro.dbt.drop_relation_if_exists", "macro.dbt.run_hooks", "macro.dbt.statement", "macro.dbt.get_create_table_as_sql", "macro.dbt.create_indexes", "macro.dbt.should_revoke", "macro.dbt.apply_grants", "macro.dbt.persist_docs"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481803.935534, "supported_languages": ["sql"]}, "macro.dbt.get_create_table_as_sql": {"unique_id": "macro.dbt.get_create_table_as_sql", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/table/create_table_as.sql", "original_file_path": "macros/materializations/models/table/create_table_as.sql", "name": "get_create_table_as_sql", "macro_sql": "{% macro get_create_table_as_sql(temporary, relation, sql) -%}\n {{ adapter.dispatch('get_create_table_as_sql', 'dbt')(temporary, relation, sql) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__get_create_table_as_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481803.93614, "supported_languages": null}, "macro.dbt.default__get_create_table_as_sql": {"unique_id": "macro.dbt.default__get_create_table_as_sql", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/table/create_table_as.sql", "original_file_path": "macros/materializations/models/table/create_table_as.sql", "name": "default__get_create_table_as_sql", "macro_sql": "{% macro default__get_create_table_as_sql(temporary, relation, sql) -%}\n {{ return(create_table_as(temporary, relation, sql)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.create_table_as"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481803.936327, "supported_languages": null}, "macro.dbt.create_table_as": {"unique_id": "macro.dbt.create_table_as", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/table/create_table_as.sql", "original_file_path": "macros/materializations/models/table/create_table_as.sql", "name": "create_table_as", "macro_sql": "{% macro create_table_as(temporary, relation, compiled_code, language='sql') -%}\n {# backward compatibility for create_table_as that does not support language #}\n {% if language == \"sql\" %}\n {{ adapter.dispatch('create_table_as', 'dbt')(temporary, relation, compiled_code)}}\n {% else %}\n {{ adapter.dispatch('create_table_as', 'dbt')(temporary, relation, compiled_code, language) }}\n {% endif %}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_postgres.postgres__create_table_as"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481803.93677, "supported_languages": null}, "macro.dbt.default__create_table_as": {"unique_id": "macro.dbt.default__create_table_as", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/table/create_table_as.sql", "original_file_path": "macros/materializations/models/table/create_table_as.sql", "name": "default__create_table_as", "macro_sql": "{% macro default__create_table_as(temporary, relation, sql) -%}\n {%- set sql_header = config.get('sql_header', none) -%}\n\n {{ sql_header if sql_header is not none }}\n\n create {% if temporary: -%}temporary{%- endif %} table\n {{ relation.include(database=(not temporary), schema=(not temporary)) }}\n as (\n {{ sql }}\n );\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481803.937193, "supported_languages": null}, "macro.dbt.materialization_view_default": {"unique_id": "macro.dbt.materialization_view_default", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/view/view.sql", "original_file_path": "macros/materializations/models/view/view.sql", "name": "materialization_view_default", "macro_sql": "{%- materialization view, default -%}\n\n {%- set existing_relation = load_cached_relation(this) -%}\n {%- set target_relation = this.incorporate(type='view') -%}\n {%- set intermediate_relation = make_intermediate_relation(target_relation) -%}\n\n -- the intermediate_relation should not already exist in the database; get_relation\n -- will return None in that case. Otherwise, we get a relation that we can drop\n -- later, before we try to use this name for the current operation\n {%- set preexisting_intermediate_relation = load_cached_relation(intermediate_relation) -%}\n /*\n This relation (probably) doesn't exist yet. If it does exist, it's a leftover from\n a previous run, and we're going to try to drop it immediately. At the end of this\n materialization, we're going to rename the \"existing_relation\" to this identifier,\n and then we're going to drop it. In order to make sure we run the correct one of:\n - drop view ...\n - drop table ...\n\n We need to set the type of this relation to be the type of the existing_relation, if it exists,\n or else \"view\" as a sane default if it does not. Note that if the existing_relation does not\n exist, then there is nothing to move out of the way and subsequentally drop. In that case,\n this relation will be effectively unused.\n */\n {%- set backup_relation_type = 'view' if existing_relation is none else existing_relation.type -%}\n {%- set backup_relation = make_backup_relation(target_relation, backup_relation_type) -%}\n -- as above, the backup_relation should not already exist\n {%- set preexisting_backup_relation = load_cached_relation(backup_relation) -%}\n -- grab current tables grants config for comparision later on\n {% set grant_config = config.get('grants') %}\n\n {{ run_hooks(pre_hooks, inside_transaction=False) }}\n\n -- drop the temp relations if they exist already in the database\n {{ drop_relation_if_exists(preexisting_intermediate_relation) }}\n {{ drop_relation_if_exists(preexisting_backup_relation) }}\n\n -- `BEGIN` happens here:\n {{ run_hooks(pre_hooks, inside_transaction=True) }}\n\n -- build model\n {% call statement('main') -%}\n {{ get_create_view_as_sql(intermediate_relation, sql) }}\n {%- endcall %}\n\n -- cleanup\n -- move the existing view out of the way\n {% if existing_relation is not none %}\n {{ adapter.rename_relation(existing_relation, backup_relation) }}\n {% endif %}\n {{ adapter.rename_relation(intermediate_relation, target_relation) }}\n\n {% set should_revoke = should_revoke(existing_relation, full_refresh_mode=True) %}\n {% do apply_grants(target_relation, grant_config, should_revoke=should_revoke) %}\n\n {% do persist_docs(target_relation, model) %}\n\n {{ run_hooks(post_hooks, inside_transaction=True) }}\n\n {{ adapter.commit() }}\n\n {{ drop_relation_if_exists(backup_relation) }}\n\n {{ run_hooks(post_hooks, inside_transaction=False) }}\n\n {{ return({'relations': [target_relation]}) }}\n\n{%- endmaterialization -%}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.load_cached_relation", "macro.dbt.make_intermediate_relation", "macro.dbt.make_backup_relation", "macro.dbt.run_hooks", "macro.dbt.drop_relation_if_exists", "macro.dbt.statement", "macro.dbt.get_create_view_as_sql", "macro.dbt.should_revoke", "macro.dbt.apply_grants", "macro.dbt.persist_docs"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481803.939837, "supported_languages": ["sql"]}, "macro.dbt.handle_existing_table": {"unique_id": "macro.dbt.handle_existing_table", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/view/helpers.sql", "original_file_path": "macros/materializations/models/view/helpers.sql", "name": "handle_existing_table", "macro_sql": "{% macro handle_existing_table(full_refresh, old_relation) %}\n {{ adapter.dispatch('handle_existing_table', 'dbt')(full_refresh, old_relation) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__handle_existing_table"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481803.940219, "supported_languages": null}, "macro.dbt.default__handle_existing_table": {"unique_id": "macro.dbt.default__handle_existing_table", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/view/helpers.sql", "original_file_path": "macros/materializations/models/view/helpers.sql", "name": "default__handle_existing_table", "macro_sql": "{% macro default__handle_existing_table(full_refresh, old_relation) %}\n {{ log(\"Dropping relation \" ~ old_relation ~ \" because it is of type \" ~ old_relation.type) }}\n {{ adapter.drop_relation(old_relation) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481803.940448, "supported_languages": null}, "macro.dbt.create_or_replace_view": {"unique_id": "macro.dbt.create_or_replace_view", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/view/create_or_replace_view.sql", "original_file_path": "macros/materializations/models/view/create_or_replace_view.sql", "name": "create_or_replace_view", "macro_sql": "{% macro create_or_replace_view() %}\n {%- set identifier = model['alias'] -%}\n\n {%- set old_relation = adapter.get_relation(database=database, schema=schema, identifier=identifier) -%}\n {%- set exists_as_view = (old_relation is not none and old_relation.is_view) -%}\n\n {%- set target_relation = api.Relation.create(\n identifier=identifier, schema=schema, database=database,\n type='view') -%}\n {% set grant_config = config.get('grants') %}\n\n {{ run_hooks(pre_hooks) }}\n\n -- If there's a table with the same name and we weren't told to full refresh,\n -- that's an error. If we were told to full refresh, drop it. This behavior differs\n -- for Snowflake and BigQuery, so multiple dispatch is used.\n {%- if old_relation is not none and old_relation.is_table -%}\n {{ handle_existing_table(should_full_refresh(), old_relation) }}\n {%- endif -%}\n\n -- build model\n {% call statement('main') -%}\n {{ get_create_view_as_sql(target_relation, sql) }}\n {%- endcall %}\n\n {% set should_revoke = should_revoke(exists_as_view, full_refresh_mode=True) %}\n {% do apply_grants(target_relation, grant_config, should_revoke=True) %}\n\n {{ run_hooks(post_hooks) }}\n\n {{ return({'relations': [target_relation]}) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.run_hooks", "macro.dbt.handle_existing_table", "macro.dbt.should_full_refresh", "macro.dbt.statement", "macro.dbt.get_create_view_as_sql", "macro.dbt.should_revoke", "macro.dbt.apply_grants"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481803.942008, "supported_languages": null}, "macro.dbt.get_create_view_as_sql": {"unique_id": "macro.dbt.get_create_view_as_sql", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/view/create_view_as.sql", "original_file_path": "macros/materializations/models/view/create_view_as.sql", "name": "get_create_view_as_sql", "macro_sql": "{% macro get_create_view_as_sql(relation, sql) -%}\n {{ adapter.dispatch('get_create_view_as_sql', 'dbt')(relation, sql) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__get_create_view_as_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481803.942453, "supported_languages": null}, "macro.dbt.default__get_create_view_as_sql": {"unique_id": "macro.dbt.default__get_create_view_as_sql", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/view/create_view_as.sql", "original_file_path": "macros/materializations/models/view/create_view_as.sql", "name": "default__get_create_view_as_sql", "macro_sql": "{% macro default__get_create_view_as_sql(relation, sql) -%}\n {{ return(create_view_as(relation, sql)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.create_view_as"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481803.942621, "supported_languages": null}, "macro.dbt.create_view_as": {"unique_id": "macro.dbt.create_view_as", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/view/create_view_as.sql", "original_file_path": "macros/materializations/models/view/create_view_as.sql", "name": "create_view_as", "macro_sql": "{% macro create_view_as(relation, sql) -%}\n {{ adapter.dispatch('create_view_as', 'dbt')(relation, sql) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__create_view_as"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481803.942801, "supported_languages": null}, "macro.dbt.default__create_view_as": {"unique_id": "macro.dbt.default__create_view_as", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/view/create_view_as.sql", "original_file_path": "macros/materializations/models/view/create_view_as.sql", "name": "default__create_view_as", "macro_sql": "{% macro default__create_view_as(relation, sql) -%}\n {%- set sql_header = config.get('sql_header', none) -%}\n\n {{ sql_header if sql_header is not none }}\n create view {{ relation }} as (\n {{ sql }}\n );\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481803.9430678, "supported_languages": null}, "macro.dbt.materialization_seed_default": {"unique_id": "macro.dbt.materialization_seed_default", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/seeds/seed.sql", "original_file_path": "macros/materializations/seeds/seed.sql", "name": "materialization_seed_default", "macro_sql": "{% materialization seed, default %}\n\n {%- set identifier = model['alias'] -%}\n {%- set full_refresh_mode = (should_full_refresh()) -%}\n\n {%- set old_relation = adapter.get_relation(database=database, schema=schema, identifier=identifier) -%}\n\n {%- set exists_as_table = (old_relation is not none and old_relation.is_table) -%}\n {%- set exists_as_view = (old_relation is not none and old_relation.is_view) -%}\n\n {%- set grant_config = config.get('grants') -%}\n {%- set agate_table = load_agate_table() -%}\n -- grab current tables grants config for comparision later on\n\n {%- do store_result('agate_table', response='OK', agate_table=agate_table) -%}\n\n {{ run_hooks(pre_hooks, inside_transaction=False) }}\n\n -- `BEGIN` happens here:\n {{ run_hooks(pre_hooks, inside_transaction=True) }}\n\n -- build model\n {% set create_table_sql = \"\" %}\n {% if exists_as_view %}\n {{ exceptions.raise_compiler_error(\"Cannot seed to '{}', it is a view\".format(old_relation)) }}\n {% elif exists_as_table %}\n {% set create_table_sql = reset_csv_table(model, full_refresh_mode, old_relation, agate_table) %}\n {% else %}\n {% set create_table_sql = create_csv_table(model, agate_table) %}\n {% endif %}\n\n {% set code = 'CREATE' if full_refresh_mode else 'INSERT' %}\n {% set rows_affected = (agate_table.rows | length) %}\n {% set sql = load_csv_rows(model, agate_table) %}\n\n {% call noop_statement('main', code ~ ' ' ~ rows_affected, code, rows_affected) %}\n {{ get_csv_sql(create_table_sql, sql) }};\n {% endcall %}\n\n {% set target_relation = this.incorporate(type='table') %}\n\n {% set should_revoke = should_revoke(old_relation, full_refresh_mode) %}\n {% do apply_grants(target_relation, grant_config, should_revoke=should_revoke) %}\n\n {% do persist_docs(target_relation, model) %}\n\n {% if full_refresh_mode or not exists_as_table %}\n {% do create_indexes(target_relation) %}\n {% endif %}\n\n {{ run_hooks(post_hooks, inside_transaction=True) }}\n\n -- `COMMIT` happens here\n {{ adapter.commit() }}\n\n {{ run_hooks(post_hooks, inside_transaction=False) }}\n\n {{ return({'relations': [target_relation]}) }}\n\n{% endmaterialization %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.should_full_refresh", "macro.dbt.run_hooks", "macro.dbt.reset_csv_table", "macro.dbt.create_csv_table", "macro.dbt.load_csv_rows", "macro.dbt.noop_statement", "macro.dbt.get_csv_sql", "macro.dbt.should_revoke", "macro.dbt.apply_grants", "macro.dbt.persist_docs", "macro.dbt.create_indexes"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481803.969165, "supported_languages": ["sql"]}, "macro.dbt.create_csv_table": {"unique_id": "macro.dbt.create_csv_table", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/seeds/helpers.sql", "original_file_path": "macros/materializations/seeds/helpers.sql", "name": "create_csv_table", "macro_sql": "{% macro create_csv_table(model, agate_table) -%}\n {{ adapter.dispatch('create_csv_table', 'dbt')(model, agate_table) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__create_csv_table"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481803.974122, "supported_languages": null}, "macro.dbt.default__create_csv_table": {"unique_id": "macro.dbt.default__create_csv_table", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/seeds/helpers.sql", "original_file_path": "macros/materializations/seeds/helpers.sql", "name": "default__create_csv_table", "macro_sql": "{% macro default__create_csv_table(model, agate_table) %}\n {%- set column_override = model['config'].get('column_types', {}) -%}\n {%- set quote_seed_column = model['config'].get('quote_columns', None) -%}\n\n {% set sql %}\n create table {{ this.render() }} (\n {%- for col_name in agate_table.column_names -%}\n {%- set inferred_type = adapter.convert_type(agate_table, loop.index0) -%}\n {%- set type = column_override.get(col_name, inferred_type) -%}\n {%- set column_name = (col_name | string) -%}\n {{ adapter.quote_seed_column(column_name, quote_seed_column) }} {{ type }} {%- if not loop.last -%}, {%- endif -%}\n {%- endfor -%}\n )\n {% endset %}\n\n {% call statement('_') -%}\n {{ sql }}\n {%- endcall %}\n\n {{ return(sql) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481803.9750578, "supported_languages": null}, "macro.dbt.reset_csv_table": {"unique_id": "macro.dbt.reset_csv_table", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/seeds/helpers.sql", "original_file_path": "macros/materializations/seeds/helpers.sql", "name": "reset_csv_table", "macro_sql": "{% macro reset_csv_table(model, full_refresh, old_relation, agate_table) -%}\n {{ adapter.dispatch('reset_csv_table', 'dbt')(model, full_refresh, old_relation, agate_table) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__reset_csv_table"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481803.975307, "supported_languages": null}, "macro.dbt.default__reset_csv_table": {"unique_id": "macro.dbt.default__reset_csv_table", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/seeds/helpers.sql", "original_file_path": "macros/materializations/seeds/helpers.sql", "name": "default__reset_csv_table", "macro_sql": "{% macro default__reset_csv_table(model, full_refresh, old_relation, agate_table) %}\n {% set sql = \"\" %}\n {% if full_refresh %}\n {{ adapter.drop_relation(old_relation) }}\n {% set sql = create_csv_table(model, agate_table) %}\n {% else %}\n {{ adapter.truncate_relation(old_relation) }}\n {% set sql = \"truncate table \" ~ old_relation %}\n {% endif %}\n\n {{ return(sql) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.create_csv_table"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481803.975801, "supported_languages": null}, "macro.dbt.get_csv_sql": {"unique_id": "macro.dbt.get_csv_sql", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/seeds/helpers.sql", "original_file_path": "macros/materializations/seeds/helpers.sql", "name": "get_csv_sql", "macro_sql": "{% macro get_csv_sql(create_or_truncate_sql, insert_sql) %}\n {{ adapter.dispatch('get_csv_sql', 'dbt')(create_or_truncate_sql, insert_sql) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__get_csv_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481803.976002, "supported_languages": null}, "macro.dbt.default__get_csv_sql": {"unique_id": "macro.dbt.default__get_csv_sql", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/seeds/helpers.sql", "original_file_path": "macros/materializations/seeds/helpers.sql", "name": "default__get_csv_sql", "macro_sql": "{% macro default__get_csv_sql(create_or_truncate_sql, insert_sql) %}\n {{ create_or_truncate_sql }};\n -- dbt seed --\n {{ insert_sql }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481803.976137, "supported_languages": null}, "macro.dbt.get_binding_char": {"unique_id": "macro.dbt.get_binding_char", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/seeds/helpers.sql", "original_file_path": "macros/materializations/seeds/helpers.sql", "name": "get_binding_char", "macro_sql": "{% macro get_binding_char() -%}\n {{ adapter.dispatch('get_binding_char', 'dbt')() }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__get_binding_char"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481803.9762821, "supported_languages": null}, "macro.dbt.default__get_binding_char": {"unique_id": "macro.dbt.default__get_binding_char", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/seeds/helpers.sql", "original_file_path": "macros/materializations/seeds/helpers.sql", "name": "default__get_binding_char", "macro_sql": "{% macro default__get_binding_char() %}\n {{ return('%s') }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481803.976403, "supported_languages": null}, "macro.dbt.get_batch_size": {"unique_id": "macro.dbt.get_batch_size", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/seeds/helpers.sql", "original_file_path": "macros/materializations/seeds/helpers.sql", "name": "get_batch_size", "macro_sql": "{% macro get_batch_size() -%}\n {{ return(adapter.dispatch('get_batch_size', 'dbt')()) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__get_batch_size"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481803.976564, "supported_languages": null}, "macro.dbt.default__get_batch_size": {"unique_id": "macro.dbt.default__get_batch_size", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/seeds/helpers.sql", "original_file_path": "macros/materializations/seeds/helpers.sql", "name": "default__get_batch_size", "macro_sql": "{% macro default__get_batch_size() %}\n {{ return(10000) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481803.976681, "supported_languages": null}, "macro.dbt.get_seed_column_quoted_csv": {"unique_id": "macro.dbt.get_seed_column_quoted_csv", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/seeds/helpers.sql", "original_file_path": "macros/materializations/seeds/helpers.sql", "name": "get_seed_column_quoted_csv", "macro_sql": "{% macro get_seed_column_quoted_csv(model, column_names) %}\n {%- set quote_seed_column = model['config'].get('quote_columns', None) -%}\n {% set quoted = [] %}\n {% for col in column_names -%}\n {%- do quoted.append(adapter.quote_seed_column(col, quote_seed_column)) -%}\n {%- endfor %}\n\n {%- set dest_cols_csv = quoted | join(', ') -%}\n {{ return(dest_cols_csv) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481803.977162, "supported_languages": null}, "macro.dbt.load_csv_rows": {"unique_id": "macro.dbt.load_csv_rows", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/seeds/helpers.sql", "original_file_path": "macros/materializations/seeds/helpers.sql", "name": "load_csv_rows", "macro_sql": "{% macro load_csv_rows(model, agate_table) -%}\n {{ adapter.dispatch('load_csv_rows', 'dbt')(model, agate_table) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__load_csv_rows"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481803.977352, "supported_languages": null}, "macro.dbt.default__load_csv_rows": {"unique_id": "macro.dbt.default__load_csv_rows", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/seeds/helpers.sql", "original_file_path": "macros/materializations/seeds/helpers.sql", "name": "default__load_csv_rows", "macro_sql": "{% macro default__load_csv_rows(model, agate_table) %}\n\n {% set batch_size = get_batch_size() %}\n\n {% set cols_sql = get_seed_column_quoted_csv(model, agate_table.column_names) %}\n {% set bindings = [] %}\n\n {% set statements = [] %}\n\n {% for chunk in agate_table.rows | batch(batch_size) %}\n {% set bindings = [] %}\n\n {% for row in chunk %}\n {% do bindings.extend(row) %}\n {% endfor %}\n\n {% set sql %}\n insert into {{ this.render() }} ({{ cols_sql }}) values\n {% for row in chunk -%}\n ({%- for column in agate_table.column_names -%}\n {{ get_binding_char() }}\n {%- if not loop.last%},{%- endif %}\n {%- endfor -%})\n {%- if not loop.last%},{%- endif %}\n {%- endfor %}\n {% endset %}\n\n {% do adapter.add_query(sql, bindings=bindings, abridge_sql_log=True) %}\n\n {% if loop.index0 == 0 %}\n {% do statements.append(sql) %}\n {% endif %}\n {% endfor %}\n\n {# Return SQL so we can render it out into the compiled files #}\n {{ return(statements[0]) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.get_batch_size", "macro.dbt.get_seed_column_quoted_csv", "macro.dbt.get_binding_char"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481803.978645, "supported_languages": null}, "macro.dbt.generate_alias_name": {"unique_id": "macro.dbt.generate_alias_name", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/get_custom_name/get_custom_alias.sql", "original_file_path": "macros/get_custom_name/get_custom_alias.sql", "name": "generate_alias_name", "macro_sql": "{% macro generate_alias_name(custom_alias_name=none, node=none) -%}\n {% do return(adapter.dispatch('generate_alias_name', 'dbt')(custom_alias_name, node)) %}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__generate_alias_name"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481803.97917, "supported_languages": null}, "macro.dbt.default__generate_alias_name": {"unique_id": "macro.dbt.default__generate_alias_name", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/get_custom_name/get_custom_alias.sql", "original_file_path": "macros/get_custom_name/get_custom_alias.sql", "name": "default__generate_alias_name", "macro_sql": "{% macro default__generate_alias_name(custom_alias_name=none, node=none) -%}\n\n {%- if custom_alias_name is none -%}\n\n {{ node.name }}\n\n {%- else -%}\n\n {{ custom_alias_name | trim }}\n\n {%- endif -%}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481803.9794261, "supported_languages": null}, "macro.dbt.generate_schema_name": {"unique_id": "macro.dbt.generate_schema_name", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/get_custom_name/get_custom_schema.sql", "original_file_path": "macros/get_custom_name/get_custom_schema.sql", "name": "generate_schema_name", "macro_sql": "{% macro generate_schema_name(custom_schema_name=none, node=none) -%}\n {{ return(adapter.dispatch('generate_schema_name', 'dbt')(custom_schema_name, node)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__generate_schema_name"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481803.9800441, "supported_languages": null}, "macro.dbt.default__generate_schema_name": {"unique_id": "macro.dbt.default__generate_schema_name", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/get_custom_name/get_custom_schema.sql", "original_file_path": "macros/get_custom_name/get_custom_schema.sql", "name": "default__generate_schema_name", "macro_sql": "{% macro default__generate_schema_name(custom_schema_name, node) -%}\n\n {%- set default_schema = target.schema -%}\n {%- if custom_schema_name is none -%}\n\n {{ default_schema }}\n\n {%- else -%}\n\n {{ default_schema }}_{{ custom_schema_name | trim }}\n\n {%- endif -%}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481803.9803112, "supported_languages": null}, "macro.dbt.generate_schema_name_for_env": {"unique_id": "macro.dbt.generate_schema_name_for_env", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/get_custom_name/get_custom_schema.sql", "original_file_path": "macros/get_custom_name/get_custom_schema.sql", "name": "generate_schema_name_for_env", "macro_sql": "{% macro generate_schema_name_for_env(custom_schema_name, node) -%}\n\n {%- set default_schema = target.schema -%}\n {%- if target.name == 'prod' and custom_schema_name is not none -%}\n\n {{ custom_schema_name | trim }}\n\n {%- else -%}\n\n {{ default_schema }}\n\n {%- endif -%}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481803.980617, "supported_languages": null}, "macro.dbt.generate_database_name": {"unique_id": "macro.dbt.generate_database_name", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/get_custom_name/get_custom_database.sql", "original_file_path": "macros/get_custom_name/get_custom_database.sql", "name": "generate_database_name", "macro_sql": "{% macro generate_database_name(custom_database_name=none, node=none) -%}\n {% do return(adapter.dispatch('generate_database_name', 'dbt')(custom_database_name, node)) %}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__generate_database_name"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481803.9811132, "supported_languages": null}, "macro.dbt.default__generate_database_name": {"unique_id": "macro.dbt.default__generate_database_name", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/get_custom_name/get_custom_database.sql", "original_file_path": "macros/get_custom_name/get_custom_database.sql", "name": "default__generate_database_name", "macro_sql": "{% macro default__generate_database_name(custom_database_name=none, node=none) -%}\n {%- set default_database = target.database -%}\n {%- if custom_database_name is none -%}\n\n {{ default_database }}\n\n {%- else -%}\n\n {{ custom_database_name }}\n\n {%- endif -%}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481803.9813702, "supported_languages": null}, "macro.dbt.default__test_relationships": {"unique_id": "macro.dbt.default__test_relationships", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/generic_test_sql/relationships.sql", "original_file_path": "macros/generic_test_sql/relationships.sql", "name": "default__test_relationships", "macro_sql": "{% macro default__test_relationships(model, column_name, to, field) %}\n\nwith child as (\n select {{ column_name }} as from_field\n from {{ model }}\n where {{ column_name }} is not null\n),\n\nparent as (\n select {{ field }} as to_field\n from {{ to }}\n)\n\nselect\n from_field\n\nfrom child\nleft join parent\n on child.from_field = parent.to_field\n\nwhere parent.to_field is null\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481803.981799, "supported_languages": null}, "macro.dbt.default__test_not_null": {"unique_id": "macro.dbt.default__test_not_null", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/generic_test_sql/not_null.sql", "original_file_path": "macros/generic_test_sql/not_null.sql", "name": "default__test_not_null", "macro_sql": "{% macro default__test_not_null(model, column_name) %}\n\n{% set column_list = '*' if should_store_failures() else column_name %}\n\nselect {{ column_list }}\nfrom {{ model }}\nwhere {{ column_name }} is null\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.should_store_failures"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481803.982176, "supported_languages": null}, "macro.dbt.default__test_unique": {"unique_id": "macro.dbt.default__test_unique", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/generic_test_sql/unique.sql", "original_file_path": "macros/generic_test_sql/unique.sql", "name": "default__test_unique", "macro_sql": "{% macro default__test_unique(model, column_name) %}\n\nselect\n {{ column_name }} as unique_field,\n count(*) as n_records\n\nfrom {{ model }}\nwhere {{ column_name }} is not null\ngroup by {{ column_name }}\nhaving count(*) > 1\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481803.9825122, "supported_languages": null}, "macro.dbt.default__test_accepted_values": {"unique_id": "macro.dbt.default__test_accepted_values", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/generic_test_sql/accepted_values.sql", "original_file_path": "macros/generic_test_sql/accepted_values.sql", "name": "default__test_accepted_values", "macro_sql": "{% macro default__test_accepted_values(model, column_name, values, quote=True) %}\n\nwith all_values as (\n\n select\n {{ column_name }} as value_field,\n count(*) as n_records\n\n from {{ model }}\n group by {{ column_name }}\n\n)\n\nselect *\nfrom all_values\nwhere value_field not in (\n {% for value in values -%}\n {% if quote -%}\n '{{ value }}'\n {%- else -%}\n {{ value }}\n {%- endif -%}\n {%- if not loop.last -%},{%- endif %}\n {%- endfor %}\n)\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481803.98314, "supported_languages": null}, "macro.dbt.statement": {"unique_id": "macro.dbt.statement", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/etc/statement.sql", "original_file_path": "macros/etc/statement.sql", "name": "statement", "macro_sql": "\n{%- macro statement(name=None, fetch_result=False, auto_begin=True, language='sql') -%}\n {%- if execute: -%}\n {%- set compiled_code = caller() -%}\n\n {%- if name == 'main' -%}\n {{ log('Writing runtime {} for node \"{}\"'.format(language, model['unique_id'])) }}\n {{ write(compiled_code) }}\n {%- endif -%}\n {%- if language == 'sql'-%}\n {%- set res, table = adapter.execute(compiled_code, auto_begin=auto_begin, fetch=fetch_result) -%}\n {%- elif language == 'python' -%}\n {%- set res = submit_python_job(model, compiled_code) -%}\n {#-- TODO: What should table be for python models? --#}\n {%- set table = None -%}\n {%- else -%}\n {% do exceptions.raise_compiler_error(\"statement macro didn't get supported language\") %}\n {%- endif -%}\n\n {%- if name is not none -%}\n {{ store_result(name, response=res, agate_table=table) }}\n {%- endif -%}\n\n {%- endif -%}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481803.984673, "supported_languages": null}, "macro.dbt.noop_statement": {"unique_id": "macro.dbt.noop_statement", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/etc/statement.sql", "original_file_path": "macros/etc/statement.sql", "name": "noop_statement", "macro_sql": "{% macro noop_statement(name=None, message=None, code=None, rows_affected=None, res=None) -%}\n {%- set sql = caller() -%}\n\n {%- if name == 'main' -%}\n {{ log('Writing runtime SQL for node \"{}\"'.format(model['unique_id'])) }}\n {{ write(sql) }}\n {%- endif -%}\n\n {%- if name is not none -%}\n {{ store_raw_result(name, message=message, code=code, rows_affected=rows_affected, agate_table=res) }}\n {%- endif -%}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481803.985332, "supported_languages": null}, "macro.dbt.run_query": {"unique_id": "macro.dbt.run_query", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/etc/statement.sql", "original_file_path": "macros/etc/statement.sql", "name": "run_query", "macro_sql": "{% macro run_query(sql) %}\n {% call statement(\"run_query_statement\", fetch_result=true, auto_begin=false) %}\n {{ sql }}\n {% endcall %}\n\n {% do return(load_result(\"run_query_statement\").table) %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481803.985634, "supported_languages": null}, "macro.dbt.convert_datetime": {"unique_id": "macro.dbt.convert_datetime", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/etc/datetime.sql", "original_file_path": "macros/etc/datetime.sql", "name": "convert_datetime", "macro_sql": "{% macro convert_datetime(date_str, date_fmt) %}\n\n {% set error_msg -%}\n The provided partition date '{{ date_str }}' does not match the expected format '{{ date_fmt }}'\n {%- endset %}\n\n {% set res = try_or_compiler_error(error_msg, modules.datetime.datetime.strptime, date_str.strip(), date_fmt) %}\n {{ return(res) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481803.987458, "supported_languages": null}, "macro.dbt.dates_in_range": {"unique_id": "macro.dbt.dates_in_range", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/etc/datetime.sql", "original_file_path": "macros/etc/datetime.sql", "name": "dates_in_range", "macro_sql": "{% macro dates_in_range(start_date_str, end_date_str=none, in_fmt=\"%Y%m%d\", out_fmt=\"%Y%m%d\") %}\n {% set end_date_str = start_date_str if end_date_str is none else end_date_str %}\n\n {% set start_date = convert_datetime(start_date_str, in_fmt) %}\n {% set end_date = convert_datetime(end_date_str, in_fmt) %}\n\n {% set day_count = (end_date - start_date).days %}\n {% if day_count < 0 %}\n {% set msg -%}\n Partiton start date is after the end date ({{ start_date }}, {{ end_date }})\n {%- endset %}\n\n {{ exceptions.raise_compiler_error(msg, model) }}\n {% endif %}\n\n {% set date_list = [] %}\n {% for i in range(0, day_count + 1) %}\n {% set the_date = (modules.datetime.timedelta(days=i) + start_date) %}\n {% if not out_fmt %}\n {% set _ = date_list.append(the_date) %}\n {% else %}\n {% set _ = date_list.append(the_date.strftime(out_fmt)) %}\n {% endif %}\n {% endfor %}\n\n {{ return(date_list) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.convert_datetime"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481803.988666, "supported_languages": null}, "macro.dbt.partition_range": {"unique_id": "macro.dbt.partition_range", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/etc/datetime.sql", "original_file_path": "macros/etc/datetime.sql", "name": "partition_range", "macro_sql": "{% macro partition_range(raw_partition_date, date_fmt='%Y%m%d') %}\n {% set partition_range = (raw_partition_date | string).split(\",\") %}\n\n {% if (partition_range | length) == 1 %}\n {% set start_date = partition_range[0] %}\n {% set end_date = none %}\n {% elif (partition_range | length) == 2 %}\n {% set start_date = partition_range[0] %}\n {% set end_date = partition_range[1] %}\n {% else %}\n {{ exceptions.raise_compiler_error(\"Invalid partition time. Expected format: {Start Date}[,{End Date}]. Got: \" ~ raw_partition_date) }}\n {% endif %}\n\n {{ return(dates_in_range(start_date, end_date, in_fmt=date_fmt)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.dates_in_range"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481803.989436, "supported_languages": null}, "macro.dbt.py_current_timestring": {"unique_id": "macro.dbt.py_current_timestring", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/etc/datetime.sql", "original_file_path": "macros/etc/datetime.sql", "name": "py_current_timestring", "macro_sql": "{% macro py_current_timestring() %}\n {% set dt = modules.datetime.datetime.now() %}\n {% do return(dt.strftime(\"%Y%m%d%H%M%S%f\")) %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481803.9896781, "supported_languages": null}, "macro.dbt.except": {"unique_id": "macro.dbt.except", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/except.sql", "original_file_path": "macros/utils/except.sql", "name": "except", "macro_sql": "{% macro except() %}\n {{ return(adapter.dispatch('except', 'dbt')()) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__except"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481803.989994, "supported_languages": null}, "macro.dbt.default__except": {"unique_id": "macro.dbt.default__except", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/except.sql", "original_file_path": "macros/utils/except.sql", "name": "default__except", "macro_sql": "{% macro default__except() %}\n\n except\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481803.99007, "supported_languages": null}, "macro.dbt.replace": {"unique_id": "macro.dbt.replace", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/replace.sql", "original_file_path": "macros/utils/replace.sql", "name": "replace", "macro_sql": "{% macro replace(field, old_chars, new_chars) -%}\n {{ return(adapter.dispatch('replace', 'dbt') (field, old_chars, new_chars)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__replace"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481803.990473, "supported_languages": null}, "macro.dbt.default__replace": {"unique_id": "macro.dbt.default__replace", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/replace.sql", "original_file_path": "macros/utils/replace.sql", "name": "default__replace", "macro_sql": "{% macro default__replace(field, old_chars, new_chars) %}\n\n replace(\n {{ field }},\n {{ old_chars }},\n {{ new_chars }}\n )\n\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481803.9906418, "supported_languages": null}, "macro.dbt.concat": {"unique_id": "macro.dbt.concat", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/concat.sql", "original_file_path": "macros/utils/concat.sql", "name": "concat", "macro_sql": "{% macro concat(fields) -%}\n {{ return(adapter.dispatch('concat', 'dbt')(fields)) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__concat"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481803.990976, "supported_languages": null}, "macro.dbt.default__concat": {"unique_id": "macro.dbt.default__concat", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/concat.sql", "original_file_path": "macros/utils/concat.sql", "name": "default__concat", "macro_sql": "{% macro default__concat(fields) -%}\n {{ fields|join(' || ') }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481803.991102, "supported_languages": null}, "macro.dbt.length": {"unique_id": "macro.dbt.length", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/length.sql", "original_file_path": "macros/utils/length.sql", "name": "length", "macro_sql": "{% macro length(expression) -%}\n {{ return(adapter.dispatch('length', 'dbt') (expression)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__length"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481803.9914439, "supported_languages": null}, "macro.dbt.default__length": {"unique_id": "macro.dbt.default__length", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/length.sql", "original_file_path": "macros/utils/length.sql", "name": "default__length", "macro_sql": "{% macro default__length(expression) %}\n\n length(\n {{ expression }}\n )\n\n{%- endmacro -%}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481803.991553, "supported_languages": null}, "macro.dbt.dateadd": {"unique_id": "macro.dbt.dateadd", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/dateadd.sql", "original_file_path": "macros/utils/dateadd.sql", "name": "dateadd", "macro_sql": "{% macro dateadd(datepart, interval, from_date_or_timestamp) %}\n {{ return(adapter.dispatch('dateadd', 'dbt')(datepart, interval, from_date_or_timestamp)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_postgres.postgres__dateadd"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481803.991989, "supported_languages": null}, "macro.dbt.default__dateadd": {"unique_id": "macro.dbt.default__dateadd", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/dateadd.sql", "original_file_path": "macros/utils/dateadd.sql", "name": "default__dateadd", "macro_sql": "{% macro default__dateadd(datepart, interval, from_date_or_timestamp) %}\n\n dateadd(\n {{ datepart }},\n {{ interval }},\n {{ from_date_or_timestamp }}\n )\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481803.99217, "supported_languages": null}, "macro.dbt.intersect": {"unique_id": "macro.dbt.intersect", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/intersect.sql", "original_file_path": "macros/utils/intersect.sql", "name": "intersect", "macro_sql": "{% macro intersect() %}\n {{ return(adapter.dispatch('intersect', 'dbt')()) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__intersect"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481803.992505, "supported_languages": null}, "macro.dbt.default__intersect": {"unique_id": "macro.dbt.default__intersect", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/intersect.sql", "original_file_path": "macros/utils/intersect.sql", "name": "default__intersect", "macro_sql": "{% macro default__intersect() %}\n\n intersect\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481803.992585, "supported_languages": null}, "macro.dbt.escape_single_quotes": {"unique_id": "macro.dbt.escape_single_quotes", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/escape_single_quotes.sql", "original_file_path": "macros/utils/escape_single_quotes.sql", "name": "escape_single_quotes", "macro_sql": "{% macro escape_single_quotes(expression) %}\n {{ return(adapter.dispatch('escape_single_quotes', 'dbt') (expression)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__escape_single_quotes"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481803.992936, "supported_languages": null}, "macro.dbt.default__escape_single_quotes": {"unique_id": "macro.dbt.default__escape_single_quotes", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/escape_single_quotes.sql", "original_file_path": "macros/utils/escape_single_quotes.sql", "name": "default__escape_single_quotes", "macro_sql": "{% macro default__escape_single_quotes(expression) -%}\n{{ expression | replace(\"'\",\"''\") }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481803.993082, "supported_languages": null}, "macro.dbt.right": {"unique_id": "macro.dbt.right", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/right.sql", "original_file_path": "macros/utils/right.sql", "name": "right", "macro_sql": "{% macro right(string_text, length_expression) -%}\n {{ return(adapter.dispatch('right', 'dbt') (string_text, length_expression)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__right"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481803.993472, "supported_languages": null}, "macro.dbt.default__right": {"unique_id": "macro.dbt.default__right", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/right.sql", "original_file_path": "macros/utils/right.sql", "name": "default__right", "macro_sql": "{% macro default__right(string_text, length_expression) %}\n\n right(\n {{ string_text }},\n {{ length_expression }}\n )\n\n{%- endmacro -%}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481803.9936929, "supported_languages": null}, "macro.dbt.listagg": {"unique_id": "macro.dbt.listagg", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/listagg.sql", "original_file_path": "macros/utils/listagg.sql", "name": "listagg", "macro_sql": "{% macro listagg(measure, delimiter_text=\"','\", order_by_clause=none, limit_num=none) -%}\n {{ return(adapter.dispatch('listagg', 'dbt') (measure, delimiter_text, order_by_clause, limit_num)) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_postgres.postgres__listagg"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481803.994386, "supported_languages": null}, "macro.dbt.default__listagg": {"unique_id": "macro.dbt.default__listagg", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/listagg.sql", "original_file_path": "macros/utils/listagg.sql", "name": "default__listagg", "macro_sql": "{% macro default__listagg(measure, delimiter_text, order_by_clause, limit_num) -%}\n\n {% if limit_num -%}\n array_to_string(\n array_slice(\n array_agg(\n {{ measure }}\n ){% if order_by_clause -%}\n within group ({{ order_by_clause }})\n {%- endif %}\n ,0\n ,{{ limit_num }}\n ),\n {{ delimiter_text }}\n )\n {%- else %}\n listagg(\n {{ measure }},\n {{ delimiter_text }}\n )\n {% if order_by_clause -%}\n within group ({{ order_by_clause }})\n {%- endif %}\n {%- endif %}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481803.994793, "supported_languages": null}, "macro.dbt.datediff": {"unique_id": "macro.dbt.datediff", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/datediff.sql", "original_file_path": "macros/utils/datediff.sql", "name": "datediff", "macro_sql": "{% macro datediff(first_date, second_date, datepart) %}\n {{ return(adapter.dispatch('datediff', 'dbt')(first_date, second_date, datepart)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_postgres.postgres__datediff"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481803.995209, "supported_languages": null}, "macro.dbt.default__datediff": {"unique_id": "macro.dbt.default__datediff", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/datediff.sql", "original_file_path": "macros/utils/datediff.sql", "name": "default__datediff", "macro_sql": "{% macro default__datediff(first_date, second_date, datepart) -%}\n\n datediff(\n {{ datepart }},\n {{ first_date }},\n {{ second_date }}\n )\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481803.995378, "supported_languages": null}, "macro.dbt.safe_cast": {"unique_id": "macro.dbt.safe_cast", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/safe_cast.sql", "original_file_path": "macros/utils/safe_cast.sql", "name": "safe_cast", "macro_sql": "{% macro safe_cast(field, type) %}\n {{ return(adapter.dispatch('safe_cast', 'dbt') (field, type)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__safe_cast"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481803.995737, "supported_languages": null}, "macro.dbt.default__safe_cast": {"unique_id": "macro.dbt.default__safe_cast", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/safe_cast.sql", "original_file_path": "macros/utils/safe_cast.sql", "name": "default__safe_cast", "macro_sql": "{% macro default__safe_cast(field, type) %}\n {# most databases don't support this function yet\n so we just need to use cast #}\n cast({{field}} as {{type}})\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481803.99588, "supported_languages": null}, "macro.dbt.hash": {"unique_id": "macro.dbt.hash", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/hash.sql", "original_file_path": "macros/utils/hash.sql", "name": "hash", "macro_sql": "{% macro hash(field) -%}\n {{ return(adapter.dispatch('hash', 'dbt') (field)) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__hash"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481803.996212, "supported_languages": null}, "macro.dbt.default__hash": {"unique_id": "macro.dbt.default__hash", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/hash.sql", "original_file_path": "macros/utils/hash.sql", "name": "default__hash", "macro_sql": "{% macro default__hash(field) -%}\n md5(cast({{ field }} as {{ api.Column.translate_type('string') }}))\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481803.996373, "supported_languages": null}, "macro.dbt.cast_bool_to_text": {"unique_id": "macro.dbt.cast_bool_to_text", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/cast_bool_to_text.sql", "original_file_path": "macros/utils/cast_bool_to_text.sql", "name": "cast_bool_to_text", "macro_sql": "{% macro cast_bool_to_text(field) %}\n {{ adapter.dispatch('cast_bool_to_text', 'dbt') (field) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__cast_bool_to_text"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481803.996694, "supported_languages": null}, "macro.dbt.default__cast_bool_to_text": {"unique_id": "macro.dbt.default__cast_bool_to_text", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/cast_bool_to_text.sql", "original_file_path": "macros/utils/cast_bool_to_text.sql", "name": "default__cast_bool_to_text", "macro_sql": "{% macro default__cast_bool_to_text(field) %}\n cast({{ field }} as {{ api.Column.translate_type('string') }})\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481803.9968588, "supported_languages": null}, "macro.dbt.any_value": {"unique_id": "macro.dbt.any_value", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/any_value.sql", "original_file_path": "macros/utils/any_value.sql", "name": "any_value", "macro_sql": "{% macro any_value(expression) -%}\n {{ return(adapter.dispatch('any_value', 'dbt') (expression)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_postgres.postgres__any_value"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481803.997182, "supported_languages": null}, "macro.dbt.default__any_value": {"unique_id": "macro.dbt.default__any_value", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/any_value.sql", "original_file_path": "macros/utils/any_value.sql", "name": "default__any_value", "macro_sql": "{% macro default__any_value(expression) -%}\n\n any_value({{ expression }})\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481803.9972851, "supported_languages": null}, "macro.dbt.position": {"unique_id": "macro.dbt.position", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/position.sql", "original_file_path": "macros/utils/position.sql", "name": "position", "macro_sql": "{% macro position(substring_text, string_text) -%}\n {{ return(adapter.dispatch('position', 'dbt') (substring_text, string_text)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__position"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481803.9976509, "supported_languages": null}, "macro.dbt.default__position": {"unique_id": "macro.dbt.default__position", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/position.sql", "original_file_path": "macros/utils/position.sql", "name": "default__position", "macro_sql": "{% macro default__position(substring_text, string_text) %}\n\n position(\n {{ substring_text }} in {{ string_text }}\n )\n\n{%- endmacro -%}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481803.9977899, "supported_languages": null}, "macro.dbt.string_literal": {"unique_id": "macro.dbt.string_literal", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/literal.sql", "original_file_path": "macros/utils/literal.sql", "name": "string_literal", "macro_sql": "{%- macro string_literal(value) -%}\n {{ return(adapter.dispatch('string_literal', 'dbt') (value)) }}\n{%- endmacro -%}\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__string_literal"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481803.99811, "supported_languages": null}, "macro.dbt.default__string_literal": {"unique_id": "macro.dbt.default__string_literal", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/literal.sql", "original_file_path": "macros/utils/literal.sql", "name": "default__string_literal", "macro_sql": "{% macro default__string_literal(value) -%}\n '{{ value }}'\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481803.9982111, "supported_languages": null}, "macro.dbt.type_string": {"unique_id": "macro.dbt.type_string", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/data_types.sql", "original_file_path": "macros/utils/data_types.sql", "name": "type_string", "macro_sql": "\n\n{%- macro type_string() -%}\n {{ return(adapter.dispatch('type_string', 'dbt')()) }}\n{%- endmacro -%}\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__type_string"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481803.999191, "supported_languages": null}, "macro.dbt.default__type_string": {"unique_id": "macro.dbt.default__type_string", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/data_types.sql", "original_file_path": "macros/utils/data_types.sql", "name": "default__type_string", "macro_sql": "{% macro default__type_string() %}\n {{ return(api.Column.translate_type(\"string\")) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481803.9993448, "supported_languages": null}, "macro.dbt.type_timestamp": {"unique_id": "macro.dbt.type_timestamp", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/data_types.sql", "original_file_path": "macros/utils/data_types.sql", "name": "type_timestamp", "macro_sql": "\n\n{%- macro type_timestamp() -%}\n {{ return(adapter.dispatch('type_timestamp', 'dbt')()) }}\n{%- endmacro -%}\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__type_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481803.999579, "supported_languages": null}, "macro.dbt.default__type_timestamp": {"unique_id": "macro.dbt.default__type_timestamp", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/data_types.sql", "original_file_path": "macros/utils/data_types.sql", "name": "default__type_timestamp", "macro_sql": "{% macro default__type_timestamp() %}\n {{ return(api.Column.translate_type(\"timestamp\")) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481803.999736, "supported_languages": null}, "macro.dbt.type_float": {"unique_id": "macro.dbt.type_float", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/data_types.sql", "original_file_path": "macros/utils/data_types.sql", "name": "type_float", "macro_sql": "\n\n{%- macro type_float() -%}\n {{ return(adapter.dispatch('type_float', 'dbt')()) }}\n{%- endmacro -%}\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__type_float"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481803.999902, "supported_languages": null}, "macro.dbt.default__type_float": {"unique_id": "macro.dbt.default__type_float", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/data_types.sql", "original_file_path": "macros/utils/data_types.sql", "name": "default__type_float", "macro_sql": "{% macro default__type_float() %}\n {{ return(api.Column.translate_type(\"float\")) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481804.000055, "supported_languages": null}, "macro.dbt.type_numeric": {"unique_id": "macro.dbt.type_numeric", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/data_types.sql", "original_file_path": "macros/utils/data_types.sql", "name": "type_numeric", "macro_sql": "\n\n{%- macro type_numeric() -%}\n {{ return(adapter.dispatch('type_numeric', 'dbt')()) }}\n{%- endmacro -%}\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__type_numeric"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481804.000216, "supported_languages": null}, "macro.dbt.default__type_numeric": {"unique_id": "macro.dbt.default__type_numeric", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/data_types.sql", "original_file_path": "macros/utils/data_types.sql", "name": "default__type_numeric", "macro_sql": "{% macro default__type_numeric() %}\n {{ return(api.Column.numeric_type(\"numeric\", 28, 6)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481804.000395, "supported_languages": null}, "macro.dbt.type_bigint": {"unique_id": "macro.dbt.type_bigint", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/data_types.sql", "original_file_path": "macros/utils/data_types.sql", "name": "type_bigint", "macro_sql": "\n\n{%- macro type_bigint() -%}\n {{ return(adapter.dispatch('type_bigint', 'dbt')()) }}\n{%- endmacro -%}\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__type_bigint"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481804.000566, "supported_languages": null}, "macro.dbt.default__type_bigint": {"unique_id": "macro.dbt.default__type_bigint", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/data_types.sql", "original_file_path": "macros/utils/data_types.sql", "name": "default__type_bigint", "macro_sql": "{% macro default__type_bigint() %}\n {{ return(api.Column.translate_type(\"bigint\")) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481804.000722, "supported_languages": null}, "macro.dbt.type_int": {"unique_id": "macro.dbt.type_int", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/data_types.sql", "original_file_path": "macros/utils/data_types.sql", "name": "type_int", "macro_sql": "\n\n{%- macro type_int() -%}\n {{ return(adapter.dispatch('type_int', 'dbt')()) }}\n{%- endmacro -%}\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__type_int"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481804.000886, "supported_languages": null}, "macro.dbt.default__type_int": {"unique_id": "macro.dbt.default__type_int", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/data_types.sql", "original_file_path": "macros/utils/data_types.sql", "name": "default__type_int", "macro_sql": "{%- macro default__type_int() -%}\n {{ return(api.Column.translate_type(\"integer\")) }}\n{%- endmacro -%}\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481804.0010319, "supported_languages": null}, "macro.dbt.type_boolean": {"unique_id": "macro.dbt.type_boolean", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/data_types.sql", "original_file_path": "macros/utils/data_types.sql", "name": "type_boolean", "macro_sql": "\n\n{%- macro type_boolean() -%}\n {{ return(adapter.dispatch('type_boolean', 'dbt')()) }}\n{%- endmacro -%}\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__type_boolean"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481804.0011892, "supported_languages": null}, "macro.dbt.default__type_boolean": {"unique_id": "macro.dbt.default__type_boolean", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/data_types.sql", "original_file_path": "macros/utils/data_types.sql", "name": "default__type_boolean", "macro_sql": "{%- macro default__type_boolean() -%}\n {{ return(api.Column.translate_type(\"boolean\")) }}\n{%- endmacro -%}\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481804.001337, "supported_languages": null}, "macro.dbt.array_concat": {"unique_id": "macro.dbt.array_concat", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/array_concat.sql", "original_file_path": "macros/utils/array_concat.sql", "name": "array_concat", "macro_sql": "{% macro array_concat(array_1, array_2) -%}\n {{ return(adapter.dispatch('array_concat', 'dbt')(array_1, array_2)) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__array_concat"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481804.001694, "supported_languages": null}, "macro.dbt.default__array_concat": {"unique_id": "macro.dbt.default__array_concat", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/array_concat.sql", "original_file_path": "macros/utils/array_concat.sql", "name": "default__array_concat", "macro_sql": "{% macro default__array_concat(array_1, array_2) -%}\n array_cat({{ array_1 }}, {{ array_2 }})\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481804.0018282, "supported_languages": null}, "macro.dbt.bool_or": {"unique_id": "macro.dbt.bool_or", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/bool_or.sql", "original_file_path": "macros/utils/bool_or.sql", "name": "bool_or", "macro_sql": "{% macro bool_or(expression) -%}\n {{ return(adapter.dispatch('bool_or', 'dbt') (expression)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__bool_or"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481804.002157, "supported_languages": null}, "macro.dbt.default__bool_or": {"unique_id": "macro.dbt.default__bool_or", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/bool_or.sql", "original_file_path": "macros/utils/bool_or.sql", "name": "default__bool_or", "macro_sql": "{% macro default__bool_or(expression) -%}\n\n bool_or({{ expression }})\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481804.002264, "supported_languages": null}, "macro.dbt.last_day": {"unique_id": "macro.dbt.last_day", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/last_day.sql", "original_file_path": "macros/utils/last_day.sql", "name": "last_day", "macro_sql": "{% macro last_day(date, datepart) %}\n {{ return(adapter.dispatch('last_day', 'dbt') (date, datepart)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_postgres.postgres__last_day"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481804.0026839, "supported_languages": null}, "macro.dbt.default_last_day": {"unique_id": "macro.dbt.default_last_day", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/last_day.sql", "original_file_path": "macros/utils/last_day.sql", "name": "default_last_day", "macro_sql": "\n\n{%- macro default_last_day(date, datepart) -%}\n cast(\n {{dbt.dateadd('day', '-1',\n dbt.dateadd(datepart, '1', dbt.date_trunc(datepart, date))\n )}}\n as date)\n{%- endmacro -%}\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.dateadd", "macro.dbt.date_trunc"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481804.002965, "supported_languages": null}, "macro.dbt.default__last_day": {"unique_id": "macro.dbt.default__last_day", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/last_day.sql", "original_file_path": "macros/utils/last_day.sql", "name": "default__last_day", "macro_sql": "{% macro default__last_day(date, datepart) -%}\n {{dbt.default_last_day(date, datepart)}}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default_last_day"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481804.003119, "supported_languages": null}, "macro.dbt.split_part": {"unique_id": "macro.dbt.split_part", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/split_part.sql", "original_file_path": "macros/utils/split_part.sql", "name": "split_part", "macro_sql": "{% macro split_part(string_text, delimiter_text, part_number) %}\n {{ return(adapter.dispatch('split_part', 'dbt') (string_text, delimiter_text, part_number)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_postgres.postgres__split_part"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481804.003704, "supported_languages": null}, "macro.dbt.default__split_part": {"unique_id": "macro.dbt.default__split_part", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/split_part.sql", "original_file_path": "macros/utils/split_part.sql", "name": "default__split_part", "macro_sql": "{% macro default__split_part(string_text, delimiter_text, part_number) %}\n\n split_part(\n {{ string_text }},\n {{ delimiter_text }},\n {{ part_number }}\n )\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481804.003874, "supported_languages": null}, "macro.dbt._split_part_negative": {"unique_id": "macro.dbt._split_part_negative", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/split_part.sql", "original_file_path": "macros/utils/split_part.sql", "name": "_split_part_negative", "macro_sql": "{% macro _split_part_negative(string_text, delimiter_text, part_number) %}\n\n split_part(\n {{ string_text }},\n {{ delimiter_text }},\n length({{ string_text }})\n - length(\n replace({{ string_text }}, {{ delimiter_text }}, '')\n ) + 2 {{ part_number }}\n )\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481804.00417, "supported_languages": null}, "macro.dbt.date_trunc": {"unique_id": "macro.dbt.date_trunc", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/date_trunc.sql", "original_file_path": "macros/utils/date_trunc.sql", "name": "date_trunc", "macro_sql": "{% macro date_trunc(datepart, date) -%}\n {{ return(adapter.dispatch('date_trunc', 'dbt') (datepart, date)) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__date_trunc"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481804.0045362, "supported_languages": null}, "macro.dbt.default__date_trunc": {"unique_id": "macro.dbt.default__date_trunc", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/date_trunc.sql", "original_file_path": "macros/utils/date_trunc.sql", "name": "default__date_trunc", "macro_sql": "{% macro default__date_trunc(datepart, date) -%}\n date_trunc('{{datepart}}', {{date}})\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481804.0046668, "supported_languages": null}, "macro.dbt.array_construct": {"unique_id": "macro.dbt.array_construct", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/array_construct.sql", "original_file_path": "macros/utils/array_construct.sql", "name": "array_construct", "macro_sql": "{% macro array_construct(inputs=[], data_type=api.Column.translate_type('integer')) -%}\n {{ return(adapter.dispatch('array_construct', 'dbt')(inputs, data_type)) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__array_construct"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481804.005134, "supported_languages": null}, "macro.dbt.default__array_construct": {"unique_id": "macro.dbt.default__array_construct", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/array_construct.sql", "original_file_path": "macros/utils/array_construct.sql", "name": "default__array_construct", "macro_sql": "{% macro default__array_construct(inputs, data_type) -%}\n {% if inputs|length > 0 %}\n array[ {{ inputs|join(' , ') }} ]\n {% else %}\n array[]::{{data_type}}[]\n {% endif %}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481804.0053859, "supported_languages": null}, "macro.dbt.array_append": {"unique_id": "macro.dbt.array_append", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/array_append.sql", "original_file_path": "macros/utils/array_append.sql", "name": "array_append", "macro_sql": "{% macro array_append(array, new_element) -%}\n {{ return(adapter.dispatch('array_append', 'dbt')(array, new_element)) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__array_append"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481804.0057652, "supported_languages": null}, "macro.dbt.default__array_append": {"unique_id": "macro.dbt.default__array_append", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/array_append.sql", "original_file_path": "macros/utils/array_append.sql", "name": "default__array_append", "macro_sql": "{% macro default__array_append(array, new_element) -%}\n array_append({{ array }}, {{ new_element }})\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481804.005908, "supported_languages": null}, "macro.dbt.create_schema": {"unique_id": "macro.dbt.create_schema", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/schema.sql", "original_file_path": "macros/adapters/schema.sql", "name": "create_schema", "macro_sql": "{% macro create_schema(relation) -%}\n {{ adapter.dispatch('create_schema', 'dbt')(relation) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_postgres.postgres__create_schema"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481804.006358, "supported_languages": null}, "macro.dbt.default__create_schema": {"unique_id": "macro.dbt.default__create_schema", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/schema.sql", "original_file_path": "macros/adapters/schema.sql", "name": "default__create_schema", "macro_sql": "{% macro default__create_schema(relation) -%}\n {%- call statement('create_schema') -%}\n create schema if not exists {{ relation.without_identifier() }}\n {% endcall %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481804.00655, "supported_languages": null}, "macro.dbt.drop_schema": {"unique_id": "macro.dbt.drop_schema", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/schema.sql", "original_file_path": "macros/adapters/schema.sql", "name": "drop_schema", "macro_sql": "{% macro drop_schema(relation) -%}\n {{ adapter.dispatch('drop_schema', 'dbt')(relation) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_postgres.postgres__drop_schema"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481804.006721, "supported_languages": null}, "macro.dbt.default__drop_schema": {"unique_id": "macro.dbt.default__drop_schema", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/schema.sql", "original_file_path": "macros/adapters/schema.sql", "name": "default__drop_schema", "macro_sql": "{% macro default__drop_schema(relation) -%}\n {%- call statement('drop_schema') -%}\n drop schema if exists {{ relation.without_identifier() }} cascade\n {% endcall %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481804.0069098, "supported_languages": null}, "macro.dbt.current_timestamp": {"unique_id": "macro.dbt.current_timestamp", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/timestamps.sql", "original_file_path": "macros/adapters/timestamps.sql", "name": "current_timestamp", "macro_sql": "{%- macro current_timestamp() -%}\n {{ adapter.dispatch('current_timestamp', 'dbt')() }}\n{%- endmacro -%}\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_postgres.postgres__current_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481804.00746, "supported_languages": null}, "macro.dbt.default__current_timestamp": {"unique_id": "macro.dbt.default__current_timestamp", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/timestamps.sql", "original_file_path": "macros/adapters/timestamps.sql", "name": "default__current_timestamp", "macro_sql": "{% macro default__current_timestamp() -%}\n {{ exceptions.raise_not_implemented(\n 'current_timestamp macro not implemented for adapter ' + adapter.type()) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481804.007617, "supported_languages": null}, "macro.dbt.snapshot_get_time": {"unique_id": "macro.dbt.snapshot_get_time", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/timestamps.sql", "original_file_path": "macros/adapters/timestamps.sql", "name": "snapshot_get_time", "macro_sql": "\n\n{%- macro snapshot_get_time() -%}\n {{ adapter.dispatch('snapshot_get_time', 'dbt')() }}\n{%- endmacro -%}\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_postgres.postgres__snapshot_get_time"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481804.007763, "supported_languages": null}, "macro.dbt.default__snapshot_get_time": {"unique_id": "macro.dbt.default__snapshot_get_time", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/timestamps.sql", "original_file_path": "macros/adapters/timestamps.sql", "name": "default__snapshot_get_time", "macro_sql": "{% macro default__snapshot_get_time() %}\n {{ current_timestamp() }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.current_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481804.00787, "supported_languages": null}, "macro.dbt.current_timestamp_backcompat": {"unique_id": "macro.dbt.current_timestamp_backcompat", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/timestamps.sql", "original_file_path": "macros/adapters/timestamps.sql", "name": "current_timestamp_backcompat", "macro_sql": "{% macro current_timestamp_backcompat() %}\n {{ return(adapter.dispatch('current_timestamp_backcompat', 'dbt')()) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_postgres.postgres__current_timestamp_backcompat"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481804.0080361, "supported_languages": null}, "macro.dbt.default__current_timestamp_backcompat": {"unique_id": "macro.dbt.default__current_timestamp_backcompat", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/timestamps.sql", "original_file_path": "macros/adapters/timestamps.sql", "name": "default__current_timestamp_backcompat", "macro_sql": "{% macro default__current_timestamp_backcompat() %}\n current_timestamp::timestamp\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481804.008115, "supported_languages": null}, "macro.dbt.current_timestamp_in_utc_backcompat": {"unique_id": "macro.dbt.current_timestamp_in_utc_backcompat", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/timestamps.sql", "original_file_path": "macros/adapters/timestamps.sql", "name": "current_timestamp_in_utc_backcompat", "macro_sql": "{% macro current_timestamp_in_utc_backcompat() %}\n {{ return(adapter.dispatch('current_timestamp_in_utc_backcompat', 'dbt')()) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_postgres.postgres__current_timestamp_in_utc_backcompat"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481804.0082822, "supported_languages": null}, "macro.dbt.default__current_timestamp_in_utc_backcompat": {"unique_id": "macro.dbt.default__current_timestamp_in_utc_backcompat", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/timestamps.sql", "original_file_path": "macros/adapters/timestamps.sql", "name": "default__current_timestamp_in_utc_backcompat", "macro_sql": "{% macro default__current_timestamp_in_utc_backcompat() %}\n {{ return(adapter.dispatch('current_timestamp_backcompat', 'dbt')()) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.current_timestamp_backcompat", "macro.dbt_postgres.postgres__current_timestamp_backcompat"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481804.008467, "supported_languages": null}, "macro.dbt.get_create_index_sql": {"unique_id": "macro.dbt.get_create_index_sql", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/indexes.sql", "original_file_path": "macros/adapters/indexes.sql", "name": "get_create_index_sql", "macro_sql": "{% macro get_create_index_sql(relation, index_dict) -%}\n {{ return(adapter.dispatch('get_create_index_sql', 'dbt')(relation, index_dict)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_postgres.postgres__get_create_index_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481804.0089972, "supported_languages": null}, "macro.dbt.default__get_create_index_sql": {"unique_id": "macro.dbt.default__get_create_index_sql", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/indexes.sql", "original_file_path": "macros/adapters/indexes.sql", "name": "default__get_create_index_sql", "macro_sql": "{% macro default__get_create_index_sql(relation, index_dict) -%}\n {% do return(None) %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481804.009205, "supported_languages": null}, "macro.dbt.create_indexes": {"unique_id": "macro.dbt.create_indexes", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/indexes.sql", "original_file_path": "macros/adapters/indexes.sql", "name": "create_indexes", "macro_sql": "{% macro create_indexes(relation) -%}\n {{ adapter.dispatch('create_indexes', 'dbt')(relation) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__create_indexes"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481804.009363, "supported_languages": null}, "macro.dbt.default__create_indexes": {"unique_id": "macro.dbt.default__create_indexes", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/indexes.sql", "original_file_path": "macros/adapters/indexes.sql", "name": "default__create_indexes", "macro_sql": "{% macro default__create_indexes(relation) -%}\n {%- set _indexes = config.get('indexes', default=[]) -%}\n\n {% for _index_dict in _indexes %}\n {% set create_index_sql = get_create_index_sql(relation, _index_dict) %}\n {% if create_index_sql %}\n {% do run_query(create_index_sql) %}\n {% endif %}\n {% endfor %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.get_create_index_sql", "macro.dbt.run_query"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481804.00977, "supported_languages": null}, "macro.dbt.make_intermediate_relation": {"unique_id": "macro.dbt.make_intermediate_relation", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "name": "make_intermediate_relation", "macro_sql": "{% macro make_intermediate_relation(base_relation, suffix='__dbt_tmp') %}\n {{ return(adapter.dispatch('make_intermediate_relation', 'dbt')(base_relation, suffix)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_postgres.postgres__make_intermediate_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481804.012987, "supported_languages": null}, "macro.dbt.default__make_intermediate_relation": {"unique_id": "macro.dbt.default__make_intermediate_relation", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "name": "default__make_intermediate_relation", "macro_sql": "{% macro default__make_intermediate_relation(base_relation, suffix) %}\n {{ return(default__make_temp_relation(base_relation, suffix)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__make_temp_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481804.0131588, "supported_languages": null}, "macro.dbt.make_temp_relation": {"unique_id": "macro.dbt.make_temp_relation", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "name": "make_temp_relation", "macro_sql": "{% macro make_temp_relation(base_relation, suffix='__dbt_tmp') %}\n {{ return(adapter.dispatch('make_temp_relation', 'dbt')(base_relation, suffix)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_postgres.postgres__make_temp_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481804.013388, "supported_languages": null}, "macro.dbt.default__make_temp_relation": {"unique_id": "macro.dbt.default__make_temp_relation", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "name": "default__make_temp_relation", "macro_sql": "{% macro default__make_temp_relation(base_relation, suffix) %}\n {%- set temp_identifier = base_relation.identifier ~ suffix -%}\n {%- set temp_relation = base_relation.incorporate(\n path={\"identifier\": temp_identifier}) -%}\n\n {{ return(temp_relation) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481804.01369, "supported_languages": null}, "macro.dbt.make_backup_relation": {"unique_id": "macro.dbt.make_backup_relation", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "name": "make_backup_relation", "macro_sql": "{% macro make_backup_relation(base_relation, backup_relation_type, suffix='__dbt_backup') %}\n {{ return(adapter.dispatch('make_backup_relation', 'dbt')(base_relation, backup_relation_type, suffix)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_postgres.postgres__make_backup_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481804.013942, "supported_languages": null}, "macro.dbt.default__make_backup_relation": {"unique_id": "macro.dbt.default__make_backup_relation", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "name": "default__make_backup_relation", "macro_sql": "{% macro default__make_backup_relation(base_relation, backup_relation_type, suffix) %}\n {%- set backup_identifier = base_relation.identifier ~ suffix -%}\n {%- set backup_relation = base_relation.incorporate(\n path={\"identifier\": backup_identifier},\n type=backup_relation_type\n ) -%}\n {{ return(backup_relation) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481804.014273, "supported_languages": null}, "macro.dbt.drop_relation": {"unique_id": "macro.dbt.drop_relation", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "name": "drop_relation", "macro_sql": "{% macro drop_relation(relation) -%}\n {{ return(adapter.dispatch('drop_relation', 'dbt')(relation)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__drop_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481804.014465, "supported_languages": null}, "macro.dbt.default__drop_relation": {"unique_id": "macro.dbt.default__drop_relation", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "name": "default__drop_relation", "macro_sql": "{% macro default__drop_relation(relation) -%}\n {% call statement('drop_relation', auto_begin=False) -%}\n drop {{ relation.type }} if exists {{ relation }} cascade\n {%- endcall %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481804.014688, "supported_languages": null}, "macro.dbt.truncate_relation": {"unique_id": "macro.dbt.truncate_relation", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "name": "truncate_relation", "macro_sql": "{% macro truncate_relation(relation) -%}\n {{ return(adapter.dispatch('truncate_relation', 'dbt')(relation)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__truncate_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481804.014876, "supported_languages": null}, "macro.dbt.default__truncate_relation": {"unique_id": "macro.dbt.default__truncate_relation", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "name": "default__truncate_relation", "macro_sql": "{% macro default__truncate_relation(relation) -%}\n {% call statement('truncate_relation') -%}\n truncate table {{ relation }}\n {%- endcall %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481804.015043, "supported_languages": null}, "macro.dbt.rename_relation": {"unique_id": "macro.dbt.rename_relation", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "name": "rename_relation", "macro_sql": "{% macro rename_relation(from_relation, to_relation) -%}\n {{ return(adapter.dispatch('rename_relation', 'dbt')(from_relation, to_relation)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__rename_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481804.015254, "supported_languages": null}, "macro.dbt.default__rename_relation": {"unique_id": "macro.dbt.default__rename_relation", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "name": "default__rename_relation", "macro_sql": "{% macro default__rename_relation(from_relation, to_relation) -%}\n {% set target_name = adapter.quote_as_configured(to_relation.identifier, 'identifier') %}\n {% call statement('rename_relation') -%}\n alter table {{ from_relation }} rename to {{ target_name }}\n {%- endcall %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481804.015539, "supported_languages": null}, "macro.dbt.get_or_create_relation": {"unique_id": "macro.dbt.get_or_create_relation", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "name": "get_or_create_relation", "macro_sql": "{% macro get_or_create_relation(database, schema, identifier, type) -%}\n {{ return(adapter.dispatch('get_or_create_relation', 'dbt')(database, schema, identifier, type)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__get_or_create_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481804.0157921, "supported_languages": null}, "macro.dbt.default__get_or_create_relation": {"unique_id": "macro.dbt.default__get_or_create_relation", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "name": "default__get_or_create_relation", "macro_sql": "{% macro default__get_or_create_relation(database, schema, identifier, type) %}\n {%- set target_relation = adapter.get_relation(database=database, schema=schema, identifier=identifier) %}\n\n {% if target_relation %}\n {% do return([true, target_relation]) %}\n {% endif %}\n\n {%- set new_relation = api.Relation.create(\n database=database,\n schema=schema,\n identifier=identifier,\n type=type\n ) -%}\n {% do return([false, new_relation]) %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481804.0163572, "supported_languages": null}, "macro.dbt.load_cached_relation": {"unique_id": "macro.dbt.load_cached_relation", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "name": "load_cached_relation", "macro_sql": "{% macro load_cached_relation(relation) %}\n {% do return(adapter.get_relation(\n database=relation.database,\n schema=relation.schema,\n identifier=relation.identifier\n )) -%}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481804.0166569, "supported_languages": null}, "macro.dbt.load_relation": {"unique_id": "macro.dbt.load_relation", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "name": "load_relation", "macro_sql": "{% macro load_relation(relation) %}\n {{ return(load_cached_relation(relation)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.load_cached_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481804.016801, "supported_languages": null}, "macro.dbt.drop_relation_if_exists": {"unique_id": "macro.dbt.drop_relation_if_exists", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "name": "drop_relation_if_exists", "macro_sql": "{% macro drop_relation_if_exists(relation) %}\n {% if relation is not none %}\n {{ adapter.drop_relation(relation) }}\n {% endif %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481804.016997, "supported_languages": null}, "macro.dbt.collect_freshness": {"unique_id": "macro.dbt.collect_freshness", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/freshness.sql", "original_file_path": "macros/adapters/freshness.sql", "name": "collect_freshness", "macro_sql": "{% macro collect_freshness(source, loaded_at_field, filter) %}\n {{ return(adapter.dispatch('collect_freshness', 'dbt')(source, loaded_at_field, filter))}}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__collect_freshness"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481804.017526, "supported_languages": null}, "macro.dbt.default__collect_freshness": {"unique_id": "macro.dbt.default__collect_freshness", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/freshness.sql", "original_file_path": "macros/adapters/freshness.sql", "name": "default__collect_freshness", "macro_sql": "{% macro default__collect_freshness(source, loaded_at_field, filter) %}\n {% call statement('collect_freshness', fetch_result=True, auto_begin=False) -%}\n select\n max({{ loaded_at_field }}) as max_loaded_at,\n {{ current_timestamp() }} as snapshotted_at\n from {{ source }}\n {% if filter %}\n where {{ filter }}\n {% endif %}\n {% endcall %}\n {{ return(load_result('collect_freshness').table) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.statement", "macro.dbt.current_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481804.0179682, "supported_languages": null}, "macro.dbt.copy_grants": {"unique_id": "macro.dbt.copy_grants", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "name": "copy_grants", "macro_sql": "{% macro copy_grants() %}\n {{ return(adapter.dispatch('copy_grants', 'dbt')()) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_postgres.postgres__copy_grants"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481804.019658, "supported_languages": null}, "macro.dbt.default__copy_grants": {"unique_id": "macro.dbt.default__copy_grants", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "name": "default__copy_grants", "macro_sql": "{% macro default__copy_grants() %}\n {{ return(True) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481804.019775, "supported_languages": null}, "macro.dbt.support_multiple_grantees_per_dcl_statement": {"unique_id": "macro.dbt.support_multiple_grantees_per_dcl_statement", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "name": "support_multiple_grantees_per_dcl_statement", "macro_sql": "{% macro support_multiple_grantees_per_dcl_statement() %}\n {{ return(adapter.dispatch('support_multiple_grantees_per_dcl_statement', 'dbt')()) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__support_multiple_grantees_per_dcl_statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481804.019946, "supported_languages": null}, "macro.dbt.default__support_multiple_grantees_per_dcl_statement": {"unique_id": "macro.dbt.default__support_multiple_grantees_per_dcl_statement", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "name": "default__support_multiple_grantees_per_dcl_statement", "macro_sql": "\n\n{%- macro default__support_multiple_grantees_per_dcl_statement() -%}\n {{ return(True) }}\n{%- endmacro -%}\n\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481804.020063, "supported_languages": null}, "macro.dbt.should_revoke": {"unique_id": "macro.dbt.should_revoke", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "name": "should_revoke", "macro_sql": "{% macro should_revoke(existing_relation, full_refresh_mode=True) %}\n\n {% if not existing_relation %}\n {#-- The table doesn't already exist, so no grants to copy over --#}\n {{ return(False) }}\n {% elif full_refresh_mode %}\n {#-- The object is being REPLACED -- whether grants are copied over depends on the value of user config --#}\n {{ return(copy_grants()) }}\n {% else %}\n {#-- The table is being merged/upserted/inserted -- grants will be carried over --#}\n {{ return(True) }}\n {% endif %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.copy_grants"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481804.020412, "supported_languages": null}, "macro.dbt.get_show_grant_sql": {"unique_id": "macro.dbt.get_show_grant_sql", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "name": "get_show_grant_sql", "macro_sql": "{% macro get_show_grant_sql(relation) %}\n {{ return(adapter.dispatch(\"get_show_grant_sql\", \"dbt\")(relation)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_postgres.postgres__get_show_grant_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481804.020611, "supported_languages": null}, "macro.dbt.default__get_show_grant_sql": {"unique_id": "macro.dbt.default__get_show_grant_sql", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "name": "default__get_show_grant_sql", "macro_sql": "{% macro default__get_show_grant_sql(relation) %}\n show grants on {{ relation }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481804.020715, "supported_languages": null}, "macro.dbt.get_grant_sql": {"unique_id": "macro.dbt.get_grant_sql", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "name": "get_grant_sql", "macro_sql": "{% macro get_grant_sql(relation, privilege, grantees) %}\n {{ return(adapter.dispatch('get_grant_sql', 'dbt')(relation, privilege, grantees)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__get_grant_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481804.020949, "supported_languages": null}, "macro.dbt.default__get_grant_sql": {"unique_id": "macro.dbt.default__get_grant_sql", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "name": "default__get_grant_sql", "macro_sql": "\n\n{%- macro default__get_grant_sql(relation, privilege, grantees) -%}\n grant {{ privilege }} on {{ relation }} to {{ grantees | join(', ') }}\n{%- endmacro -%}\n\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481804.021149, "supported_languages": null}, "macro.dbt.get_revoke_sql": {"unique_id": "macro.dbt.get_revoke_sql", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "name": "get_revoke_sql", "macro_sql": "{% macro get_revoke_sql(relation, privilege, grantees) %}\n {{ return(adapter.dispatch('get_revoke_sql', 'dbt')(relation, privilege, grantees)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__get_revoke_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481804.021379, "supported_languages": null}, "macro.dbt.default__get_revoke_sql": {"unique_id": "macro.dbt.default__get_revoke_sql", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "name": "default__get_revoke_sql", "macro_sql": "\n\n{%- macro default__get_revoke_sql(relation, privilege, grantees) -%}\n revoke {{ privilege }} on {{ relation }} from {{ grantees | join(', ') }}\n{%- endmacro -%}\n\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481804.0216022, "supported_languages": null}, "macro.dbt.get_dcl_statement_list": {"unique_id": "macro.dbt.get_dcl_statement_list", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "name": "get_dcl_statement_list", "macro_sql": "{% macro get_dcl_statement_list(relation, grant_config, get_dcl_macro) %}\n {{ return(adapter.dispatch('get_dcl_statement_list', 'dbt')(relation, grant_config, get_dcl_macro)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__get_dcl_statement_list"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481804.021848, "supported_languages": null}, "macro.dbt.default__get_dcl_statement_list": {"unique_id": "macro.dbt.default__get_dcl_statement_list", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "name": "default__get_dcl_statement_list", "macro_sql": "\n\n{%- macro default__get_dcl_statement_list(relation, grant_config, get_dcl_macro) -%}\n {#\n -- Unpack grant_config into specific privileges and the set of users who need them granted/revoked.\n -- Depending on whether this database supports multiple grantees per statement, pass in the list of\n -- all grantees per privilege, or (if not) template one statement per privilege-grantee pair.\n -- `get_dcl_macro` will be either `get_grant_sql` or `get_revoke_sql`\n #}\n {%- set dcl_statements = [] -%}\n {%- for privilege, grantees in grant_config.items() %}\n {%- if support_multiple_grantees_per_dcl_statement() and grantees -%}\n {%- set dcl = get_dcl_macro(relation, privilege, grantees) -%}\n {%- do dcl_statements.append(dcl) -%}\n {%- else -%}\n {%- for grantee in grantees -%}\n {% set dcl = get_dcl_macro(relation, privilege, [grantee]) %}\n {%- do dcl_statements.append(dcl) -%}\n {% endfor -%}\n {%- endif -%}\n {%- endfor -%}\n {{ return(dcl_statements) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.support_multiple_grantees_per_dcl_statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481804.022537, "supported_languages": null}, "macro.dbt.call_dcl_statements": {"unique_id": "macro.dbt.call_dcl_statements", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "name": "call_dcl_statements", "macro_sql": "{% macro call_dcl_statements(dcl_statement_list) %}\n {{ return(adapter.dispatch(\"call_dcl_statements\", \"dbt\")(dcl_statement_list)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__call_dcl_statements"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481804.0228019, "supported_languages": null}, "macro.dbt.default__call_dcl_statements": {"unique_id": "macro.dbt.default__call_dcl_statements", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "name": "default__call_dcl_statements", "macro_sql": "{% macro default__call_dcl_statements(dcl_statement_list) %}\n {#\n -- By default, supply all grant + revoke statements in a single semicolon-separated block,\n -- so that they're all processed together.\n\n -- Some databases do not support this. Those adapters will need to override this macro\n -- to run each statement individually.\n #}\n {% call statement('grants') %}\n {% for dcl_statement in dcl_statement_list %}\n {{ dcl_statement }};\n {% endfor %}\n {% endcall %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481804.023057, "supported_languages": null}, "macro.dbt.apply_grants": {"unique_id": "macro.dbt.apply_grants", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "name": "apply_grants", "macro_sql": "{% macro apply_grants(relation, grant_config, should_revoke) %}\n {{ return(adapter.dispatch(\"apply_grants\", \"dbt\")(relation, grant_config, should_revoke)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__apply_grants"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481804.023294, "supported_languages": null}, "macro.dbt.default__apply_grants": {"unique_id": "macro.dbt.default__apply_grants", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "name": "default__apply_grants", "macro_sql": "{% macro default__apply_grants(relation, grant_config, should_revoke=True) %}\n {#-- If grant_config is {} or None, this is a no-op --#}\n {% if grant_config %}\n {% if should_revoke %}\n {#-- We think previous grants may have carried over --#}\n {#-- Show current grants and calculate diffs --#}\n {% set current_grants_table = run_query(get_show_grant_sql(relation)) %}\n {% set current_grants_dict = adapter.standardize_grants_dict(current_grants_table) %}\n {% set needs_granting = diff_of_two_dicts(grant_config, current_grants_dict) %}\n {% set needs_revoking = diff_of_two_dicts(current_grants_dict, grant_config) %}\n {% if not (needs_granting or needs_revoking) %}\n {{ log('On ' ~ relation ~': All grants are in place, no revocation or granting needed.')}}\n {% endif %}\n {% else %}\n {#-- We don't think there's any chance of previous grants having carried over. --#}\n {#-- Jump straight to granting what the user has configured. --#}\n {% set needs_revoking = {} %}\n {% set needs_granting = grant_config %}\n {% endif %}\n {% if needs_granting or needs_revoking %}\n {% set revoke_statement_list = get_dcl_statement_list(relation, needs_revoking, get_revoke_sql) %}\n {% set grant_statement_list = get_dcl_statement_list(relation, needs_granting, get_grant_sql) %}\n {% set dcl_statement_list = revoke_statement_list + grant_statement_list %}\n {% if dcl_statement_list %}\n {{ call_dcl_statements(dcl_statement_list) }}\n {% endif %}\n {% endif %}\n {% endif %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.run_query", "macro.dbt.get_show_grant_sql", "macro.dbt.get_dcl_statement_list", "macro.dbt.call_dcl_statements"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481804.0244539, "supported_languages": null}, "macro.dbt.alter_column_comment": {"unique_id": "macro.dbt.alter_column_comment", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/persist_docs.sql", "original_file_path": "macros/adapters/persist_docs.sql", "name": "alter_column_comment", "macro_sql": "{% macro alter_column_comment(relation, column_dict) -%}\n {{ return(adapter.dispatch('alter_column_comment', 'dbt')(relation, column_dict)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_postgres.postgres__alter_column_comment"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481804.025253, "supported_languages": null}, "macro.dbt.default__alter_column_comment": {"unique_id": "macro.dbt.default__alter_column_comment", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/persist_docs.sql", "original_file_path": "macros/adapters/persist_docs.sql", "name": "default__alter_column_comment", "macro_sql": "{% macro default__alter_column_comment(relation, column_dict) -%}\n {{ exceptions.raise_not_implemented(\n 'alter_column_comment macro not implemented for adapter '+adapter.type()) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481804.0254369, "supported_languages": null}, "macro.dbt.alter_relation_comment": {"unique_id": "macro.dbt.alter_relation_comment", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/persist_docs.sql", "original_file_path": "macros/adapters/persist_docs.sql", "name": "alter_relation_comment", "macro_sql": "{% macro alter_relation_comment(relation, relation_comment) -%}\n {{ return(adapter.dispatch('alter_relation_comment', 'dbt')(relation, relation_comment)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_postgres.postgres__alter_relation_comment"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481804.025652, "supported_languages": null}, "macro.dbt.default__alter_relation_comment": {"unique_id": "macro.dbt.default__alter_relation_comment", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/persist_docs.sql", "original_file_path": "macros/adapters/persist_docs.sql", "name": "default__alter_relation_comment", "macro_sql": "{% macro default__alter_relation_comment(relation, relation_comment) -%}\n {{ exceptions.raise_not_implemented(\n 'alter_relation_comment macro not implemented for adapter '+adapter.type()) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481804.0258272, "supported_languages": null}, "macro.dbt.persist_docs": {"unique_id": "macro.dbt.persist_docs", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/persist_docs.sql", "original_file_path": "macros/adapters/persist_docs.sql", "name": "persist_docs", "macro_sql": "{% macro persist_docs(relation, model, for_relation=true, for_columns=true) -%}\n {{ return(adapter.dispatch('persist_docs', 'dbt')(relation, model, for_relation, for_columns)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__persist_docs"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481804.026103, "supported_languages": null}, "macro.dbt.default__persist_docs": {"unique_id": "macro.dbt.default__persist_docs", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/persist_docs.sql", "original_file_path": "macros/adapters/persist_docs.sql", "name": "default__persist_docs", "macro_sql": "{% macro default__persist_docs(relation, model, for_relation, for_columns) -%}\n {% if for_relation and config.persist_relation_docs() and model.description %}\n {% do run_query(alter_relation_comment(relation, model.description)) %}\n {% endif %}\n\n {% if for_columns and config.persist_column_docs() and model.columns %}\n {% do run_query(alter_column_comment(relation, model.columns)) %}\n {% endif %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.run_query", "macro.dbt.alter_relation_comment", "macro.dbt.alter_column_comment"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481804.026591, "supported_languages": null}, "macro.dbt.get_catalog": {"unique_id": "macro.dbt.get_catalog", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "name": "get_catalog", "macro_sql": "{% macro get_catalog(information_schema, schemas) -%}\n {{ return(adapter.dispatch('get_catalog', 'dbt')(information_schema, schemas)) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_postgres.postgres__get_catalog"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481804.028113, "supported_languages": null}, "macro.dbt.default__get_catalog": {"unique_id": "macro.dbt.default__get_catalog", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "name": "default__get_catalog", "macro_sql": "{% macro default__get_catalog(information_schema, schemas) -%}\n\n {% set typename = adapter.type() %}\n {% set msg -%}\n get_catalog not implemented for {{ typename }}\n {%- endset %}\n\n {{ exceptions.raise_compiler_error(msg) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481804.028383, "supported_languages": null}, "macro.dbt.information_schema_name": {"unique_id": "macro.dbt.information_schema_name", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "name": "information_schema_name", "macro_sql": "{% macro information_schema_name(database) %}\n {{ return(adapter.dispatch('information_schema_name', 'dbt')(database)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_postgres.postgres__information_schema_name"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481804.028594, "supported_languages": null}, "macro.dbt.default__information_schema_name": {"unique_id": "macro.dbt.default__information_schema_name", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "name": "default__information_schema_name", "macro_sql": "{% macro default__information_schema_name(database) -%}\n {%- if database -%}\n {{ database }}.INFORMATION_SCHEMA\n {%- else -%}\n INFORMATION_SCHEMA\n {%- endif -%}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481804.0287502, "supported_languages": null}, "macro.dbt.list_schemas": {"unique_id": "macro.dbt.list_schemas", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "name": "list_schemas", "macro_sql": "{% macro list_schemas(database) -%}\n {{ return(adapter.dispatch('list_schemas', 'dbt')(database)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_postgres.postgres__list_schemas"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481804.02893, "supported_languages": null}, "macro.dbt.default__list_schemas": {"unique_id": "macro.dbt.default__list_schemas", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "name": "default__list_schemas", "macro_sql": "{% macro default__list_schemas(database) -%}\n {% set sql %}\n select distinct schema_name\n from {{ information_schema_name(database) }}.SCHEMATA\n where catalog_name ilike '{{ database }}'\n {% endset %}\n {{ return(run_query(sql)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.information_schema_name", "macro.dbt.run_query"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481804.0291772, "supported_languages": null}, "macro.dbt.check_schema_exists": {"unique_id": "macro.dbt.check_schema_exists", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "name": "check_schema_exists", "macro_sql": "{% macro check_schema_exists(information_schema, schema) -%}\n {{ return(adapter.dispatch('check_schema_exists', 'dbt')(information_schema, schema)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_postgres.postgres__check_schema_exists"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481804.029386, "supported_languages": null}, "macro.dbt.default__check_schema_exists": {"unique_id": "macro.dbt.default__check_schema_exists", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "name": "default__check_schema_exists", "macro_sql": "{% macro default__check_schema_exists(information_schema, schema) -%}\n {% set sql -%}\n select count(*)\n from {{ information_schema.replace(information_schema_view='SCHEMATA') }}\n where catalog_name='{{ information_schema.database }}'\n and schema_name='{{ schema }}'\n {%- endset %}\n {{ return(run_query(sql)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.replace", "macro.dbt.run_query"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481804.029711, "supported_languages": null}, "macro.dbt.list_relations_without_caching": {"unique_id": "macro.dbt.list_relations_without_caching", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "name": "list_relations_without_caching", "macro_sql": "{% macro list_relations_without_caching(schema_relation) %}\n {{ return(adapter.dispatch('list_relations_without_caching', 'dbt')(schema_relation)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_postgres.postgres__list_relations_without_caching"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481804.029907, "supported_languages": null}, "macro.dbt.default__list_relations_without_caching": {"unique_id": "macro.dbt.default__list_relations_without_caching", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "name": "default__list_relations_without_caching", "macro_sql": "{% macro default__list_relations_without_caching(schema_relation) %}\n {{ exceptions.raise_not_implemented(\n 'list_relations_without_caching macro not implemented for adapter '+adapter.type()) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481804.0300741, "supported_languages": null}, "macro.dbt.get_columns_in_relation": {"unique_id": "macro.dbt.get_columns_in_relation", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/columns.sql", "original_file_path": "macros/adapters/columns.sql", "name": "get_columns_in_relation", "macro_sql": "{% macro get_columns_in_relation(relation) -%}\n {{ return(adapter.dispatch('get_columns_in_relation', 'dbt')(relation)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_postgres.postgres__get_columns_in_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481804.0318022, "supported_languages": null}, "macro.dbt.default__get_columns_in_relation": {"unique_id": "macro.dbt.default__get_columns_in_relation", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/columns.sql", "original_file_path": "macros/adapters/columns.sql", "name": "default__get_columns_in_relation", "macro_sql": "{% macro default__get_columns_in_relation(relation) -%}\n {{ exceptions.raise_not_implemented(\n 'get_columns_in_relation macro not implemented for adapter '+adapter.type()) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481804.032035, "supported_languages": null}, "macro.dbt.sql_convert_columns_in_relation": {"unique_id": "macro.dbt.sql_convert_columns_in_relation", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/columns.sql", "original_file_path": "macros/adapters/columns.sql", "name": "sql_convert_columns_in_relation", "macro_sql": "{% macro sql_convert_columns_in_relation(table) -%}\n {% set columns = [] %}\n {% for row in table %}\n {% do columns.append(api.Column(*row)) %}\n {% endfor %}\n {{ return(columns) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481804.032348, "supported_languages": null}, "macro.dbt.get_columns_in_query": {"unique_id": "macro.dbt.get_columns_in_query", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/columns.sql", "original_file_path": "macros/adapters/columns.sql", "name": "get_columns_in_query", "macro_sql": "{% macro get_columns_in_query(select_sql) -%}\n {{ return(adapter.dispatch('get_columns_in_query', 'dbt')(select_sql)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__get_columns_in_query"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481804.032536, "supported_languages": null}, "macro.dbt.default__get_columns_in_query": {"unique_id": "macro.dbt.default__get_columns_in_query", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/columns.sql", "original_file_path": "macros/adapters/columns.sql", "name": "default__get_columns_in_query", "macro_sql": "{% macro default__get_columns_in_query(select_sql) %}\n {% call statement('get_columns_in_query', fetch_result=True, auto_begin=False) -%}\n select * from (\n {{ select_sql }}\n ) as __dbt_sbq\n where false\n limit 0\n {% endcall %}\n\n {{ return(load_result('get_columns_in_query').table.columns | map(attribute='name') | list) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481804.03288, "supported_languages": null}, "macro.dbt.alter_column_type": {"unique_id": "macro.dbt.alter_column_type", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/columns.sql", "original_file_path": "macros/adapters/columns.sql", "name": "alter_column_type", "macro_sql": "{% macro alter_column_type(relation, column_name, new_column_type) -%}\n {{ return(adapter.dispatch('alter_column_type', 'dbt')(relation, column_name, new_column_type)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__alter_column_type"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481804.033115, "supported_languages": null}, "macro.dbt.default__alter_column_type": {"unique_id": "macro.dbt.default__alter_column_type", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/columns.sql", "original_file_path": "macros/adapters/columns.sql", "name": "default__alter_column_type", "macro_sql": "{% macro default__alter_column_type(relation, column_name, new_column_type) -%}\n {#\n 1. Create a new column (w/ temp name and correct type)\n 2. Copy data over to it\n 3. Drop the existing column (cascade!)\n 4. Rename the new column to existing column\n #}\n {%- set tmp_column = column_name + \"__dbt_alter\" -%}\n\n {% call statement('alter_column_type') %}\n alter table {{ relation }} add column {{ adapter.quote(tmp_column) }} {{ new_column_type }};\n update {{ relation }} set {{ adapter.quote(tmp_column) }} = {{ adapter.quote(column_name) }};\n alter table {{ relation }} drop column {{ adapter.quote(column_name) }} cascade;\n alter table {{ relation }} rename column {{ adapter.quote(tmp_column) }} to {{ adapter.quote(column_name) }}\n {% endcall %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481804.0337238, "supported_languages": null}, "macro.dbt.alter_relation_add_remove_columns": {"unique_id": "macro.dbt.alter_relation_add_remove_columns", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/columns.sql", "original_file_path": "macros/adapters/columns.sql", "name": "alter_relation_add_remove_columns", "macro_sql": "{% macro alter_relation_add_remove_columns(relation, add_columns = none, remove_columns = none) -%}\n {{ return(adapter.dispatch('alter_relation_add_remove_columns', 'dbt')(relation, add_columns, remove_columns)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__alter_relation_add_remove_columns"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481804.0339909, "supported_languages": null}, "macro.dbt.default__alter_relation_add_remove_columns": {"unique_id": "macro.dbt.default__alter_relation_add_remove_columns", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/columns.sql", "original_file_path": "macros/adapters/columns.sql", "name": "default__alter_relation_add_remove_columns", "macro_sql": "{% macro default__alter_relation_add_remove_columns(relation, add_columns, remove_columns) %}\n\n {% if add_columns is none %}\n {% set add_columns = [] %}\n {% endif %}\n {% if remove_columns is none %}\n {% set remove_columns = [] %}\n {% endif %}\n\n {% set sql -%}\n\n alter {{ relation.type }} {{ relation }}\n\n {% for column in add_columns %}\n add column {{ column.name }} {{ column.data_type }}{{ ',' if not loop.last }}\n {% endfor %}{{ ',' if add_columns and remove_columns }}\n\n {% for column in remove_columns %}\n drop column {{ column.name }}{{ ',' if not loop.last }}\n {% endfor %}\n\n {%- endset -%}\n\n {% do run_query(sql) %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.run_query"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481804.034791, "supported_languages": null}, "macro.dbt.build_ref_function": {"unique_id": "macro.dbt.build_ref_function", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/python_model/python.sql", "original_file_path": "macros/python_model/python.sql", "name": "build_ref_function", "macro_sql": "{% macro build_ref_function(model) %}\n\n {%- set ref_dict = {} -%}\n {%- for _ref in model.refs -%}\n {%- set resolved = ref(*_ref) -%}\n {%- do ref_dict.update({_ref | join(\".\"): resolved.quote(database=False, schema=False, identifier=False) | string}) -%}\n {%- endfor -%}\n\ndef ref(*args,dbt_load_df_function):\n refs = {{ ref_dict | tojson }}\n key = \".\".join(args)\n return dbt_load_df_function(refs[key])\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481804.036383, "supported_languages": null}, "macro.dbt.build_source_function": {"unique_id": "macro.dbt.build_source_function", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/python_model/python.sql", "original_file_path": "macros/python_model/python.sql", "name": "build_source_function", "macro_sql": "{% macro build_source_function(model) %}\n\n {%- set source_dict = {} -%}\n {%- for _source in model.sources -%}\n {%- set resolved = source(*_source) -%}\n {%- do source_dict.update({_source | join(\".\"): resolved.quote(database=False, schema=False, identifier=False) | string}) -%}\n {%- endfor -%}\n\ndef source(*args, dbt_load_df_function):\n sources = {{ source_dict | tojson }}\n key = \".\".join(args)\n return dbt_load_df_function(sources[key])\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481804.036884, "supported_languages": null}, "macro.dbt.build_config_dict": {"unique_id": "macro.dbt.build_config_dict", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/python_model/python.sql", "original_file_path": "macros/python_model/python.sql", "name": "build_config_dict", "macro_sql": "{% macro build_config_dict(model) %}\n {%- set config_dict = {} -%}\n {%- for key in model.config.config_keys_used -%}\n {# weird type testing with enum, would be much easier to write this logic in Python! #}\n {%- if key == 'language' -%}\n {%- set value = 'python' -%}\n {%- endif -%}\n {%- set value = model.config[key] -%}\n {%- do config_dict.update({key: value}) -%}\n {%- endfor -%}\nconfig_dict = {{ config_dict }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481804.0373518, "supported_languages": null}, "macro.dbt.py_script_postfix": {"unique_id": "macro.dbt.py_script_postfix", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/python_model/python.sql", "original_file_path": "macros/python_model/python.sql", "name": "py_script_postfix", "macro_sql": "{% macro py_script_postfix(model) %}\n# This part is user provided model code\n# you will need to copy the next section to run the code\n# COMMAND ----------\n# this part is dbt logic for get ref work, do not modify\n\n{{ build_ref_function(model ) }}\n{{ build_source_function(model ) }}\n{{ build_config_dict(model) }}\n\nclass config:\n def __init__(self, *args, **kwargs):\n pass\n\n @staticmethod\n def get(key, default=None):\n return config_dict.get(key, default)\n\nclass this:\n \"\"\"dbt.this() or dbt.this.identifier\"\"\"\n database = '{{ this.database }}'\n schema = '{{ this.schema }}'\n identifier = '{{ this.identifier }}'\n def __repr__(self):\n return '{{ this }}'\n\n\nclass dbtObj:\n def __init__(self, load_df_function) -> None:\n self.source = lambda *args: source(*args, dbt_load_df_function=load_df_function)\n self.ref = lambda *args: ref(*args, dbt_load_df_function=load_df_function)\n self.config = config\n self.this = this()\n self.is_incremental = {{ is_incremental() }}\n\n# COMMAND ----------\n{{py_script_comment()}}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.build_ref_function", "macro.dbt.build_source_function", "macro.dbt.build_config_dict", "macro.dbt.is_incremental", "macro.dbt.py_script_comment"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481804.037787, "supported_languages": null}, "macro.dbt.py_script_comment": {"unique_id": "macro.dbt.py_script_comment", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/python_model/python.sql", "original_file_path": "macros/python_model/python.sql", "name": "py_script_comment", "macro_sql": "{%macro py_script_comment()%}\n{%endmacro%}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481804.037868, "supported_languages": null}, "macro.dbt.test_unique": {"unique_id": "macro.dbt.test_unique", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "tests/generic/builtin.sql", "original_file_path": "tests/generic/builtin.sql", "name": "test_unique", "macro_sql": "{% test unique(model, column_name) %}\n {% set macro = adapter.dispatch('test_unique', 'dbt') %}\n {{ macro(model, column_name) }}\n{% endtest %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__test_unique"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481804.0385458, "supported_languages": null}, "macro.dbt.test_not_null": {"unique_id": "macro.dbt.test_not_null", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "tests/generic/builtin.sql", "original_file_path": "tests/generic/builtin.sql", "name": "test_not_null", "macro_sql": "{% test not_null(model, column_name) %}\n {% set macro = adapter.dispatch('test_not_null', 'dbt') %}\n {{ macro(model, column_name) }}\n{% endtest %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__test_not_null"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481804.038792, "supported_languages": null}, "macro.dbt.test_accepted_values": {"unique_id": "macro.dbt.test_accepted_values", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "tests/generic/builtin.sql", "original_file_path": "tests/generic/builtin.sql", "name": "test_accepted_values", "macro_sql": "{% test accepted_values(model, column_name, values, quote=True) %}\n {% set macro = adapter.dispatch('test_accepted_values', 'dbt') %}\n {{ macro(model, column_name, values, quote) }}\n{% endtest %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__test_accepted_values"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481804.0391018, "supported_languages": null}, "macro.dbt.test_relationships": {"unique_id": "macro.dbt.test_relationships", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "tests/generic/builtin.sql", "original_file_path": "tests/generic/builtin.sql", "name": "test_relationships", "macro_sql": "{% test relationships(model, column_name, to, field) %}\n {% set macro = adapter.dispatch('test_relationships', 'dbt') %}\n {{ macro(model, column_name, to, field) }}\n{% endtest %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__test_relationships"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481804.039386, "supported_languages": null}, "macro.dbt_utils.get_url_host": {"unique_id": "macro.dbt_utils.get_url_host", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/dbt_utils", "path": "macros/web/get_url_host.sql", "original_file_path": "macros/web/get_url_host.sql", "name": "get_url_host", "macro_sql": "{% macro get_url_host(field) -%}\n {{ return(adapter.dispatch('get_url_host', 'dbt_utils')(field)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__get_url_host"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481804.0399292, "supported_languages": null}, "macro.dbt_utils.default__get_url_host": {"unique_id": "macro.dbt_utils.default__get_url_host", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/dbt_utils", "path": "macros/web/get_url_host.sql", "original_file_path": "macros/web/get_url_host.sql", "name": "default__get_url_host", "macro_sql": "{% macro default__get_url_host(field) -%}\n\n{%- set parsed =\n dbt.split_part(\n dbt.split_part(\n dbt.replace(\n dbt.replace(\n dbt.replace(field, \"'android-app://'\", \"''\"\n ), \"'http://'\", \"''\"\n ), \"'https://'\", \"''\"\n ), \"'/'\", 1\n ), \"'?'\", 1\n )\n\n-%}\n\n\n {{ dbt.safe_cast(\n parsed,\n dbt.type_string()\n )}}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.split_part", "macro.dbt.replace", "macro.dbt.safe_cast", "macro.dbt.type_string"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481804.040559, "supported_languages": null}, "macro.dbt_utils.get_url_path": {"unique_id": "macro.dbt_utils.get_url_path", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/dbt_utils", "path": "macros/web/get_url_path.sql", "original_file_path": "macros/web/get_url_path.sql", "name": "get_url_path", "macro_sql": "{% macro get_url_path(field) -%}\n {{ return(adapter.dispatch('get_url_path', 'dbt_utils')(field)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__get_url_path"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481804.0413089, "supported_languages": null}, "macro.dbt_utils.default__get_url_path": {"unique_id": "macro.dbt_utils.default__get_url_path", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/dbt_utils", "path": "macros/web/get_url_path.sql", "original_file_path": "macros/web/get_url_path.sql", "name": "default__get_url_path", "macro_sql": "{% macro default__get_url_path(field) -%}\n\n {%- set stripped_url =\n dbt.replace(\n dbt.replace(field, \"'http://'\", \"''\"), \"'https://'\", \"''\")\n -%}\n\n {%- set first_slash_pos -%}\n coalesce(\n nullif({{ dbt.position(\"'/'\", stripped_url) }}, 0),\n {{ dbt.position(\"'?'\", stripped_url) }} - 1\n )\n {%- endset -%}\n\n {%- set parsed_path =\n dbt.split_part(\n dbt.right(\n stripped_url,\n dbt.length(stripped_url) ~ \"-\" ~ first_slash_pos\n ),\n \"'?'\", 1\n )\n -%}\n\n {{ dbt.safe_cast(\n parsed_path,\n dbt.type_string()\n )}}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.replace", "macro.dbt.position", "macro.dbt.split_part", "macro.dbt.right", "macro.dbt.length", "macro.dbt.safe_cast", "macro.dbt.type_string"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481804.042005, "supported_languages": null}, "macro.dbt_utils.get_url_parameter": {"unique_id": "macro.dbt_utils.get_url_parameter", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/dbt_utils", "path": "macros/web/get_url_parameter.sql", "original_file_path": "macros/web/get_url_parameter.sql", "name": "get_url_parameter", "macro_sql": "{% macro get_url_parameter(field, url_parameter) -%}\n {{ return(adapter.dispatch('get_url_parameter', 'dbt_utils')(field, url_parameter)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__get_url_parameter"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481804.0424378, "supported_languages": null}, "macro.dbt_utils.default__get_url_parameter": {"unique_id": "macro.dbt_utils.default__get_url_parameter", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/dbt_utils", "path": "macros/web/get_url_parameter.sql", "original_file_path": "macros/web/get_url_parameter.sql", "name": "default__get_url_parameter", "macro_sql": "{% macro default__get_url_parameter(field, url_parameter) -%}\n\n{%- set formatted_url_parameter = \"'\" + url_parameter + \"='\" -%}\n\n{%- set split = dbt.split_part(dbt.split_part(field, formatted_url_parameter, 2), \"'&'\", 1) -%}\n\nnullif({{ split }},'')\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.split_part"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481804.04276, "supported_languages": null}, "macro.dbt_utils.test_fewer_rows_than": {"unique_id": "macro.dbt_utils.test_fewer_rows_than", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/dbt_utils", "path": "macros/generic_tests/fewer_rows_than.sql", "original_file_path": "macros/generic_tests/fewer_rows_than.sql", "name": "test_fewer_rows_than", "macro_sql": "{% test fewer_rows_than(model, compare_model, group_by_columns = []) %}\n {{ return(adapter.dispatch('test_fewer_rows_than', 'dbt_utils')(model, compare_model, group_by_columns)) }}\n{% endtest %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__test_fewer_rows_than"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481804.04396, "supported_languages": null}, "macro.dbt_utils.default__test_fewer_rows_than": {"unique_id": "macro.dbt_utils.default__test_fewer_rows_than", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/dbt_utils", "path": "macros/generic_tests/fewer_rows_than.sql", "original_file_path": "macros/generic_tests/fewer_rows_than.sql", "name": "default__test_fewer_rows_than", "macro_sql": "{% macro default__test_fewer_rows_than(model, compare_model, group_by_columns) %}\n\n{{ config(fail_calc = 'sum(coalesce(row_count_delta, 0))') }}\n\n{% if group_by_columns|length() > 0 %}\n {% set select_gb_cols = group_by_columns|join(' ,') + ', ' %}\n {% set join_gb_cols %}\n {% for c in group_by_columns %}\n and a.{{c}} = b.{{c}}\n {% endfor %}\n {% endset %}\n {% set groupby_gb_cols = 'group by ' + group_by_columns|join(',') %}\n{% endif %}\n\n{#-- We must add a fake join key in case additional grouping variables are not provided --#}\n{#-- Redshift does not allow for dynamically created join conditions (e.g. full join on 1 = 1 --#}\n{#-- The same logic is used in equal_rowcount. In case of changes, maintain consistent logic --#}\n{% set group_by_columns = ['id_dbtutils_test_fewer_rows_than'] + group_by_columns %}\n{% set groupby_gb_cols = 'group by ' + group_by_columns|join(',') %}\n\n\nwith a as (\n\n select \n {{select_gb_cols}}\n 1 as id_dbtutils_test_fewer_rows_than,\n count(*) as count_our_model \n from {{ model }}\n {{ groupby_gb_cols }}\n\n),\nb as (\n\n select \n {{select_gb_cols}}\n 1 as id_dbtutils_test_fewer_rows_than,\n count(*) as count_comparison_model \n from {{ compare_model }}\n {{ groupby_gb_cols }}\n\n),\ncounts as (\n\n select\n\n {% for c in group_by_columns -%}\n a.{{c}} as {{c}}_a,\n b.{{c}} as {{c}}_b,\n {% endfor %}\n\n count_our_model,\n count_comparison_model\n from a\n full join b on \n a.id_dbtutils_test_fewer_rows_than = b.id_dbtutils_test_fewer_rows_than\n {{ join_gb_cols }}\n\n),\nfinal as (\n\n select *,\n case\n -- fail the test if we have more rows than the reference model and return the row count delta\n when count_our_model > count_comparison_model then (count_our_model - count_comparison_model)\n -- fail the test if they are the same number\n when count_our_model = count_comparison_model then 1\n -- pass the test if the delta is positive (i.e. return the number 0)\n else 0\n end as row_count_delta\n from counts\n\n)\n\nselect * from final\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481804.0450912, "supported_languages": null}, "macro.dbt_utils.test_equal_rowcount": {"unique_id": "macro.dbt_utils.test_equal_rowcount", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/dbt_utils", "path": "macros/generic_tests/equal_rowcount.sql", "original_file_path": "macros/generic_tests/equal_rowcount.sql", "name": "test_equal_rowcount", "macro_sql": "{% test equal_rowcount(model, compare_model, group_by_columns = []) %}\n {{ return(adapter.dispatch('test_equal_rowcount', 'dbt_utils')(model, compare_model, group_by_columns)) }}\n{% endtest %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__test_equal_rowcount"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481804.0460858, "supported_languages": null}, "macro.dbt_utils.default__test_equal_rowcount": {"unique_id": "macro.dbt_utils.default__test_equal_rowcount", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/dbt_utils", "path": "macros/generic_tests/equal_rowcount.sql", "original_file_path": "macros/generic_tests/equal_rowcount.sql", "name": "default__test_equal_rowcount", "macro_sql": "{% macro default__test_equal_rowcount(model, compare_model, group_by_columns) %}\n\n{#-- Needs to be set at parse time, before we return '' below --#}\n{{ config(fail_calc = 'sum(coalesce(diff_count, 0))') }}\n\n{#-- Prevent querying of db in parsing mode. This works because this macro does not create any new refs. #}\n{%- if not execute -%}\n {{ return('') }}\n{% endif %}\n\n{% if group_by_columns|length() > 0 %}\n {% set select_gb_cols = group_by_columns|join(', ') + ', ' %}\n {% set join_gb_cols %}\n {% for c in group_by_columns %}\n and a.{{c}} = b.{{c}}\n {% endfor %}\n {% endset %}\n {% set groupby_gb_cols = 'group by ' + group_by_columns|join(',') %}\n{% endif %}\n\n{#-- We must add a fake join key in case additional grouping variables are not provided --#}\n{#-- Redshift does not allow for dynamically created join conditions (e.g. full join on 1 = 1 --#}\n{#-- The same logic is used in fewer_rows_than. In case of changes, maintain consistent logic --#}\n{% set group_by_columns = ['id_dbtutils_test_equal_rowcount'] + group_by_columns %}\n{% set groupby_gb_cols = 'group by ' + group_by_columns|join(',') %}\n\nwith a as (\n\n select \n {{select_gb_cols}}\n 1 as id_dbtutils_test_equal_rowcount,\n count(*) as count_a \n from {{ model }}\n {{groupby_gb_cols}}\n\n\n),\nb as (\n\n select \n {{select_gb_cols}}\n 1 as id_dbtutils_test_equal_rowcount,\n count(*) as count_b \n from {{ compare_model }}\n {{groupby_gb_cols}}\n\n),\nfinal as (\n\n select\n \n {% for c in group_by_columns -%}\n a.{{c}} as {{c}}_a,\n b.{{c}} as {{c}}_b,\n {% endfor %}\n\n count_a,\n count_b,\n abs(count_a - count_b) as diff_count\n\n from a\n full join b\n on\n a.id_dbtutils_test_equal_rowcount = b.id_dbtutils_test_equal_rowcount\n {{join_gb_cols}}\n\n\n)\n\nselect * from final\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481804.0471659, "supported_languages": null}, "macro.dbt_utils.test_relationships_where": {"unique_id": "macro.dbt_utils.test_relationships_where", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/dbt_utils", "path": "macros/generic_tests/relationships_where.sql", "original_file_path": "macros/generic_tests/relationships_where.sql", "name": "test_relationships_where", "macro_sql": "{% test relationships_where(model, column_name, to, field, from_condition=\"1=1\", to_condition=\"1=1\") %}\n {{ return(adapter.dispatch('test_relationships_where', 'dbt_utils')(model, column_name, to, field, from_condition, to_condition)) }}\n{% endtest %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__test_relationships_where"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481804.0479438, "supported_languages": null}, "macro.dbt_utils.default__test_relationships_where": {"unique_id": "macro.dbt_utils.default__test_relationships_where", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/dbt_utils", "path": "macros/generic_tests/relationships_where.sql", "original_file_path": "macros/generic_tests/relationships_where.sql", "name": "default__test_relationships_where", "macro_sql": "{% macro default__test_relationships_where(model, column_name, to, field, from_condition=\"1=1\", to_condition=\"1=1\") %}\n\n{# T-SQL has no boolean data type so we use 1=1 which returns TRUE #}\n{# ref https://stackoverflow.com/a/7170753/3842610 #}\n\nwith left_table as (\n\n select\n {{column_name}} as id\n\n from {{model}}\n\n where {{column_name}} is not null\n and {{from_condition}}\n\n),\n\nright_table as (\n\n select\n {{field}} as id\n\n from {{to}}\n\n where {{field}} is not null\n and {{to_condition}}\n\n),\n\nexceptions as (\n\n select\n left_table.id,\n right_table.id as right_id\n\n from left_table\n\n left join right_table\n on left_table.id = right_table.id\n\n where right_table.id is null\n\n)\n\nselect * from exceptions\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481804.048288, "supported_languages": null}, "macro.dbt_utils.test_recency": {"unique_id": "macro.dbt_utils.test_recency", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/dbt_utils", "path": "macros/generic_tests/recency.sql", "original_file_path": "macros/generic_tests/recency.sql", "name": "test_recency", "macro_sql": "{% test recency(model, field, datepart, interval, ignore_time_component=False, group_by_columns = []) %}\n {{ return(adapter.dispatch('test_recency', 'dbt_utils')(model, field, datepart, interval, ignore_time_component, group_by_columns)) }}\n{% endtest %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__test_recency"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481804.049103, "supported_languages": null}, "macro.dbt_utils.default__test_recency": {"unique_id": "macro.dbt_utils.default__test_recency", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/dbt_utils", "path": "macros/generic_tests/recency.sql", "original_file_path": "macros/generic_tests/recency.sql", "name": "default__test_recency", "macro_sql": "{% macro default__test_recency(model, field, datepart, interval, ignore_time_component, group_by_columns) %}\n\n{% set threshold = 'cast(' ~ dbt.dateadd(datepart, interval * -1, dbt.current_timestamp()) ~ ' as ' ~ ('date' if ignore_time_component else dbt.type_timestamp()) ~ ')' %}\n\n{% if group_by_columns|length() > 0 %}\n {% set select_gb_cols = group_by_columns|join(' ,') + ', ' %}\n {% set groupby_gb_cols = 'group by ' + group_by_columns|join(',') %}\n{% endif %}\n\n\nwith recency as (\n\n select \n\n {{ select_gb_cols }}\n {% if ignore_time_component %}\n cast(max({{ field }}) as date) as most_recent\n {%- else %}\n max({{ field }}) as most_recent\n {%- endif %}\n\n from {{ model }}\n\n {{ groupby_gb_cols }}\n\n)\n\nselect\n\n {{ select_gb_cols }}\n most_recent,\n {{ threshold }} as threshold\n\nfrom recency\nwhere most_recent < {{ threshold }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.dateadd", "macro.dbt.current_timestamp", "macro.dbt.type_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481804.0499651, "supported_languages": null}, "macro.dbt_utils.test_not_constant": {"unique_id": "macro.dbt_utils.test_not_constant", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/dbt_utils", "path": "macros/generic_tests/not_constant.sql", "original_file_path": "macros/generic_tests/not_constant.sql", "name": "test_not_constant", "macro_sql": "{% test not_constant(model, column_name, group_by_columns = []) %}\n {{ return(adapter.dispatch('test_not_constant', 'dbt_utils')(model, column_name, group_by_columns)) }}\n{% endtest %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__test_not_constant"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481804.0505102, "supported_languages": null}, "macro.dbt_utils.default__test_not_constant": {"unique_id": "macro.dbt_utils.default__test_not_constant", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/dbt_utils", "path": "macros/generic_tests/not_constant.sql", "original_file_path": "macros/generic_tests/not_constant.sql", "name": "default__test_not_constant", "macro_sql": "{% macro default__test_not_constant(model, column_name, group_by_columns) %}\n\n{% if group_by_columns|length() > 0 %}\n {% set select_gb_cols = group_by_columns|join(' ,') + ', ' %}\n {% set groupby_gb_cols = 'group by ' + group_by_columns|join(',') %}\n{% endif %}\n\n\nselect\n {# In TSQL, subquery aggregate columns need aliases #}\n {# thus: a filler col name, 'filler_column' #}\n {{select_gb_cols}}\n count(distinct {{ column_name }}) as filler_column\n\nfrom {{ model }}\n\n {{groupby_gb_cols}}\n\nhaving count(distinct {{ column_name }}) = 1\n\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481804.05098, "supported_languages": null}, "macro.dbt_utils.test_accepted_range": {"unique_id": "macro.dbt_utils.test_accepted_range", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/dbt_utils", "path": "macros/generic_tests/accepted_range.sql", "original_file_path": "macros/generic_tests/accepted_range.sql", "name": "test_accepted_range", "macro_sql": "{% test accepted_range(model, column_name, min_value=none, max_value=none, inclusive=true) %}\n {{ return(adapter.dispatch('test_accepted_range', 'dbt_utils')(model, column_name, min_value, max_value, inclusive)) }}\n{% endtest %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__test_accepted_range"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481804.0517251, "supported_languages": null}, "macro.dbt_utils.default__test_accepted_range": {"unique_id": "macro.dbt_utils.default__test_accepted_range", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/dbt_utils", "path": "macros/generic_tests/accepted_range.sql", "original_file_path": "macros/generic_tests/accepted_range.sql", "name": "default__test_accepted_range", "macro_sql": "{% macro default__test_accepted_range(model, column_name, min_value=none, max_value=none, inclusive=true) %}\n\nwith meet_condition as(\n select *\n from {{ model }}\n),\n\nvalidation_errors as (\n select *\n from meet_condition\n where\n -- never true, defaults to an empty result set. Exists to ensure any combo of the `or` clauses below succeeds\n 1 = 2\n\n {%- if min_value is not none %}\n -- records with a value >= min_value are permitted. The `not` flips this to find records that don't meet the rule.\n or not {{ column_name }} > {{- \"=\" if inclusive }} {{ min_value }}\n {%- endif %}\n\n {%- if max_value is not none %}\n -- records with a value <= max_value are permitted. The `not` flips this to find records that don't meet the rule.\n or not {{ column_name }} < {{- \"=\" if inclusive }} {{ max_value }}\n {%- endif %}\n)\n\nselect *\nfrom validation_errors\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481804.0521889, "supported_languages": null}, "macro.dbt_utils.test_not_accepted_values": {"unique_id": "macro.dbt_utils.test_not_accepted_values", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/dbt_utils", "path": "macros/generic_tests/not_accepted_values.sql", "original_file_path": "macros/generic_tests/not_accepted_values.sql", "name": "test_not_accepted_values", "macro_sql": "{% test not_accepted_values(model, column_name, values, quote=True) %}\n {{ return(adapter.dispatch('test_not_accepted_values', 'dbt_utils')(model, column_name, values, quote)) }}\n{% endtest %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__test_not_accepted_values"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481804.0528069, "supported_languages": null}, "macro.dbt_utils.default__test_not_accepted_values": {"unique_id": "macro.dbt_utils.default__test_not_accepted_values", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/dbt_utils", "path": "macros/generic_tests/not_accepted_values.sql", "original_file_path": "macros/generic_tests/not_accepted_values.sql", "name": "default__test_not_accepted_values", "macro_sql": "{% macro default__test_not_accepted_values(model, column_name, values, quote=True) %}\nwith all_values as (\n\n select distinct\n {{ column_name }} as value_field\n\n from {{ model }}\n\n),\n\nvalidation_errors as (\n\n select\n value_field\n\n from all_values\n where value_field in (\n {% for value in values -%}\n {% if quote -%}\n '{{ value }}'\n {%- else -%}\n {{ value }}\n {%- endif -%}\n {%- if not loop.last -%},{%- endif %}\n {%- endfor %}\n )\n\n)\n\nselect *\nfrom validation_errors\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481804.0532742, "supported_languages": null}, "macro.dbt_utils.test_at_least_one": {"unique_id": "macro.dbt_utils.test_at_least_one", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/dbt_utils", "path": "macros/generic_tests/at_least_one.sql", "original_file_path": "macros/generic_tests/at_least_one.sql", "name": "test_at_least_one", "macro_sql": "{% test at_least_one(model, column_name, group_by_columns = []) %}\n {{ return(adapter.dispatch('test_at_least_one', 'dbt_utils')(model, column_name, group_by_columns)) }}\n{% endtest %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__test_at_least_one"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481804.0539231, "supported_languages": null}, "macro.dbt_utils.default__test_at_least_one": {"unique_id": "macro.dbt_utils.default__test_at_least_one", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/dbt_utils", "path": "macros/generic_tests/at_least_one.sql", "original_file_path": "macros/generic_tests/at_least_one.sql", "name": "default__test_at_least_one", "macro_sql": "{% macro default__test_at_least_one(model, column_name, group_by_columns) %}\n\n{% if group_by_columns|length() > 0 %}\n {% set select_gb_cols = group_by_columns|join(' ,') + ', ' %}\n {% set groupby_gb_cols = 'group by ' + group_by_columns|join(',') %}\n{% endif %}\n\nselect *\nfrom (\n select\n {# In TSQL, subquery aggregate columns need aliases #}\n {# thus: a filler col name, 'filler_column' #}\n {{select_gb_cols}}\n count({{ column_name }}) as filler_column\n\n from {{ model }}\n\n {{groupby_gb_cols}}\n\n having count({{ column_name }}) = 0\n\n) validation_errors\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481804.054456, "supported_languages": null}, "macro.dbt_utils.test_unique_combination_of_columns": {"unique_id": "macro.dbt_utils.test_unique_combination_of_columns", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/dbt_utils", "path": "macros/generic_tests/unique_combination_of_columns.sql", "original_file_path": "macros/generic_tests/unique_combination_of_columns.sql", "name": "test_unique_combination_of_columns", "macro_sql": "{% test unique_combination_of_columns(model, combination_of_columns, quote_columns=false) %}\n {{ return(adapter.dispatch('test_unique_combination_of_columns', 'dbt_utils')(model, combination_of_columns, quote_columns)) }}\n{% endtest %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__test_unique_combination_of_columns"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481804.055212, "supported_languages": null}, "macro.dbt_utils.default__test_unique_combination_of_columns": {"unique_id": "macro.dbt_utils.default__test_unique_combination_of_columns", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/dbt_utils", "path": "macros/generic_tests/unique_combination_of_columns.sql", "original_file_path": "macros/generic_tests/unique_combination_of_columns.sql", "name": "default__test_unique_combination_of_columns", "macro_sql": "{% macro default__test_unique_combination_of_columns(model, combination_of_columns, quote_columns=false) %}\n\n{% if not quote_columns %}\n {%- set column_list=combination_of_columns %}\n{% elif quote_columns %}\n {%- set column_list=[] %}\n {% for column in combination_of_columns -%}\n {% set column_list = column_list.append( adapter.quote(column) ) %}\n {%- endfor %}\n{% else %}\n {{ exceptions.raise_compiler_error(\n \"`quote_columns` argument for unique_combination_of_columns test must be one of [True, False] Got: '\" ~ quote ~\"'.'\"\n ) }}\n{% endif %}\n\n{%- set columns_csv=column_list | join(', ') %}\n\n\nwith validation_errors as (\n\n select\n {{ columns_csv }}\n from {{ model }}\n group by {{ columns_csv }}\n having count(*) > 1\n\n)\n\nselect *\nfrom validation_errors\n\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481804.0559192, "supported_languages": null}, "macro.dbt_utils.test_cardinality_equality": {"unique_id": "macro.dbt_utils.test_cardinality_equality", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/dbt_utils", "path": "macros/generic_tests/cardinality_equality.sql", "original_file_path": "macros/generic_tests/cardinality_equality.sql", "name": "test_cardinality_equality", "macro_sql": "{% test cardinality_equality(model, column_name, to, field) %}\n {{ return(adapter.dispatch('test_cardinality_equality', 'dbt_utils')(model, column_name, to, field)) }}\n{% endtest %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__test_cardinality_equality"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481804.056556, "supported_languages": null}, "macro.dbt_utils.default__test_cardinality_equality": {"unique_id": "macro.dbt_utils.default__test_cardinality_equality", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/dbt_utils", "path": "macros/generic_tests/cardinality_equality.sql", "original_file_path": "macros/generic_tests/cardinality_equality.sql", "name": "default__test_cardinality_equality", "macro_sql": "{% macro default__test_cardinality_equality(model, column_name, to, field) %}\n\n{# T-SQL does not let you use numbers as aliases for columns #}\n{# Thus, no \"GROUP BY 1\" #}\n\nwith table_a as (\nselect\n {{ column_name }},\n count(*) as num_rows\nfrom {{ model }}\ngroup by {{ column_name }}\n),\n\ntable_b as (\nselect\n {{ field }},\n count(*) as num_rows\nfrom {{ to }}\ngroup by {{ field }}\n),\n\nexcept_a as (\n select *\n from table_a\n {{ dbt.except() }}\n select *\n from table_b\n),\n\nexcept_b as (\n select *\n from table_b\n {{ dbt.except() }}\n select *\n from table_a\n),\n\nunioned as (\n select *\n from except_a\n union all\n select *\n from except_b\n)\n\nselect *\nfrom unioned\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.except"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481804.056928, "supported_languages": null}, "macro.dbt_utils.test_expression_is_true": {"unique_id": "macro.dbt_utils.test_expression_is_true", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/dbt_utils", "path": "macros/generic_tests/expression_is_true.sql", "original_file_path": "macros/generic_tests/expression_is_true.sql", "name": "test_expression_is_true", "macro_sql": "{% test expression_is_true(model, expression, column_name=None) %}\n {{ return(adapter.dispatch('test_expression_is_true', 'dbt_utils')(model, expression, column_name)) }}\n{% endtest %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__test_expression_is_true"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481804.057419, "supported_languages": null}, "macro.dbt_utils.default__test_expression_is_true": {"unique_id": "macro.dbt_utils.default__test_expression_is_true", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/dbt_utils", "path": "macros/generic_tests/expression_is_true.sql", "original_file_path": "macros/generic_tests/expression_is_true.sql", "name": "default__test_expression_is_true", "macro_sql": "{% macro default__test_expression_is_true(model, expression, column_name) %}\n\n{% set column_list = '*' if should_store_failures() else \"1\" %}\n\nselect\n {{ column_list }}\nfrom {{ model }}\n{% if column_name is none %}\nwhere not({{ expression }})\n{%- else %}\nwhere not({{ column_name }} {{ expression }})\n{%- endif %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.should_store_failures"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481804.0577989, "supported_languages": null}, "macro.dbt_utils.test_not_null_proportion": {"unique_id": "macro.dbt_utils.test_not_null_proportion", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/dbt_utils", "path": "macros/generic_tests/not_null_proportion.sql", "original_file_path": "macros/generic_tests/not_null_proportion.sql", "name": "test_not_null_proportion", "macro_sql": "{% macro test_not_null_proportion(model, group_by_columns = []) %}\n {{ return(adapter.dispatch('test_not_null_proportion', 'dbt_utils')(model, group_by_columns, **kwargs)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__test_not_null_proportion"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481804.058517, "supported_languages": null}, "macro.dbt_utils.default__test_not_null_proportion": {"unique_id": "macro.dbt_utils.default__test_not_null_proportion", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/dbt_utils", "path": "macros/generic_tests/not_null_proportion.sql", "original_file_path": "macros/generic_tests/not_null_proportion.sql", "name": "default__test_not_null_proportion", "macro_sql": "{% macro default__test_not_null_proportion(model, group_by_columns) %}\n\n{% set column_name = kwargs.get('column_name', kwargs.get('arg')) %}\n{% set at_least = kwargs.get('at_least', kwargs.get('arg')) %}\n{% set at_most = kwargs.get('at_most', kwargs.get('arg', 1)) %}\n\n{% if group_by_columns|length() > 0 %}\n {% set select_gb_cols = group_by_columns|join(' ,') + ', ' %}\n {% set groupby_gb_cols = 'group by ' + group_by_columns|join(',') %}\n{% endif %}\n\nwith validation as (\n select\n {{select_gb_cols}}\n sum(case when {{ column_name }} is null then 0 else 1 end) / cast(count(*) as numeric) as not_null_proportion\n from {{ model }}\n {{groupby_gb_cols}}\n),\nvalidation_errors as (\n select\n {{select_gb_cols}}\n not_null_proportion\n from validation\n where not_null_proportion < {{ at_least }} or not_null_proportion > {{ at_most }}\n)\nselect\n *\nfrom validation_errors\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481804.0593731, "supported_languages": null}, "macro.dbt_utils.test_sequential_values": {"unique_id": "macro.dbt_utils.test_sequential_values", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/dbt_utils", "path": "macros/generic_tests/sequential_values.sql", "original_file_path": "macros/generic_tests/sequential_values.sql", "name": "test_sequential_values", "macro_sql": "{% test sequential_values(model, column_name, interval=1, datepart=None, group_by_columns = []) %}\n\n {{ return(adapter.dispatch('test_sequential_values', 'dbt_utils')(model, column_name, interval, datepart, group_by_columns)) }}\n\n{% endtest %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__test_sequential_values"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481804.0603368, "supported_languages": null}, "macro.dbt_utils.default__test_sequential_values": {"unique_id": "macro.dbt_utils.default__test_sequential_values", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/dbt_utils", "path": "macros/generic_tests/sequential_values.sql", "original_file_path": "macros/generic_tests/sequential_values.sql", "name": "default__test_sequential_values", "macro_sql": "{% macro default__test_sequential_values(model, column_name, interval=1, datepart=None, group_by_columns = []) %}\n\n{% set previous_column_name = \"previous_\" ~ dbt_utils.slugify(column_name) %}\n\n{% if group_by_columns|length() > 0 %}\n {% set select_gb_cols = group_by_columns|join(',') + ', ' %}\n {% set partition_gb_cols = 'partition by ' + group_by_columns|join(',') %}\n{% endif %}\n\nwith windowed as (\n\n select\n {{ select_gb_cols }}\n {{ column_name }},\n lag({{ column_name }}) over (\n {{partition_gb_cols}}\n order by {{ column_name }}\n ) as {{ previous_column_name }}\n from {{ model }}\n),\n\nvalidation_errors as (\n select\n *\n from windowed\n {% if datepart %}\n where not(cast({{ column_name }} as {{ dbt.type_timestamp() }})= cast({{ dbt.dateadd(datepart, interval, previous_column_name) }} as {{ dbt.type_timestamp() }}))\n {% else %}\n where not({{ column_name }} = {{ previous_column_name }} + {{ interval }})\n {% endif %}\n)\n\nselect *\nfrom validation_errors\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.slugify", "macro.dbt.type_timestamp", "macro.dbt.dateadd"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481804.061304, "supported_languages": null}, "macro.dbt_utils.test_equality": {"unique_id": "macro.dbt_utils.test_equality", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/dbt_utils", "path": "macros/generic_tests/equality.sql", "original_file_path": "macros/generic_tests/equality.sql", "name": "test_equality", "macro_sql": "{% test equality(model, compare_model, compare_columns=None) %}\n {{ return(adapter.dispatch('test_equality', 'dbt_utils')(model, compare_model, compare_columns)) }}\n{% endtest %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__test_equality"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481804.062224, "supported_languages": null}, "macro.dbt_utils.default__test_equality": {"unique_id": "macro.dbt_utils.default__test_equality", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/dbt_utils", "path": "macros/generic_tests/equality.sql", "original_file_path": "macros/generic_tests/equality.sql", "name": "default__test_equality", "macro_sql": "{% macro default__test_equality(model, compare_model, compare_columns=None) %}\n\n{% set set_diff %}\n count(*) + coalesce(abs(\n sum(case when which_diff = 'a_minus_b' then 1 else 0 end) -\n sum(case when which_diff = 'b_minus_a' then 1 else 0 end)\n ), 0)\n{% endset %}\n\n{#-- Needs to be set at parse time, before we return '' below --#}\n{{ config(fail_calc = set_diff) }}\n\n{#-- Prevent querying of db in parsing mode. This works because this macro does not create any new refs. #}\n{%- if not execute -%}\n {{ return('') }}\n{% endif %}\n\n-- setup\n{%- do dbt_utils._is_relation(model, 'test_equality') -%}\n\n{#-\nIf the compare_cols arg is provided, we can run this test without querying the\ninformation schema\u00a0\u2014 this allows the model to be an ephemeral model\n-#}\n\n{%- if not compare_columns -%}\n {%- do dbt_utils._is_ephemeral(model, 'test_equality') -%}\n {%- set compare_columns = adapter.get_columns_in_relation(model) | map(attribute='quoted') -%}\n{%- endif -%}\n\n{% set compare_cols_csv = compare_columns | join(', ') %}\n\nwith a as (\n\n select * from {{ model }}\n\n),\n\nb as (\n\n select * from {{ compare_model }}\n\n),\n\na_minus_b as (\n\n select {{compare_cols_csv}} from a\n {{ dbt.except() }}\n select {{compare_cols_csv}} from b\n\n),\n\nb_minus_a as (\n\n select {{compare_cols_csv}} from b\n {{ dbt.except() }}\n select {{compare_cols_csv}} from a\n\n),\n\nunioned as (\n\n select 'a_minus_b' as which_diff, a_minus_b.* from a_minus_b\n union all\n select 'b_minus_a' as which_diff, b_minus_a.* from b_minus_a\n\n)\n\nselect * from unioned\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils._is_relation", "macro.dbt_utils._is_ephemeral", "macro.dbt.except"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481804.063205, "supported_languages": null}, "macro.dbt_utils.test_not_empty_string": {"unique_id": "macro.dbt_utils.test_not_empty_string", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/dbt_utils", "path": "macros/generic_tests/not_empty_string.sql", "original_file_path": "macros/generic_tests/not_empty_string.sql", "name": "test_not_empty_string", "macro_sql": "{% test not_empty_string(model, column_name, trim_whitespace=true) %}\n\n {{ return(adapter.dispatch('test_not_empty_string', 'dbt_utils')(model, column_name, trim_whitespace)) }}\n\n{% endtest %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__test_not_empty_string"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481804.0638878, "supported_languages": null}, "macro.dbt_utils.default__test_not_empty_string": {"unique_id": "macro.dbt_utils.default__test_not_empty_string", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/dbt_utils", "path": "macros/generic_tests/not_empty_string.sql", "original_file_path": "macros/generic_tests/not_empty_string.sql", "name": "default__test_not_empty_string", "macro_sql": "{% macro default__test_not_empty_string(model, column_name, trim_whitespace=true) %}\n\n with\n \n all_values as (\n\n select \n\n\n {% if trim_whitespace == true -%}\n\n trim({{ column_name }}) as {{ column_name }}\n\n {%- else -%}\n\n {{ column_name }}\n\n {%- endif %}\n \n from {{ model }}\n\n ),\n\n errors as (\n\n select * from all_values\n where {{ column_name }} = ''\n\n )\n\n select * from errors\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481804.0642402, "supported_languages": null}, "macro.dbt_utils.test_mutually_exclusive_ranges": {"unique_id": "macro.dbt_utils.test_mutually_exclusive_ranges", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/dbt_utils", "path": "macros/generic_tests/mutually_exclusive_ranges.sql", "original_file_path": "macros/generic_tests/mutually_exclusive_ranges.sql", "name": "test_mutually_exclusive_ranges", "macro_sql": "{% test mutually_exclusive_ranges(model, lower_bound_column, upper_bound_column, partition_by=None, gaps='allowed', zero_length_range_allowed=False) %}\n {{ return(adapter.dispatch('test_mutually_exclusive_ranges', 'dbt_utils')(model, lower_bound_column, upper_bound_column, partition_by, gaps, zero_length_range_allowed)) }}\n{% endtest %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__test_mutually_exclusive_ranges"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481804.06764, "supported_languages": null}, "macro.dbt_utils.default__test_mutually_exclusive_ranges": {"unique_id": "macro.dbt_utils.default__test_mutually_exclusive_ranges", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/dbt_utils", "path": "macros/generic_tests/mutually_exclusive_ranges.sql", "original_file_path": "macros/generic_tests/mutually_exclusive_ranges.sql", "name": "default__test_mutually_exclusive_ranges", "macro_sql": "{% macro default__test_mutually_exclusive_ranges(model, lower_bound_column, upper_bound_column, partition_by=None, gaps='allowed', zero_length_range_allowed=False) %}\n{% if gaps == 'not_allowed' %}\n {% set allow_gaps_operator='=' %}\n {% set allow_gaps_operator_in_words='equal_to' %}\n{% elif gaps == 'allowed' %}\n {% set allow_gaps_operator='<=' %}\n {% set allow_gaps_operator_in_words='less_than_or_equal_to' %}\n{% elif gaps == 'required' %}\n {% set allow_gaps_operator='<' %}\n {% set allow_gaps_operator_in_words='less_than' %}\n{% else %}\n {{ exceptions.raise_compiler_error(\n \"`gaps` argument for mutually_exclusive_ranges test must be one of ['not_allowed', 'allowed', 'required'] Got: '\" ~ gaps ~\"'.'\"\n ) }}\n{% endif %}\n{% if not zero_length_range_allowed %}\n {% set allow_zero_length_operator='<' %}\n {% set allow_zero_length_operator_in_words='less_than' %}\n{% elif zero_length_range_allowed %}\n {% set allow_zero_length_operator='<=' %}\n {% set allow_zero_length_operator_in_words='less_than_or_equal_to' %}\n{% else %}\n {{ exceptions.raise_compiler_error(\n \"`zero_length_range_allowed` argument for mutually_exclusive_ranges test must be one of [true, false] Got: '\" ~ zero_length_range_allowed ~\"'.'\"\n ) }}\n{% endif %}\n\n{% set partition_clause=\"partition by \" ~ partition_by if partition_by else '' %}\n\nwith window_functions as (\n\n select\n {% if partition_by %}\n {{ partition_by }} as partition_by_col,\n {% endif %}\n {{ lower_bound_column }} as lower_bound,\n {{ upper_bound_column }} as upper_bound,\n\n lead({{ lower_bound_column }}) over (\n {{ partition_clause }}\n order by {{ lower_bound_column }}, {{ upper_bound_column }}\n ) as next_lower_bound,\n\n row_number() over (\n {{ partition_clause }}\n order by {{ lower_bound_column }} desc, {{ upper_bound_column }} desc\n ) = 1 as is_last_record\n\n from {{ model }}\n\n),\n\ncalc as (\n -- We want to return records where one of our assumptions fails, so we'll use\n -- the `not` function with `and` statements so we can write our assumptions more cleanly\n select\n *,\n\n -- For each record: lower_bound should be < upper_bound.\n -- Coalesce it to return an error on the null case (implicit assumption\n -- these columns are not_null)\n coalesce(\n lower_bound {{ allow_zero_length_operator }} upper_bound,\n false\n ) as lower_bound_{{ allow_zero_length_operator_in_words }}_upper_bound,\n\n -- For each record: upper_bound {{ allow_gaps_operator }} the next lower_bound.\n -- Coalesce it to handle null cases for the last record.\n coalesce(\n upper_bound {{ allow_gaps_operator }} next_lower_bound,\n is_last_record,\n false\n ) as upper_bound_{{ allow_gaps_operator_in_words }}_next_lower_bound\n\n from window_functions\n\n),\n\nvalidation_errors as (\n\n select\n *\n from calc\n\n where not(\n -- THE FOLLOWING SHOULD BE TRUE --\n lower_bound_{{ allow_zero_length_operator_in_words }}_upper_bound\n and upper_bound_{{ allow_gaps_operator_in_words }}_next_lower_bound\n )\n)\n\nselect * from validation_errors\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481804.069556, "supported_languages": null}, "macro.dbt_utils.pretty_log_format": {"unique_id": "macro.dbt_utils.pretty_log_format", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/dbt_utils", "path": "macros/jinja_helpers/pretty_log_format.sql", "original_file_path": "macros/jinja_helpers/pretty_log_format.sql", "name": "pretty_log_format", "macro_sql": "{% macro pretty_log_format(message) %}\n {{ return(adapter.dispatch('pretty_log_format', 'dbt_utils')(message)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__pretty_log_format"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481804.069972, "supported_languages": null}, "macro.dbt_utils.default__pretty_log_format": {"unique_id": "macro.dbt_utils.default__pretty_log_format", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/dbt_utils", "path": "macros/jinja_helpers/pretty_log_format.sql", "original_file_path": "macros/jinja_helpers/pretty_log_format.sql", "name": "default__pretty_log_format", "macro_sql": "{% macro default__pretty_log_format(message) %}\n {{ return( dbt_utils.pretty_time() ~ ' + ' ~ message) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.pretty_time"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481804.0701451, "supported_languages": null}, "macro.dbt_utils._is_relation": {"unique_id": "macro.dbt_utils._is_relation", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/dbt_utils", "path": "macros/jinja_helpers/_is_relation.sql", "original_file_path": "macros/jinja_helpers/_is_relation.sql", "name": "_is_relation", "macro_sql": "{% macro _is_relation(obj, macro) %}\n {%- if not (obj is mapping and obj.get('metadata', {}).get('type', '').endswith('Relation')) -%}\n {%- do exceptions.raise_compiler_error(\"Macro \" ~ macro ~ \" expected a Relation but received the value: \" ~ obj) -%}\n {%- endif -%}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481804.070687, "supported_languages": null}, "macro.dbt_utils.pretty_time": {"unique_id": "macro.dbt_utils.pretty_time", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/dbt_utils", "path": "macros/jinja_helpers/pretty_time.sql", "original_file_path": "macros/jinja_helpers/pretty_time.sql", "name": "pretty_time", "macro_sql": "{% macro pretty_time(format='%H:%M:%S') %}\n {{ return(adapter.dispatch('pretty_time', 'dbt_utils')(format)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__pretty_time"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481804.0710452, "supported_languages": null}, "macro.dbt_utils.default__pretty_time": {"unique_id": "macro.dbt_utils.default__pretty_time", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/dbt_utils", "path": "macros/jinja_helpers/pretty_time.sql", "original_file_path": "macros/jinja_helpers/pretty_time.sql", "name": "default__pretty_time", "macro_sql": "{% macro default__pretty_time(format='%H:%M:%S') %}\n {{ return(modules.datetime.datetime.now().strftime(format)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481804.0712461, "supported_languages": null}, "macro.dbt_utils.log_info": {"unique_id": "macro.dbt_utils.log_info", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/dbt_utils", "path": "macros/jinja_helpers/log_info.sql", "original_file_path": "macros/jinja_helpers/log_info.sql", "name": "log_info", "macro_sql": "{% macro log_info(message) %}\n {{ return(adapter.dispatch('log_info', 'dbt_utils')(message)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__log_info"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481804.071614, "supported_languages": null}, "macro.dbt_utils.default__log_info": {"unique_id": "macro.dbt_utils.default__log_info", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/dbt_utils", "path": "macros/jinja_helpers/log_info.sql", "original_file_path": "macros/jinja_helpers/log_info.sql", "name": "default__log_info", "macro_sql": "{% macro default__log_info(message) %}\n {{ log(dbt_utils.pretty_log_format(message), info=True) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.pretty_log_format"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481804.0718322, "supported_languages": null}, "macro.dbt_utils.slugify": {"unique_id": "macro.dbt_utils.slugify", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/dbt_utils", "path": "macros/jinja_helpers/slugify.sql", "original_file_path": "macros/jinja_helpers/slugify.sql", "name": "slugify", "macro_sql": "{% macro slugify(string) %}\n\n{#- Lower case the string -#}\n{% set string = string | lower %}\n{#- Replace spaces and dashes with underscores -#}\n{% set string = modules.re.sub('[ -]+', '_', string) %}\n{#- Only take letters, numbers, and underscores -#}\n{% set string = modules.re.sub('[^a-z0-9_]+', '', string) %}\n{#- Prepends \"_\" if string begins with a number -#}\n{% set string = modules.re.sub('^[0-9]', '_' + string[0], string) %}\n\n{{ return(string) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481804.072578, "supported_languages": null}, "macro.dbt_utils._is_ephemeral": {"unique_id": "macro.dbt_utils._is_ephemeral", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/dbt_utils", "path": "macros/jinja_helpers/_is_ephemeral.sql", "original_file_path": "macros/jinja_helpers/_is_ephemeral.sql", "name": "_is_ephemeral", "macro_sql": "{% macro _is_ephemeral(obj, macro) %}\n {%- if obj.is_cte -%}\n {% set ephemeral_prefix = api.Relation.add_ephemeral_prefix('') %}\n {% if obj.name.startswith(ephemeral_prefix) %}\n {% set model_name = obj.name[(ephemeral_prefix|length):] %}\n {% else %}\n {% set model_name = obj.name %}\n {%- endif -%}\n {% set error_message %}\nThe `{{ macro }}` macro cannot be used with ephemeral models, as it relies on the information schema.\n\n`{{ model_name }}` is an ephemeral model. Consider making it a view or table instead.\n {% endset %}\n {%- do exceptions.raise_compiler_error(error_message) -%}\n {%- endif -%}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481804.073544, "supported_languages": null}, "macro.dbt_utils.get_intervals_between": {"unique_id": "macro.dbt_utils.get_intervals_between", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/date_spine.sql", "original_file_path": "macros/sql/date_spine.sql", "name": "get_intervals_between", "macro_sql": "{% macro get_intervals_between(start_date, end_date, datepart) -%}\n {{ return(adapter.dispatch('get_intervals_between', 'dbt_utils')(start_date, end_date, datepart)) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__get_intervals_between"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481804.074334, "supported_languages": null}, "macro.dbt_utils.default__get_intervals_between": {"unique_id": "macro.dbt_utils.default__get_intervals_between", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/date_spine.sql", "original_file_path": "macros/sql/date_spine.sql", "name": "default__get_intervals_between", "macro_sql": "{% macro default__get_intervals_between(start_date, end_date, datepart) -%}\n {%- call statement('get_intervals_between', fetch_result=True) %}\n\n select {{ dbt.datediff(start_date, end_date, datepart) }}\n\n {%- endcall -%}\n\n {%- set value_list = load_result('get_intervals_between') -%}\n\n {%- if value_list and value_list['data'] -%}\n {%- set values = value_list['data'] | map(attribute=0) | list %}\n {{ return(values[0]) }}\n {%- else -%}\n {{ return(1) }}\n {%- endif -%}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.statement", "macro.dbt.datediff"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481804.074952, "supported_languages": null}, "macro.dbt_utils.date_spine": {"unique_id": "macro.dbt_utils.date_spine", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/date_spine.sql", "original_file_path": "macros/sql/date_spine.sql", "name": "date_spine", "macro_sql": "{% macro date_spine(datepart, start_date, end_date) %}\n {{ return(adapter.dispatch('date_spine', 'dbt_utils')(datepart, start_date, end_date)) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__date_spine"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481804.0752032, "supported_languages": null}, "macro.dbt_utils.default__date_spine": {"unique_id": "macro.dbt_utils.default__date_spine", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/date_spine.sql", "original_file_path": "macros/sql/date_spine.sql", "name": "default__date_spine", "macro_sql": "{% macro default__date_spine(datepart, start_date, end_date) %}\n\n\n{# call as follows:\n\ndate_spine(\n \"day\",\n \"to_date('01/01/2016', 'mm/dd/yyyy')\",\n \"dbt.dateadd(week, 1, current_date)\"\n) #}\n\n\nwith rawdata as (\n\n {{dbt_utils.generate_series(\n dbt_utils.get_intervals_between(start_date, end_date, datepart)\n )}}\n\n),\n\nall_periods as (\n\n select (\n {{\n dbt.dateadd(\n datepart,\n \"row_number() over (order by 1) - 1\",\n start_date\n )\n }}\n ) as date_{{datepart}}\n from rawdata\n\n),\n\nfiltered as (\n\n select *\n from all_periods\n where date_{{datepart}} <= {{ end_date }}\n\n)\n\nselect * from filtered\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.generate_series", "macro.dbt_utils.get_intervals_between", "macro.dbt.dateadd"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481804.075588, "supported_languages": null}, "macro.dbt_utils.nullcheck_table": {"unique_id": "macro.dbt_utils.nullcheck_table", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/nullcheck_table.sql", "original_file_path": "macros/sql/nullcheck_table.sql", "name": "nullcheck_table", "macro_sql": "{% macro nullcheck_table(relation) %}\n {{ return(adapter.dispatch('nullcheck_table', 'dbt_utils')(relation)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__nullcheck_table"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481804.0760078, "supported_languages": null}, "macro.dbt_utils.default__nullcheck_table": {"unique_id": "macro.dbt_utils.default__nullcheck_table", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/nullcheck_table.sql", "original_file_path": "macros/sql/nullcheck_table.sql", "name": "default__nullcheck_table", "macro_sql": "{% macro default__nullcheck_table(relation) %}\n\n {%- do dbt_utils._is_relation(relation, 'nullcheck_table') -%}\n {%- do dbt_utils._is_ephemeral(relation, 'nullcheck_table') -%}\n {% set cols = adapter.get_columns_in_relation(relation) %}\n\n select {{ dbt_utils.nullcheck(cols) }}\n from {{relation}}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils._is_relation", "macro.dbt_utils._is_ephemeral", "macro.dbt_utils.nullcheck"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481804.0763829, "supported_languages": null}, "macro.dbt_utils.get_relations_by_pattern": {"unique_id": "macro.dbt_utils.get_relations_by_pattern", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/get_relations_by_pattern.sql", "original_file_path": "macros/sql/get_relations_by_pattern.sql", "name": "get_relations_by_pattern", "macro_sql": "{% macro get_relations_by_pattern(schema_pattern, table_pattern, exclude='', database=target.database) %}\n {{ return(adapter.dispatch('get_relations_by_pattern', 'dbt_utils')(schema_pattern, table_pattern, exclude, database)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__get_relations_by_pattern"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481804.0771751, "supported_languages": null}, "macro.dbt_utils.default__get_relations_by_pattern": {"unique_id": "macro.dbt_utils.default__get_relations_by_pattern", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/get_relations_by_pattern.sql", "original_file_path": "macros/sql/get_relations_by_pattern.sql", "name": "default__get_relations_by_pattern", "macro_sql": "{% macro default__get_relations_by_pattern(schema_pattern, table_pattern, exclude='', database=target.database) %}\n\n {%- call statement('get_tables', fetch_result=True) %}\n\n {{ dbt_utils.get_tables_by_pattern_sql(schema_pattern, table_pattern, exclude, database) }}\n\n {%- endcall -%}\n\n {%- set table_list = load_result('get_tables') -%}\n\n {%- if table_list and table_list['table'] -%}\n {%- set tbl_relations = [] -%}\n {%- for row in table_list['table'] -%}\n {%- set tbl_relation = api.Relation.create(\n database=database,\n schema=row.table_schema,\n identifier=row.table_name,\n type=row.table_type\n ) -%}\n {%- do tbl_relations.append(tbl_relation) -%}\n {%- endfor -%}\n\n {{ return(tbl_relations) }}\n {%- else -%}\n {{ return([]) }}\n {%- endif -%}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.statement", "macro.dbt_utils.get_tables_by_pattern_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481804.0781388, "supported_languages": null}, "macro.dbt_utils.get_powers_of_two": {"unique_id": "macro.dbt_utils.get_powers_of_two", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/generate_series.sql", "original_file_path": "macros/sql/generate_series.sql", "name": "get_powers_of_two", "macro_sql": "{% macro get_powers_of_two(upper_bound) %}\n {{ return(adapter.dispatch('get_powers_of_two', 'dbt_utils')(upper_bound)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__get_powers_of_two"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481804.079031, "supported_languages": null}, "macro.dbt_utils.default__get_powers_of_two": {"unique_id": "macro.dbt_utils.default__get_powers_of_two", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/generate_series.sql", "original_file_path": "macros/sql/generate_series.sql", "name": "default__get_powers_of_two", "macro_sql": "{% macro default__get_powers_of_two(upper_bound) %}\n\n {% if upper_bound <= 0 %}\n {{ exceptions.raise_compiler_error(\"upper bound must be positive\") }}\n {% endif %}\n\n {% for _ in range(1, 100) %}\n {% if upper_bound <= 2 ** loop.index %}{{ return(loop.index) }}{% endif %}\n {% endfor %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481804.079519, "supported_languages": null}, "macro.dbt_utils.generate_series": {"unique_id": "macro.dbt_utils.generate_series", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/generate_series.sql", "original_file_path": "macros/sql/generate_series.sql", "name": "generate_series", "macro_sql": "{% macro generate_series(upper_bound) %}\n {{ return(adapter.dispatch('generate_series', 'dbt_utils')(upper_bound)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__generate_series"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481804.07972, "supported_languages": null}, "macro.dbt_utils.default__generate_series": {"unique_id": "macro.dbt_utils.default__generate_series", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/generate_series.sql", "original_file_path": "macros/sql/generate_series.sql", "name": "default__generate_series", "macro_sql": "{% macro default__generate_series(upper_bound) %}\n\n {% set n = dbt_utils.get_powers_of_two(upper_bound) %}\n\n with p as (\n select 0 as generated_number union all select 1\n ), unioned as (\n\n select\n\n {% for i in range(n) %}\n p{{i}}.generated_number * power(2, {{i}})\n {% if not loop.last %} + {% endif %}\n {% endfor %}\n + 1\n as generated_number\n\n from\n\n {% for i in range(n) %}\n p as p{{i}}\n {% if not loop.last %} cross join {% endif %}\n {% endfor %}\n\n )\n\n select *\n from unioned\n where generated_number <= {{upper_bound}}\n order by generated_number\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.get_powers_of_two"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481804.080269, "supported_languages": null}, "macro.dbt_utils.get_relations_by_prefix": {"unique_id": "macro.dbt_utils.get_relations_by_prefix", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/get_relations_by_prefix.sql", "original_file_path": "macros/sql/get_relations_by_prefix.sql", "name": "get_relations_by_prefix", "macro_sql": "{% macro get_relations_by_prefix(schema, prefix, exclude='', database=target.database) %}\n {{ return(adapter.dispatch('get_relations_by_prefix', 'dbt_utils')(schema, prefix, exclude, database)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__get_relations_by_prefix"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481804.0810502, "supported_languages": null}, "macro.dbt_utils.default__get_relations_by_prefix": {"unique_id": "macro.dbt_utils.default__get_relations_by_prefix", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/get_relations_by_prefix.sql", "original_file_path": "macros/sql/get_relations_by_prefix.sql", "name": "default__get_relations_by_prefix", "macro_sql": "{% macro default__get_relations_by_prefix(schema, prefix, exclude='', database=target.database) %}\n\n {%- call statement('get_tables', fetch_result=True) %}\n\n {{ dbt_utils.get_tables_by_prefix_sql(schema, prefix, exclude, database) }}\n\n {%- endcall -%}\n\n {%- set table_list = load_result('get_tables') -%}\n\n {%- if table_list and table_list['table'] -%}\n {%- set tbl_relations = [] -%}\n {%- for row in table_list['table'] -%}\n {%- set tbl_relation = api.Relation.create(\n database=database,\n schema=row.table_schema,\n identifier=row.table_name,\n type=row.table_type\n ) -%}\n {%- do tbl_relations.append(tbl_relation) -%}\n {%- endfor -%}\n\n {{ return(tbl_relations) }}\n {%- else -%}\n {{ return([]) }}\n {%- endif -%}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.statement", "macro.dbt_utils.get_tables_by_prefix_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481804.081921, "supported_languages": null}, "macro.dbt_utils.get_tables_by_prefix_sql": {"unique_id": "macro.dbt_utils.get_tables_by_prefix_sql", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/get_tables_by_prefix_sql.sql", "original_file_path": "macros/sql/get_tables_by_prefix_sql.sql", "name": "get_tables_by_prefix_sql", "macro_sql": "{% macro get_tables_by_prefix_sql(schema, prefix, exclude='', database=target.database) %}\n {{ return(adapter.dispatch('get_tables_by_prefix_sql', 'dbt_utils')(schema, prefix, exclude, database)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__get_tables_by_prefix_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481804.082437, "supported_languages": null}, "macro.dbt_utils.default__get_tables_by_prefix_sql": {"unique_id": "macro.dbt_utils.default__get_tables_by_prefix_sql", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/get_tables_by_prefix_sql.sql", "original_file_path": "macros/sql/get_tables_by_prefix_sql.sql", "name": "default__get_tables_by_prefix_sql", "macro_sql": "{% macro default__get_tables_by_prefix_sql(schema, prefix, exclude='', database=target.database) %}\n\n {{ dbt_utils.get_tables_by_pattern_sql(\n schema_pattern = schema,\n table_pattern = prefix ~ '%',\n exclude = exclude,\n database = database\n ) }}\n \n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.get_tables_by_pattern_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481804.0827332, "supported_languages": null}, "macro.dbt_utils.star": {"unique_id": "macro.dbt_utils.star", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/star.sql", "original_file_path": "macros/sql/star.sql", "name": "star", "macro_sql": "{% macro star(from, relation_alias=False, except=[], prefix='', suffix='', quote_identifiers=True) -%}\r\n {{ return(adapter.dispatch('star', 'dbt_utils')(from, relation_alias, except, prefix, suffix, quote_identifiers)) }}\r\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__star"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481804.0840142, "supported_languages": null}, "macro.dbt_utils.default__star": {"unique_id": "macro.dbt_utils.default__star", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/star.sql", "original_file_path": "macros/sql/star.sql", "name": "default__star", "macro_sql": "{% macro default__star(from, relation_alias=False, except=[], prefix='', suffix='', quote_identifiers=True) -%}\r\n {%- do dbt_utils._is_relation(from, 'star') -%}\r\n {%- do dbt_utils._is_ephemeral(from, 'star') -%}\r\n\r\n {#-- Prevent querying of db in parsing mode. This works because this macro does not create any new refs. #}\r\n {%- if not execute -%}\r\n {% do return('*') %}\r\n {%- endif -%}\r\n\r\n {% set cols = dbt_utils.get_filtered_columns_in_relation(from, except) %}\r\n\r\n {%- if cols|length <= 0 -%}\r\n {% if flags.WHICH == 'compile' %}\r\n {% set response %}\r\n*\r\n/* No columns were returned. Maybe the relation doesn't exist yet \r\nor all columns were excluded. This star is only output during \r\ndbt compile, and exists to keep SQLFluff happy. */\r\n {% endset %}\r\n {% do return(response) %}\r\n {% else %}\r\n {% do return(\"/* no columns returned from star() macro */\") %}\r\n {% endif %}\r\n {%- else -%}\r\n {%- for col in cols %}\r\n {%- if relation_alias %}{{ relation_alias }}.{% else %}{%- endif -%}\r\n {%- if quote_identifiers -%}\r\n {{ adapter.quote(col)|trim }} {%- if prefix!='' or suffix!='' %} as {{ adapter.quote(prefix ~ col ~ suffix)|trim }} {%- endif -%}\r\n {%- else -%}\r\n {{ col|trim }} {%- if prefix!='' or suffix!='' %} as {{ (prefix ~ col ~ suffix)|trim }} {%- endif -%}\r\n {% endif %}\r\n {%- if not loop.last %},{{ '\\n ' }}{%- endif -%}\r\n {%- endfor -%}\r\n {% endif %}\r\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils._is_relation", "macro.dbt_utils._is_ephemeral", "macro.dbt_utils.get_filtered_columns_in_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481804.085472, "supported_languages": null}, "macro.dbt_utils.unpivot": {"unique_id": "macro.dbt_utils.unpivot", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/unpivot.sql", "original_file_path": "macros/sql/unpivot.sql", "name": "unpivot", "macro_sql": "{% macro unpivot(relation=none, cast_to='varchar', exclude=none, remove=none, field_name='field_name', value_name='value') -%}\n {{ return(adapter.dispatch('unpivot', 'dbt_utils')(relation, cast_to, exclude, remove, field_name, value_name)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__unpivot"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481804.086884, "supported_languages": null}, "macro.dbt_utils.default__unpivot": {"unique_id": "macro.dbt_utils.default__unpivot", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/unpivot.sql", "original_file_path": "macros/sql/unpivot.sql", "name": "default__unpivot", "macro_sql": "{% macro default__unpivot(relation=none, cast_to='varchar', exclude=none, remove=none, field_name='field_name', value_name='value') -%}\n\n {% if not relation %}\n {{ exceptions.raise_compiler_error(\"Error: argument `relation` is required for `unpivot` macro.\") }}\n {% endif %}\n\n {%- set exclude = exclude if exclude is not none else [] %}\n {%- set remove = remove if remove is not none else [] %}\n\n {%- set include_cols = [] %}\n\n {%- set table_columns = {} %}\n\n {%- do table_columns.update({relation: []}) %}\n\n {%- do dbt_utils._is_relation(relation, 'unpivot') -%}\n {%- do dbt_utils._is_ephemeral(relation, 'unpivot') -%}\n {%- set cols = adapter.get_columns_in_relation(relation) %}\n\n {%- for col in cols -%}\n {%- if col.column.lower() not in remove|map('lower') and col.column.lower() not in exclude|map('lower') -%}\n {% do include_cols.append(col) %}\n {%- endif %}\n {%- endfor %}\n\n\n {%- for col in include_cols -%}\n select\n {%- for exclude_col in exclude %}\n {{ exclude_col }},\n {%- endfor %}\n\n cast('{{ col.column }}' as {{ dbt.type_string() }}) as {{ field_name }},\n cast( {% if col.data_type == 'boolean' %}\n {{ dbt.cast_bool_to_text(col.column) }}\n {% else %}\n {{ col.column }}\n {% endif %}\n as {{ cast_to }}) as {{ value_name }}\n\n from {{ relation }}\n\n {% if not loop.last -%}\n union all\n {% endif -%}\n {%- endfor -%}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils._is_relation", "macro.dbt_utils._is_ephemeral", "macro.dbt.type_string", "macro.dbt.cast_bool_to_text"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481804.088634, "supported_languages": null}, "macro.dbt_utils.safe_divide": {"unique_id": "macro.dbt_utils.safe_divide", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/safe_divide.sql", "original_file_path": "macros/sql/safe_divide.sql", "name": "safe_divide", "macro_sql": "{% macro safe_divide(numerator, denominator) -%}\n {{ return(adapter.dispatch('safe_divide', 'dbt_utils')(numerator, denominator)) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__safe_divide"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481804.089024, "supported_languages": null}, "macro.dbt_utils.default__safe_divide": {"unique_id": "macro.dbt_utils.default__safe_divide", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/safe_divide.sql", "original_file_path": "macros/sql/safe_divide.sql", "name": "default__safe_divide", "macro_sql": "{% macro default__safe_divide(numerator, denominator) %}\n ( {{ numerator }} ) / nullif( ( {{ denominator }} ), 0)\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481804.0891619, "supported_languages": null}, "macro.dbt_utils.union_relations": {"unique_id": "macro.dbt_utils.union_relations", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/union.sql", "original_file_path": "macros/sql/union.sql", "name": "union_relations", "macro_sql": "{%- macro union_relations(relations, column_override=none, include=[], exclude=[], source_column_name='_dbt_source_relation', where=none) -%}\n {{ return(adapter.dispatch('union_relations', 'dbt_utils')(relations, column_override, include, exclude, source_column_name, where)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__union_relations"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481804.092206, "supported_languages": null}, "macro.dbt_utils.default__union_relations": {"unique_id": "macro.dbt_utils.default__union_relations", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/union.sql", "original_file_path": "macros/sql/union.sql", "name": "default__union_relations", "macro_sql": "\n\n{%- macro default__union_relations(relations, column_override=none, include=[], exclude=[], source_column_name='_dbt_source_relation', where=none) -%}\n\n {%- if exclude and include -%}\n {{ exceptions.raise_compiler_error(\"Both an exclude and include list were provided to the `union` macro. Only one is allowed\") }}\n {%- endif -%}\n\n {#-- Prevent querying of db in parsing mode. This works because this macro does not create any new refs. -#}\n {%- if not execute %}\n {{ return('') }}\n {% endif -%}\n\n {%- set column_override = column_override if column_override is not none else {} -%}\n\n {%- set relation_columns = {} -%}\n {%- set column_superset = {} -%}\n {%- set all_excludes = [] -%}\n {%- set all_includes = [] -%}\n\n {%- if exclude -%}\n {%- for exc in exclude -%}\n {%- do all_excludes.append(exc | lower) -%}\n {%- endfor -%}\n {%- endif -%}\n\n {%- if include -%}\n {%- for inc in include -%}\n {%- do all_includes.append(inc | lower) -%}\n {%- endfor -%}\n {%- endif -%}\n\n {%- for relation in relations -%}\n\n {%- do relation_columns.update({relation: []}) -%}\n\n {%- do dbt_utils._is_relation(relation, 'union_relations') -%}\n {%- do dbt_utils._is_ephemeral(relation, 'union_relations') -%}\n {%- set cols = adapter.get_columns_in_relation(relation) -%}\n {%- for col in cols -%}\n\n {#- If an exclude list was provided and the column is in the list, do nothing -#}\n {%- if exclude and col.column | lower in all_excludes -%}\n\n {#- If an include list was provided and the column is not in the list, do nothing -#}\n {%- elif include and col.column | lower not in all_includes -%}\n\n {#- Otherwise add the column to the column superset -#}\n {%- else -%}\n\n {#- update the list of columns in this relation -#}\n {%- do relation_columns[relation].append(col.column) -%}\n\n {%- if col.column in column_superset -%}\n\n {%- set stored = column_superset[col.column] -%}\n {%- if col.is_string() and stored.is_string() and col.string_size() > stored.string_size() -%}\n\n {%- do column_superset.update({col.column: col}) -%}\n\n {%- endif %}\n\n {%- else -%}\n\n {%- do column_superset.update({col.column: col}) -%}\n\n {%- endif -%}\n\n {%- endif -%}\n\n {%- endfor -%}\n {%- endfor -%}\n\n {%- set ordered_column_names = column_superset.keys() -%}\n {%- set dbt_command = flags.WHICH -%}\n\n\n {% if dbt_command in ['run', 'build'] %}\n {% if (include | length > 0 or exclude | length > 0) and not column_superset.keys() %}\n {%- set relations_string -%}\n {%- for relation in relations -%}\n {{ relation.name }}\n {%- if not loop.last %}, {% endif -%}\n {%- endfor -%}\n {%- endset -%}\n\n {%- set error_message -%}\n There were no columns found to union for relations {{ relations_string }}\n {%- endset -%}\n\n {{ exceptions.raise_compiler_error(error_message) }}\n {%- endif -%}\n {%- endif -%}\n\n {%- for relation in relations %}\n\n (\n select\n\n {%- if source_column_name is not none %}\n cast({{ dbt.string_literal(relation) }} as {{ dbt.type_string() }}) as {{ source_column_name }},\n {%- endif %}\n\n {% for col_name in ordered_column_names -%}\n\n {%- set col = column_superset[col_name] %}\n {%- set col_type = column_override.get(col.column, col.data_type) %}\n {%- set col_name = adapter.quote(col_name) if col_name in relation_columns[relation] else 'null' %}\n cast({{ col_name }} as {{ col_type }}) as {{ col.quoted }} {% if not loop.last %},{% endif -%}\n\n {%- endfor %}\n\n from {{ relation }}\n\n {% if where -%}\n where {{ where }}\n {%- endif %}\n )\n\n {% if not loop.last -%}\n union all\n {% endif -%}\n\n {%- endfor -%}\n\n{%- endmacro -%}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils._is_relation", "macro.dbt_utils._is_ephemeral", "macro.dbt.string_literal", "macro.dbt.type_string"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481804.095766, "supported_languages": null}, "macro.dbt_utils.group_by": {"unique_id": "macro.dbt_utils.group_by", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/groupby.sql", "original_file_path": "macros/sql/groupby.sql", "name": "group_by", "macro_sql": "{%- macro group_by(n) -%}\n {{ return(adapter.dispatch('group_by', 'dbt_utils')(n)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__group_by"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481804.096172, "supported_languages": null}, "macro.dbt_utils.default__group_by": {"unique_id": "macro.dbt_utils.default__group_by", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/groupby.sql", "original_file_path": "macros/sql/groupby.sql", "name": "default__group_by", "macro_sql": "\n\n{%- macro default__group_by(n) -%}\n\n group by {% for i in range(1, n + 1) -%}\n {{ i }}{{ ',' if not loop.last }} \n {%- endfor -%}\n\n{%- endmacro -%}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481804.0964339, "supported_languages": null}, "macro.dbt_utils.deduplicate": {"unique_id": "macro.dbt_utils.deduplicate", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/deduplicate.sql", "original_file_path": "macros/sql/deduplicate.sql", "name": "deduplicate", "macro_sql": "{%- macro deduplicate(relation, partition_by, order_by) -%}\n {{ return(adapter.dispatch('deduplicate', 'dbt_utils')(relation, partition_by, order_by)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.postgres__deduplicate"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481804.09724, "supported_languages": null}, "macro.dbt_utils.default__deduplicate": {"unique_id": "macro.dbt_utils.default__deduplicate", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/deduplicate.sql", "original_file_path": "macros/sql/deduplicate.sql", "name": "default__deduplicate", "macro_sql": "\n\n{%- macro default__deduplicate(relation, partition_by, order_by) -%}\n\n with row_numbered as (\n select\n _inner.*,\n row_number() over (\n partition by {{ partition_by }}\n order by {{ order_by }}\n ) as rn\n from {{ relation }} as _inner\n )\n\n select\n distinct data.*\n from {{ relation }} as data\n {#\n -- Not all DBs will support natural joins but the ones that do include:\n -- Oracle, MySQL, SQLite, Redshift, Teradata, Materialize, Databricks\n -- Apache Spark, SingleStore, Vertica\n -- Those that do not appear to support natural joins include:\n -- SQLServer, Trino, Presto, Rockset, Athena\n #}\n natural join row_numbered\n where row_numbered.rn = 1\n\n{%- endmacro -%}\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481804.097462, "supported_languages": null}, "macro.dbt_utils.redshift__deduplicate": {"unique_id": "macro.dbt_utils.redshift__deduplicate", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/deduplicate.sql", "original_file_path": "macros/sql/deduplicate.sql", "name": "redshift__deduplicate", "macro_sql": "{% macro redshift__deduplicate(relation, partition_by, order_by) -%}\n\n {{ return(dbt_utils.default__deduplicate(relation, partition_by, order_by=order_by)) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__deduplicate"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481804.097685, "supported_languages": null}, "macro.dbt_utils.postgres__deduplicate": {"unique_id": "macro.dbt_utils.postgres__deduplicate", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/deduplicate.sql", "original_file_path": "macros/sql/deduplicate.sql", "name": "postgres__deduplicate", "macro_sql": "\n{%- macro postgres__deduplicate(relation, partition_by, order_by) -%}\n\n select\n distinct on ({{ partition_by }}) *\n from {{ relation }}\n order by {{ partition_by }}{{ ',' ~ order_by }}\n\n{%- endmacro -%}\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481804.097888, "supported_languages": null}, "macro.dbt_utils.snowflake__deduplicate": {"unique_id": "macro.dbt_utils.snowflake__deduplicate", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/deduplicate.sql", "original_file_path": "macros/sql/deduplicate.sql", "name": "snowflake__deduplicate", "macro_sql": "\n{%- macro snowflake__deduplicate(relation, partition_by, order_by) -%}\n\n select *\n from {{ relation }}\n qualify\n row_number() over (\n partition by {{ partition_by }}\n order by {{ order_by }}\n ) = 1\n\n{%- endmacro -%}\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481804.0980558, "supported_languages": null}, "macro.dbt_utils.bigquery__deduplicate": {"unique_id": "macro.dbt_utils.bigquery__deduplicate", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/deduplicate.sql", "original_file_path": "macros/sql/deduplicate.sql", "name": "bigquery__deduplicate", "macro_sql": "\n{%- macro bigquery__deduplicate(relation, partition_by, order_by) -%}\n\n select unique.*\n from (\n select\n array_agg (\n original\n order by {{ order_by }}\n limit 1\n )[offset(0)] unique\n from {{ relation }} original\n group by {{ partition_by }}\n )\n\n{%- endmacro -%}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481804.098233, "supported_languages": null}, "macro.dbt_utils.surrogate_key": {"unique_id": "macro.dbt_utils.surrogate_key", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/surrogate_key.sql", "original_file_path": "macros/sql/surrogate_key.sql", "name": "surrogate_key", "macro_sql": "{%- macro surrogate_key(field_list) -%}\n {% set frustrating_jinja_feature = varargs %}\n {{ return(adapter.dispatch('surrogate_key', 'dbt_utils')(field_list, *varargs)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__surrogate_key"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481804.098716, "supported_languages": null}, "macro.dbt_utils.default__surrogate_key": {"unique_id": "macro.dbt_utils.default__surrogate_key", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/surrogate_key.sql", "original_file_path": "macros/sql/surrogate_key.sql", "name": "default__surrogate_key", "macro_sql": "\n\n{%- macro default__surrogate_key(field_list) -%}\n\n{%- set error_message = '\nWarning: `dbt_utils.surrogate_key` has been replaced by \\\n`dbt_utils.generate_surrogate_key`. The new macro treats null values \\\ndifferently to empty strings. To restore the behaviour of the original \\\nmacro, add a global variable in dbt_project.yml called \\\n`surrogate_key_treat_nulls_as_empty_strings` to your \\\ndbt_project.yml file with a value of True. \\\nThe {}.{} model triggered this warning. \\\n'.format(model.package_name, model.name) -%}\n\n{%- do exceptions.raise_compiler_error(error_message) -%}\n\n{%- endmacro -%}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481804.0989718, "supported_languages": null}, "macro.dbt_utils.safe_add": {"unique_id": "macro.dbt_utils.safe_add", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/safe_add.sql", "original_file_path": "macros/sql/safe_add.sql", "name": "safe_add", "macro_sql": "{%- macro safe_add(field_list) -%}\n {{ return(adapter.dispatch('safe_add', 'dbt_utils')(field_list)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__safe_add"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481804.099435, "supported_languages": null}, "macro.dbt_utils.default__safe_add": {"unique_id": "macro.dbt_utils.default__safe_add", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/safe_add.sql", "original_file_path": "macros/sql/safe_add.sql", "name": "default__safe_add", "macro_sql": "\n\n{%- macro default__safe_add(field_list) -%}\n\n{%- if field_list is not iterable or field_list is string or field_list is mapping -%}\n\n{%- set error_message = '\nWarning: the `safe_add` macro now takes a single list argument instead of \\\nstring arguments. The {}.{} model triggered this warning. \\\n'.format(model.package_name, model.name) -%}\n\n{%- do exceptions.warn(error_message) -%}\n\n{%- endif -%}\n\n{% set fields = [] %}\n\n{%- for field in field_list -%}\n\n {% do fields.append(\"coalesce(\" ~ field ~ \", 0)\") %}\n\n{%- endfor -%}\n\n{{ fields|join(' +\\n ') }}\n\n{%- endmacro -%}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481804.099997, "supported_languages": null}, "macro.dbt_utils.nullcheck": {"unique_id": "macro.dbt_utils.nullcheck", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/nullcheck.sql", "original_file_path": "macros/sql/nullcheck.sql", "name": "nullcheck", "macro_sql": "{% macro nullcheck(cols) %}\n {{ return(adapter.dispatch('nullcheck', 'dbt_utils')(cols)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__nullcheck"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481804.1004212, "supported_languages": null}, "macro.dbt_utils.default__nullcheck": {"unique_id": "macro.dbt_utils.default__nullcheck", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/nullcheck.sql", "original_file_path": "macros/sql/nullcheck.sql", "name": "default__nullcheck", "macro_sql": "{% macro default__nullcheck(cols) %}\n{%- for col in cols %}\n\n {% if col.is_string() -%}\n\n nullif({{col.name}},'') as {{col.name}}\n\n {%- else -%}\n\n {{col.name}}\n\n {%- endif -%}\n\n{%- if not loop.last -%} , {%- endif -%}\n\n{%- endfor -%}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481804.100758, "supported_languages": null}, "macro.dbt_utils.get_tables_by_pattern_sql": {"unique_id": "macro.dbt_utils.get_tables_by_pattern_sql", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/get_tables_by_pattern_sql.sql", "original_file_path": "macros/sql/get_tables_by_pattern_sql.sql", "name": "get_tables_by_pattern_sql", "macro_sql": "{% macro get_tables_by_pattern_sql(schema_pattern, table_pattern, exclude='', database=target.database) %}\n {{ return(adapter.dispatch('get_tables_by_pattern_sql', 'dbt_utils')\n (schema_pattern, table_pattern, exclude, database)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__get_tables_by_pattern_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481804.102444, "supported_languages": null}, "macro.dbt_utils.default__get_tables_by_pattern_sql": {"unique_id": "macro.dbt_utils.default__get_tables_by_pattern_sql", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/get_tables_by_pattern_sql.sql", "original_file_path": "macros/sql/get_tables_by_pattern_sql.sql", "name": "default__get_tables_by_pattern_sql", "macro_sql": "{% macro default__get_tables_by_pattern_sql(schema_pattern, table_pattern, exclude='', database=target.database) %}\n\n select distinct\n table_schema as {{ adapter.quote('table_schema') }},\n table_name as {{ adapter.quote('table_name') }},\n {{ dbt_utils.get_table_types_sql() }}\n from {{ database }}.information_schema.tables\n where table_schema ilike '{{ schema_pattern }}'\n and table_name ilike '{{ table_pattern }}'\n and table_name not ilike '{{ exclude }}'\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.get_table_types_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481804.1028118, "supported_languages": null}, "macro.dbt_utils.bigquery__get_tables_by_pattern_sql": {"unique_id": "macro.dbt_utils.bigquery__get_tables_by_pattern_sql", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/get_tables_by_pattern_sql.sql", "original_file_path": "macros/sql/get_tables_by_pattern_sql.sql", "name": "bigquery__get_tables_by_pattern_sql", "macro_sql": "{% macro bigquery__get_tables_by_pattern_sql(schema_pattern, table_pattern, exclude='', database=target.database) %}\n\n {% if '%' in schema_pattern %}\n {% set schemata=dbt_utils._bigquery__get_matching_schemata(schema_pattern, database) %}\n {% else %}\n {% set schemata=[schema_pattern] %}\n {% endif %}\n\n {% set sql %}\n {% for schema in schemata %}\n select distinct\n table_schema,\n table_name,\n {{ dbt_utils.get_table_types_sql() }}\n\n from {{ adapter.quote(database) }}.{{ schema }}.INFORMATION_SCHEMA.TABLES\n where lower(table_name) like lower ('{{ table_pattern }}')\n and lower(table_name) not like lower ('{{ exclude }}')\n\n {% if not loop.last %} union all {% endif %}\n\n {% endfor %}\n {% endset %}\n\n {{ return(sql) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils._bigquery__get_matching_schemata", "macro.dbt_utils.get_table_types_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481804.1036139, "supported_languages": null}, "macro.dbt_utils._bigquery__get_matching_schemata": {"unique_id": "macro.dbt_utils._bigquery__get_matching_schemata", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/get_tables_by_pattern_sql.sql", "original_file_path": "macros/sql/get_tables_by_pattern_sql.sql", "name": "_bigquery__get_matching_schemata", "macro_sql": "{% macro _bigquery__get_matching_schemata(schema_pattern, database) %}\n {% if execute %}\n\n {% set sql %}\n select schema_name from {{ adapter.quote(database) }}.INFORMATION_SCHEMA.SCHEMATA\n where lower(schema_name) like lower('{{ schema_pattern }}')\n {% endset %}\n\n {% set results=run_query(sql) %}\n\n {% set schemata=results.columns['schema_name'].values() %}\n\n {{ return(schemata) }}\n\n {% else %}\n\n {{ return([]) }}\n\n {% endif %}\n\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.run_query"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481804.1041439, "supported_languages": null}, "macro.dbt_utils.get_column_values": {"unique_id": "macro.dbt_utils.get_column_values", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/get_column_values.sql", "original_file_path": "macros/sql/get_column_values.sql", "name": "get_column_values", "macro_sql": "{% macro get_column_values(table, column, order_by='count(*) desc', max_records=none, default=none, where=none) -%}\n {{ return(adapter.dispatch('get_column_values', 'dbt_utils')(table, column, order_by, max_records, default, where)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__get_column_values"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481804.105325, "supported_languages": null}, "macro.dbt_utils.default__get_column_values": {"unique_id": "macro.dbt_utils.default__get_column_values", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/get_column_values.sql", "original_file_path": "macros/sql/get_column_values.sql", "name": "default__get_column_values", "macro_sql": "{% macro default__get_column_values(table, column, order_by='count(*) desc', max_records=none, default=none, where=none) -%}\n {#-- Prevent querying of db in parsing mode. This works because this macro does not create any new refs. #}\n {%- if not execute -%}\n {% set default = [] if not default %}\n {{ return(default) }}\n {% endif %}\n\n {%- do dbt_utils._is_ephemeral(table, 'get_column_values') -%}\n\n {# Not all relations are tables. Renaming for internal clarity without breaking functionality for anyone using named arguments #}\n {# TODO: Change the method signature in a future 0.x.0 release #}\n {%- set target_relation = table -%}\n\n {# adapter.load_relation is a convenience wrapper to avoid building a Relation when we already have one #}\n {% set relation_exists = (load_relation(target_relation)) is not none %}\n\n {%- call statement('get_column_values', fetch_result=true) %}\n\n {%- if not relation_exists and default is none -%}\n\n {{ exceptions.raise_compiler_error(\"In get_column_values(): relation \" ~ target_relation ~ \" does not exist and no default value was provided.\") }}\n\n {%- elif not relation_exists and default is not none -%}\n\n {{ log(\"Relation \" ~ target_relation ~ \" does not exist. Returning the default value: \" ~ default) }}\n\n {{ return(default) }}\n\n {%- else -%}\n\n\n select\n {{ column }} as value\n\n from {{ target_relation }}\n\n {% if where is not none %}\n where {{ where }}\n {% endif %}\n\n group by {{ column }}\n order by {{ order_by }}\n\n {% if max_records is not none %}\n limit {{ max_records }}\n {% endif %}\n\n {% endif %}\n\n {%- endcall -%}\n\n {%- set value_list = load_result('get_column_values') -%}\n\n {%- if value_list and value_list['data'] -%}\n {%- set values = value_list['data'] | map(attribute=0) | list %}\n {{ return(values) }}\n {%- else -%}\n {{ return(default) }}\n {%- endif -%}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils._is_ephemeral", "macro.dbt.load_relation", "macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481804.106863, "supported_languages": null}, "macro.dbt_utils.pivot": {"unique_id": "macro.dbt_utils.pivot", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/pivot.sql", "original_file_path": "macros/sql/pivot.sql", "name": "pivot", "macro_sql": "{% macro pivot(column,\n values,\n alias=True,\n agg='sum',\n cmp='=',\n prefix='',\n suffix='',\n then_value=1,\n else_value=0,\n quote_identifiers=True,\n distinct=False) %}\n {{ return(adapter.dispatch('pivot', 'dbt_utils')(column, values, alias, agg, cmp, prefix, suffix, then_value, else_value, quote_identifiers, distinct)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__pivot"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481804.1080692, "supported_languages": null}, "macro.dbt_utils.default__pivot": {"unique_id": "macro.dbt_utils.default__pivot", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/pivot.sql", "original_file_path": "macros/sql/pivot.sql", "name": "default__pivot", "macro_sql": "{% macro default__pivot(column,\n values,\n alias=True,\n agg='sum',\n cmp='=',\n prefix='',\n suffix='',\n then_value=1,\n else_value=0,\n quote_identifiers=True,\n distinct=False) %}\n {% for value in values %}\n {{ agg }}(\n {% if distinct %} distinct {% endif %}\n case\n when {{ column }} {{ cmp }} '{{ dbt.escape_single_quotes(value) }}'\n then {{ then_value }}\n else {{ else_value }}\n end\n )\n {% if alias %}\n {% if quote_identifiers %}\n as {{ adapter.quote(prefix ~ value ~ suffix) }}\n {% else %}\n as {{ dbt_utils.slugify(prefix ~ value ~ suffix) }}\n {% endif %}\n {% endif %}\n {% if not loop.last %},{% endif %}\n {% endfor %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.escape_single_quotes", "macro.dbt_utils.slugify"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481804.108929, "supported_languages": null}, "macro.dbt_utils.get_filtered_columns_in_relation": {"unique_id": "macro.dbt_utils.get_filtered_columns_in_relation", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/get_filtered_columns_in_relation.sql", "original_file_path": "macros/sql/get_filtered_columns_in_relation.sql", "name": "get_filtered_columns_in_relation", "macro_sql": "{% macro get_filtered_columns_in_relation(from, except=[]) -%}\n {{ return(adapter.dispatch('get_filtered_columns_in_relation', 'dbt_utils')(from, except)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__get_filtered_columns_in_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481804.109478, "supported_languages": null}, "macro.dbt_utils.default__get_filtered_columns_in_relation": {"unique_id": "macro.dbt_utils.default__get_filtered_columns_in_relation", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/get_filtered_columns_in_relation.sql", "original_file_path": "macros/sql/get_filtered_columns_in_relation.sql", "name": "default__get_filtered_columns_in_relation", "macro_sql": "{% macro default__get_filtered_columns_in_relation(from, except=[]) -%}\n {%- do dbt_utils._is_relation(from, 'get_filtered_columns_in_relation') -%}\n {%- do dbt_utils._is_ephemeral(from, 'get_filtered_columns_in_relation') -%}\n\n {# -- Prevent querying of db in parsing mode. This works because this macro does not create any new refs. #}\n {%- if not execute -%}\n {{ return('') }}\n {% endif %}\n\n {%- set include_cols = [] %}\n {%- set cols = adapter.get_columns_in_relation(from) -%}\n {%- set except = except | map(\"lower\") | list %}\n {%- for col in cols -%}\n {%- if col.column|lower not in except -%}\n {% do include_cols.append(col.column) %}\n {%- endif %}\n {%- endfor %}\n\n {{ return(include_cols) }}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils._is_relation", "macro.dbt_utils._is_ephemeral"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481804.110223, "supported_languages": null}, "macro.dbt_utils.width_bucket": {"unique_id": "macro.dbt_utils.width_bucket", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/width_bucket.sql", "original_file_path": "macros/sql/width_bucket.sql", "name": "width_bucket", "macro_sql": "{% macro width_bucket(expr, min_value, max_value, num_buckets) %}\n {{ return(adapter.dispatch('width_bucket', 'dbt_utils') (expr, min_value, max_value, num_buckets)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__width_bucket"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481804.111681, "supported_languages": null}, "macro.dbt_utils.default__width_bucket": {"unique_id": "macro.dbt_utils.default__width_bucket", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/width_bucket.sql", "original_file_path": "macros/sql/width_bucket.sql", "name": "default__width_bucket", "macro_sql": "{% macro default__width_bucket(expr, min_value, max_value, num_buckets) -%}\n\n {% set bin_size -%}\n (( {{ max_value }} - {{ min_value }} ) / {{ num_buckets }} )\n {%- endset %}\n (\n -- to break ties when the amount is eaxtly at the bucket egde\n case\n when\n mod(\n {{ dbt.safe_cast(expr, dbt.type_numeric() ) }},\n {{ dbt.safe_cast(bin_size, dbt.type_numeric() ) }}\n ) = 0\n then 1\n else 0\n end\n ) +\n -- Anything over max_value goes the N+1 bucket\n least(\n ceil(\n ({{ expr }} - {{ min_value }})/{{ bin_size }}\n ),\n {{ num_buckets }} + 1\n )\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.safe_cast", "macro.dbt.type_numeric"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481804.112162, "supported_languages": null}, "macro.dbt_utils.redshift__width_bucket": {"unique_id": "macro.dbt_utils.redshift__width_bucket", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/width_bucket.sql", "original_file_path": "macros/sql/width_bucket.sql", "name": "redshift__width_bucket", "macro_sql": "{% macro redshift__width_bucket(expr, min_value, max_value, num_buckets) -%}\n\n {% set bin_size -%}\n (( {{ max_value }} - {{ min_value }} ) / {{ num_buckets }} )\n {%- endset %}\n (\n -- to break ties when the amount is exactly at the bucket edge\n case\n when\n {{ dbt.safe_cast(expr, dbt.type_numeric() ) }} %\n {{ dbt.safe_cast(bin_size, dbt.type_numeric() ) }}\n = 0\n then 1\n else 0\n end\n ) +\n -- Anything over max_value goes the N+1 bucket\n least(\n ceil(\n ({{ expr }} - {{ min_value }})/{{ bin_size }}\n ),\n {{ num_buckets }} + 1\n )\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.safe_cast", "macro.dbt.type_numeric"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481804.1126442, "supported_languages": null}, "macro.dbt_utils.snowflake__width_bucket": {"unique_id": "macro.dbt_utils.snowflake__width_bucket", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/width_bucket.sql", "original_file_path": "macros/sql/width_bucket.sql", "name": "snowflake__width_bucket", "macro_sql": "{% macro snowflake__width_bucket(expr, min_value, max_value, num_buckets) %}\n width_bucket({{ expr }}, {{ min_value }}, {{ max_value }}, {{ num_buckets }} )\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481804.11284, "supported_languages": null}, "macro.dbt_utils.get_query_results_as_dict": {"unique_id": "macro.dbt_utils.get_query_results_as_dict", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/get_query_results_as_dict.sql", "original_file_path": "macros/sql/get_query_results_as_dict.sql", "name": "get_query_results_as_dict", "macro_sql": "{% macro get_query_results_as_dict(query) %}\n {{ return(adapter.dispatch('get_query_results_as_dict', 'dbt_utils')(query)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__get_query_results_as_dict"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481804.113326, "supported_languages": null}, "macro.dbt_utils.default__get_query_results_as_dict": {"unique_id": "macro.dbt_utils.default__get_query_results_as_dict", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/get_query_results_as_dict.sql", "original_file_path": "macros/sql/get_query_results_as_dict.sql", "name": "default__get_query_results_as_dict", "macro_sql": "{% macro default__get_query_results_as_dict(query) %}\n\n{# This macro returns a dictionary of the form {column_name: (tuple_of_results)} #}\n\n {%- call statement('get_query_results', fetch_result=True,auto_begin=false) -%}\n\n {{ query }}\n\n {%- endcall -%}\n\n {% set sql_results={} %}\n\n {%- if execute -%}\n {% set sql_results_table = load_result('get_query_results').table.columns %}\n {% for column_name, column in sql_results_table.items() %}\n {% do sql_results.update({column_name: column.values()}) %}\n {% endfor %}\n {%- endif -%}\n\n {{ return(sql_results) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481804.113943, "supported_languages": null}, "macro.dbt_utils.generate_surrogate_key": {"unique_id": "macro.dbt_utils.generate_surrogate_key", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/generate_surrogate_key.sql", "original_file_path": "macros/sql/generate_surrogate_key.sql", "name": "generate_surrogate_key", "macro_sql": "{%- macro generate_surrogate_key(field_list) -%}\n {{ return(adapter.dispatch('generate_surrogate_key', 'dbt_utils')(field_list)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__generate_surrogate_key"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481804.114482, "supported_languages": null}, "macro.dbt_utils.default__generate_surrogate_key": {"unique_id": "macro.dbt_utils.default__generate_surrogate_key", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/generate_surrogate_key.sql", "original_file_path": "macros/sql/generate_surrogate_key.sql", "name": "default__generate_surrogate_key", "macro_sql": "\n\n{%- macro default__generate_surrogate_key(field_list) -%}\n\n{% if var('surrogate_key_treat_nulls_as_empty_strings', False) %}\n {% set default_null_value = \"\" %}\n{% else %}\n {% set default_null_value = '_dbt_utils_surrogate_key_null_'%}\n{% endif %}\n\n{%- set fields = [] -%}\n\n{%- for field in field_list -%}\n\n {%- do fields.append(\n \"coalesce(cast(\" ~ field ~ \" as \" ~ dbt.type_string() ~ \"), '\" ~ default_null_value ~\"')\"\n ) -%}\n\n {%- if not loop.last %}\n {%- do fields.append(\"'-'\") -%}\n {%- endif -%}\n\n{%- endfor -%}\n\n{{ dbt.hash(dbt.concat(fields)) }}\n\n{%- endmacro -%}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.type_string", "macro.dbt.hash", "macro.dbt.concat"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481804.115146, "supported_languages": null}, "macro.dbt_utils.get_table_types_sql": {"unique_id": "macro.dbt_utils.get_table_types_sql", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/get_table_types_sql.sql", "original_file_path": "macros/sql/get_table_types_sql.sql", "name": "get_table_types_sql", "macro_sql": "{%- macro get_table_types_sql() -%}\n {{ return(adapter.dispatch('get_table_types_sql', 'dbt_utils')()) }}\n{%- endmacro -%}\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.postgres__get_table_types_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481804.115637, "supported_languages": null}, "macro.dbt_utils.default__get_table_types_sql": {"unique_id": "macro.dbt_utils.default__get_table_types_sql", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/get_table_types_sql.sql", "original_file_path": "macros/sql/get_table_types_sql.sql", "name": "default__get_table_types_sql", "macro_sql": "{% macro default__get_table_types_sql() %}\n case table_type\n when 'BASE TABLE' then 'table'\n when 'EXTERNAL TABLE' then 'external'\n when 'MATERIALIZED VIEW' then 'materializedview'\n else lower(table_type)\n end as {{ adapter.quote('table_type') }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481804.115784, "supported_languages": null}, "macro.dbt_utils.postgres__get_table_types_sql": {"unique_id": "macro.dbt_utils.postgres__get_table_types_sql", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/get_table_types_sql.sql", "original_file_path": "macros/sql/get_table_types_sql.sql", "name": "postgres__get_table_types_sql", "macro_sql": "{% macro postgres__get_table_types_sql() %}\n case table_type\n when 'BASE TABLE' then 'table'\n when 'FOREIGN' then 'external'\n when 'MATERIALIZED VIEW' then 'materializedview'\n else lower(table_type)\n end as {{ adapter.quote('table_type') }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481804.115926, "supported_languages": null}, "macro.dbt_utils.get_single_value": {"unique_id": "macro.dbt_utils.get_single_value", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/get_single_value.sql", "original_file_path": "macros/sql/get_single_value.sql", "name": "get_single_value", "macro_sql": "{% macro get_single_value(query, default=none) %}\n {{ return(adapter.dispatch('get_single_value', 'dbt_utils')(query, default)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__get_single_value"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481804.116519, "supported_languages": null}, "macro.dbt_utils.default__get_single_value": {"unique_id": "macro.dbt_utils.default__get_single_value", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/get_single_value.sql", "original_file_path": "macros/sql/get_single_value.sql", "name": "default__get_single_value", "macro_sql": "{% macro default__get_single_value(query, default) %}\n\n{# This macro returns the (0, 0) record in a query, i.e. the first row of the first column #}\n\n {%- call statement('get_query_result', fetch_result=True, auto_begin=false) -%}\n\n {{ query }}\n\n {%- endcall -%}\n\n {%- if execute -%}\n\n {% set r = load_result('get_query_result').table.columns[0].values() %}\n {% if r | length == 0 %}\n {% do print('Query `' ~ query ~ '` returned no rows. Using the default value: ' ~ default) %}\n {% set sql_result = default %}\n {% else %}\n {% set sql_result = r[0] %}\n {% endif %}\n \n {%- else -%}\n \n {% set sql_result = default %}\n \n {%- endif -%}\n\n {% do return(sql_result) %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481804.117412, "supported_languages": null}, "macro.dbt_utils.degrees_to_radians": {"unique_id": "macro.dbt_utils.degrees_to_radians", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/haversine_distance.sql", "original_file_path": "macros/sql/haversine_distance.sql", "name": "degrees_to_radians", "macro_sql": "{% macro degrees_to_radians(degrees) -%}\n acos(-1) * {{degrees}} / 180\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481804.1185548, "supported_languages": null}, "macro.dbt_utils.haversine_distance": {"unique_id": "macro.dbt_utils.haversine_distance", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/haversine_distance.sql", "original_file_path": "macros/sql/haversine_distance.sql", "name": "haversine_distance", "macro_sql": "{% macro haversine_distance(lat1, lon1, lat2, lon2, unit='mi') -%}\n {{ return(adapter.dispatch('haversine_distance', 'dbt_utils')(lat1,lon1,lat2,lon2,unit)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__haversine_distance"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481804.118867, "supported_languages": null}, "macro.dbt_utils.default__haversine_distance": {"unique_id": "macro.dbt_utils.default__haversine_distance", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/haversine_distance.sql", "original_file_path": "macros/sql/haversine_distance.sql", "name": "default__haversine_distance", "macro_sql": "{% macro default__haversine_distance(lat1, lon1, lat2, lon2, unit='mi') -%}\n{%- if unit == 'mi' %}\n {% set conversion_rate = 1 %}\n{% elif unit == 'km' %}\n {% set conversion_rate = 1.60934 %}\n{% else %}\n {{ exceptions.raise_compiler_error(\"unit input must be one of 'mi' or 'km'. Got \" ~ unit) }}\n{% endif %}\n\n 2 * 3961 * asin(sqrt(power((sin(radians(({{ lat2 }} - {{ lat1 }}) / 2))), 2) +\n cos(radians({{lat1}})) * cos(radians({{lat2}})) *\n power((sin(radians(({{ lon2 }} - {{ lon1 }}) / 2))), 2))) * {{ conversion_rate }}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481804.119442, "supported_languages": null}, "macro.dbt_utils.bigquery__haversine_distance": {"unique_id": "macro.dbt_utils.bigquery__haversine_distance", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/haversine_distance.sql", "original_file_path": "macros/sql/haversine_distance.sql", "name": "bigquery__haversine_distance", "macro_sql": "{% macro bigquery__haversine_distance(lat1, lon1, lat2, lon2, unit='mi') -%}\n{% set radians_lat1 = dbt_utils.degrees_to_radians(lat1) %}\n{% set radians_lat2 = dbt_utils.degrees_to_radians(lat2) %}\n{% set radians_lon1 = dbt_utils.degrees_to_radians(lon1) %}\n{% set radians_lon2 = dbt_utils.degrees_to_radians(lon2) %}\n{%- if unit == 'mi' %}\n {% set conversion_rate = 1 %}\n{% elif unit == 'km' %}\n {% set conversion_rate = 1.60934 %}\n{% else %}\n {{ exceptions.raise_compiler_error(\"unit input must be one of 'mi' or 'km'. Got \" ~ unit) }}\n{% endif %}\n 2 * 3961 * asin(sqrt(power(sin(({{ radians_lat2 }} - {{ radians_lat1 }}) / 2), 2) +\n cos({{ radians_lat1 }}) * cos({{ radians_lat2 }}) *\n power(sin(({{ radians_lon2 }} - {{ radians_lon1 }}) / 2), 2))) * {{ conversion_rate }}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.degrees_to_radians"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481804.120256, "supported_languages": null}, "macro.asana_source.get_story_columns": {"unique_id": "macro.asana_source.get_story_columns", "package_name": "asana_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/asana_source", "path": "macros/get_story_columns.sql", "original_file_path": "macros/get_story_columns.sql", "name": "get_story_columns", "macro_sql": "{% macro get_story_columns() %}\n\n{% set columns = [\n {\"name\": \"_fivetran_synced\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"created_at\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"created_by_id\", \"datatype\": dbt.type_string()},\n {\"name\": \"hearted\", \"datatype\": \"boolean\"},\n {\"name\": \"id\", \"datatype\": dbt.type_string()},\n {\"name\": \"num_hearts\", \"datatype\": dbt.type_int()},\n {\"name\": \"source\", \"datatype\": dbt.type_string()},\n {\"name\": \"target_id\", \"datatype\": dbt.type_string()},\n {\"name\": \"text\", \"datatype\": dbt.type_string()},\n {\"name\": \"type\", \"datatype\": dbt.type_string()}\n] %}\n\n{{ return(columns) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.type_timestamp", "macro.dbt.type_string", "macro.dbt.type_int"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481804.121513, "supported_languages": null}, "macro.asana_source.get_task_tag_columns": {"unique_id": "macro.asana_source.get_task_tag_columns", "package_name": "asana_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/asana_source", "path": "macros/get_task_tag_columns.sql", "original_file_path": "macros/get_task_tag_columns.sql", "name": "get_task_tag_columns", "macro_sql": "{% macro get_task_tag_columns() %}\n\n{% set columns = [\n {\"name\": \"_fivetran_synced\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"tag_id\", \"datatype\": dbt.type_string()},\n {\"name\": \"task_id\", \"datatype\": dbt.type_string()}\n] %}\n\n{{ return(columns) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.type_timestamp", "macro.dbt.type_string"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481804.122096, "supported_languages": null}, "macro.asana_source.get_task_columns": {"unique_id": "macro.asana_source.get_task_columns", "package_name": "asana_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/asana_source", "path": "macros/get_task_columns.sql", "original_file_path": "macros/get_task_columns.sql", "name": "get_task_columns", "macro_sql": "{% macro get_task_columns() %}\n\n{% set columns = [\n {\"name\": \"_fivetran_synced\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"assignee_id\", \"datatype\": dbt.type_string()},\n {\"name\": \"completed\", \"datatype\": \"boolean\"},\n {\"name\": \"completed_at\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"completed_by_id\", \"datatype\": dbt.type_string()},\n {\"name\": \"created_at\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"due_at\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"due_on\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"id\", \"datatype\": dbt.type_string()},\n {\"name\": \"modified_at\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"name\", \"datatype\": dbt.type_string()},\n {\"name\": \"notes\", \"datatype\": dbt.type_string()},\n {\"name\": \"liked\", \"datatype\": \"boolean\"},\n {\"name\": \"num_likes\", \"datatype\": dbt.type_int()},\n {\"name\": \"parent_id\", \"datatype\": dbt.type_string()},\n {\"name\": \"start_on\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"workspace_id\", \"datatype\": dbt.type_string()}\n] %}\n\n{{ return(columns) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.type_timestamp", "macro.dbt.type_string", "macro.dbt.type_int"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481804.1240509, "supported_languages": null}, "macro.asana_source.get_task_section_columns": {"unique_id": "macro.asana_source.get_task_section_columns", "package_name": "asana_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/asana_source", "path": "macros/get_task_section_columns.sql", "original_file_path": "macros/get_task_section_columns.sql", "name": "get_task_section_columns", "macro_sql": "{% macro get_task_section_columns() %}\n\n{% set columns = [\n {\"name\": \"_fivetran_synced\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"section_id\", \"datatype\": dbt.type_string()},\n {\"name\": \"task_id\", \"datatype\": dbt.type_string()}\n] %}\n\n{{ return(columns) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.type_timestamp", "macro.dbt.type_string"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481804.124641, "supported_languages": null}, "macro.asana_source.get_team_columns": {"unique_id": "macro.asana_source.get_team_columns", "package_name": "asana_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/asana_source", "path": "macros/get_team_columns.sql", "original_file_path": "macros/get_team_columns.sql", "name": "get_team_columns", "macro_sql": "{% macro get_team_columns() %}\n\n{% set columns = [\n {\"name\": \"_fivetran_deleted\", \"datatype\": \"boolean\"},\n {\"name\": \"_fivetran_synced\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"id\", \"datatype\": dbt.type_string()},\n {\"name\": \"name\", \"datatype\": dbt.type_string()},\n {\"name\": \"organization_id\", \"datatype\": dbt.type_string()}\n] %}\n\n{{ return(columns) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.type_timestamp", "macro.dbt.type_string"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481804.125391, "supported_languages": null}, "macro.asana_source.get_user_columns": {"unique_id": "macro.asana_source.get_user_columns", "package_name": "asana_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/asana_source", "path": "macros/get_user_columns.sql", "original_file_path": "macros/get_user_columns.sql", "name": "get_user_columns", "macro_sql": "{% macro get_user_columns() %}\n\n{% set columns = [\n {\"name\": \"_fivetran_deleted\", \"datatype\": \"boolean\"},\n {\"name\": \"_fivetran_synced\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"email\", \"datatype\": dbt.type_string()},\n {\"name\": \"id\", \"datatype\": dbt.type_string()},\n {\"name\": \"name\", \"datatype\": dbt.type_string()}\n] %}\n\n{{ return(columns) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.type_timestamp", "macro.dbt.type_string"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481804.126137, "supported_languages": null}, "macro.asana_source.get_project_columns": {"unique_id": "macro.asana_source.get_project_columns", "package_name": "asana_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/asana_source", "path": "macros/get_project_columns.sql", "original_file_path": "macros/get_project_columns.sql", "name": "get_project_columns", "macro_sql": "{% macro get_project_columns() %}\n\n{% set columns = [\n {\"name\": \"_fivetran_deleted\", \"datatype\": \"boolean\"},\n {\"name\": \"_fivetran_synced\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"archived\", \"datatype\": \"boolean\"},\n {\"name\": \"color\", \"datatype\": dbt.type_string()},\n {\"name\": \"created_at\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"current_status\", \"datatype\": dbt.type_string()},\n {\"name\": \"due_date\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"id\", \"datatype\": dbt.type_string()},\n {\"name\": \"modified_at\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"name\", \"datatype\": dbt.type_string()},\n {\"name\": \"notes\", \"datatype\": dbt.type_string()},\n {\"name\": \"owner_id\", \"datatype\": dbt.type_string()},\n {\"name\": \"public\", \"datatype\": \"boolean\"},\n {\"name\": \"team_id\", \"datatype\": dbt.type_string()},\n {\"name\": \"workspace_id\", \"datatype\": dbt.type_string()}\n] %}\n\n{{ return(columns) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.type_timestamp", "macro.dbt.type_string"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481804.127879, "supported_languages": null}, "macro.asana_source.get_task_follower_columns": {"unique_id": "macro.asana_source.get_task_follower_columns", "package_name": "asana_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/asana_source", "path": "macros/get_task_follower_columns.sql", "original_file_path": "macros/get_task_follower_columns.sql", "name": "get_task_follower_columns", "macro_sql": "{% macro get_task_follower_columns() %}\n\n{% set columns = [\n {\"name\": \"_fivetran_synced\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"task_id\", \"datatype\": dbt.type_string()},\n {\"name\": \"user_id\", \"datatype\": dbt.type_string()}\n] %}\n\n{{ return(columns) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.type_timestamp", "macro.dbt.type_string"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481804.12846, "supported_languages": null}, "macro.asana_source.get_section_columns": {"unique_id": "macro.asana_source.get_section_columns", "package_name": "asana_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/asana_source", "path": "macros/get_section_columns.sql", "original_file_path": "macros/get_section_columns.sql", "name": "get_section_columns", "macro_sql": "{% macro get_section_columns() %}\n\n{% set columns = [\n {\"name\": \"_fivetran_synced\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"created_at\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"id\", \"datatype\": dbt.type_string()},\n {\"name\": \"name\", \"datatype\": dbt.type_string()},\n {\"name\": \"project_id\", \"datatype\": dbt.type_string()}\n] %}\n\n{{ return(columns) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.type_timestamp", "macro.dbt.type_string"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481804.129209, "supported_languages": null}, "macro.asana_source.get_project_task_columns": {"unique_id": "macro.asana_source.get_project_task_columns", "package_name": "asana_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/asana_source", "path": "macros/get_project_task_columns.sql", "original_file_path": "macros/get_project_task_columns.sql", "name": "get_project_task_columns", "macro_sql": "{% macro get_project_task_columns() %}\n\n{% set columns = [\n {\"name\": \"_fivetran_synced\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"project_id\", \"datatype\": dbt.type_string()},\n {\"name\": \"task_id\", \"datatype\": dbt.type_string()}\n] %}\n\n{{ return(columns) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.type_timestamp", "macro.dbt.type_string"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481804.129781, "supported_languages": null}, "macro.asana_source.get_tag_columns": {"unique_id": "macro.asana_source.get_tag_columns", "package_name": "asana_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/asana_source", "path": "macros/get_tag_columns.sql", "original_file_path": "macros/get_tag_columns.sql", "name": "get_tag_columns", "macro_sql": "{% macro get_tag_columns() %}\n\n{% set columns = [\n {\"name\": \"_fivetran_deleted\", \"datatype\": \"boolean\"},\n {\"name\": \"_fivetran_synced\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"color\", \"datatype\": dbt.type_string()},\n {\"name\": \"created_at\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"id\", \"datatype\": dbt.type_string()},\n {\"name\": \"message\", \"datatype\": dbt.type_string()},\n {\"name\": \"name\", \"datatype\": dbt.type_string()},\n {\"name\": \"notes\", \"datatype\": dbt.type_string()},\n {\"name\": \"workspace_id\", \"datatype\": dbt.type_string()}\n] %}\n\n{{ return(columns) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.type_timestamp", "macro.dbt.type_string"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481804.131104, "supported_languages": null}, "macro.fivetran_utils.enabled_vars": {"unique_id": "macro.fivetran_utils.enabled_vars", "package_name": "fivetran_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/fivetran_utils", "path": "macros/enabled_vars.sql", "original_file_path": "macros/enabled_vars.sql", "name": "enabled_vars", "macro_sql": "{% macro enabled_vars(vars) %}\n\n{% for v in vars %}\n \n {% if var(v, True) == False %}\n {{ return(False) }}\n {% endif %}\n\n{% endfor %}\n\n{{ return(True) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481804.1316638, "supported_languages": null}, "macro.fivetran_utils.percentile": {"unique_id": "macro.fivetran_utils.percentile", "package_name": "fivetran_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/fivetran_utils", "path": "macros/percentile.sql", "original_file_path": "macros/percentile.sql", "name": "percentile", "macro_sql": "{% macro percentile(percentile_field, partition_field, percent) -%}\n\n{{ adapter.dispatch('percentile', 'fivetran_utils') (percentile_field, partition_field, percent) }}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.fivetran_utils.postgres__percentile"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481804.132633, "supported_languages": null}, "macro.fivetran_utils.default__percentile": {"unique_id": "macro.fivetran_utils.default__percentile", "package_name": "fivetran_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/fivetran_utils", "path": "macros/percentile.sql", "original_file_path": "macros/percentile.sql", "name": "default__percentile", "macro_sql": "{% macro default__percentile(percentile_field, partition_field, percent) %}\n\n percentile_cont( \n {{ percent }} )\n within group ( order by {{ percentile_field }} )\n over ( partition by {{ partition_field }} )\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481804.132805, "supported_languages": null}, "macro.fivetran_utils.redshift__percentile": {"unique_id": "macro.fivetran_utils.redshift__percentile", "package_name": "fivetran_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/fivetran_utils", "path": "macros/percentile.sql", "original_file_path": "macros/percentile.sql", "name": "redshift__percentile", "macro_sql": "{% macro redshift__percentile(percentile_field, partition_field, percent) %}\n\n percentile_cont( \n {{ percent }} )\n within group ( order by {{ percentile_field }} )\n over ( partition by {{ partition_field }} )\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481804.132962, "supported_languages": null}, "macro.fivetran_utils.bigquery__percentile": {"unique_id": "macro.fivetran_utils.bigquery__percentile", "package_name": "fivetran_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/fivetran_utils", "path": "macros/percentile.sql", "original_file_path": "macros/percentile.sql", "name": "bigquery__percentile", "macro_sql": "{% macro bigquery__percentile(percentile_field, partition_field, percent) %}\n\n percentile_cont( \n {{ percentile_field }}, \n {{ percent }}) \n over (partition by {{ partition_field }} \n )\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481804.1331189, "supported_languages": null}, "macro.fivetran_utils.postgres__percentile": {"unique_id": "macro.fivetran_utils.postgres__percentile", "package_name": "fivetran_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/fivetran_utils", "path": "macros/percentile.sql", "original_file_path": "macros/percentile.sql", "name": "postgres__percentile", "macro_sql": "{% macro postgres__percentile(percentile_field, partition_field, percent) %}\n\n percentile_cont( \n {{ percent }} )\n within group ( order by {{ percentile_field }} )\n /* have to group by partition field */\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481804.1332579, "supported_languages": null}, "macro.fivetran_utils.spark__percentile": {"unique_id": "macro.fivetran_utils.spark__percentile", "package_name": "fivetran_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/fivetran_utils", "path": "macros/percentile.sql", "original_file_path": "macros/percentile.sql", "name": "spark__percentile", "macro_sql": "{% macro spark__percentile(percentile_field, partition_field, percent) %}\n\n percentile( \n {{ percentile_field }}, \n {{ percent }}) \n over (partition by {{ partition_field }} \n )\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481804.1334112, "supported_languages": null}, "macro.fivetran_utils.pivot_json_extract": {"unique_id": "macro.fivetran_utils.pivot_json_extract", "package_name": "fivetran_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/fivetran_utils", "path": "macros/pivot_json_extract.sql", "original_file_path": "macros/pivot_json_extract.sql", "name": "pivot_json_extract", "macro_sql": "{% macro pivot_json_extract(string, list_of_properties) %}\n\n{%- for property in list_of_properties -%}\n{%- if property is mapping -%}\nreplace( {{ fivetran_utils.json_extract(string, property.name) }}, '\"', '') as {{ property.alias if property.alias else property.name | replace(' ', '_') | replace('.', '_') | lower }}\n\n{%- else -%}\nreplace( {{ fivetran_utils.json_extract(string, property) }}, '\"', '') as {{ property | replace(' ', '_') | lower }}\n\n{%- endif -%}\n{%- if not loop.last -%},{%- endif %}\n{% endfor -%}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.fivetran_utils.json_extract"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481804.134261, "supported_languages": null}, "macro.fivetran_utils.persist_pass_through_columns": {"unique_id": "macro.fivetran_utils.persist_pass_through_columns", "package_name": "fivetran_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/fivetran_utils", "path": "macros/persist_pass_through_columns.sql", "original_file_path": "macros/persist_pass_through_columns.sql", "name": "persist_pass_through_columns", "macro_sql": "{% macro persist_pass_through_columns(pass_through_variable, identifier=none, transform='') %}\n\n{% if var(pass_through_variable, none) %}\n {% for field in var(pass_through_variable) %}\n , {{ transform ~ '(' ~ (identifier ~ '.' if identifier else '') ~ (field.alias if field.alias else field.name) ~ ')' }} as {{ field.alias if field.alias else field.name }}\n {% endfor %}\n{% endif %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481804.134954, "supported_languages": null}, "macro.fivetran_utils.json_parse": {"unique_id": "macro.fivetran_utils.json_parse", "package_name": "fivetran_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/fivetran_utils", "path": "macros/json_parse.sql", "original_file_path": "macros/json_parse.sql", "name": "json_parse", "macro_sql": "{% macro json_parse(string, string_path) -%}\n\n{{ adapter.dispatch('json_parse', 'fivetran_utils') (string, string_path) }}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.fivetran_utils.postgres__json_parse"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481804.1360252, "supported_languages": null}, "macro.fivetran_utils.default__json_parse": {"unique_id": "macro.fivetran_utils.default__json_parse", "package_name": "fivetran_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/fivetran_utils", "path": "macros/json_parse.sql", "original_file_path": "macros/json_parse.sql", "name": "default__json_parse", "macro_sql": "{% macro default__json_parse(string, string_path) %}\n\n json_extract_path_text({{string}}, {%- for s in string_path -%}'{{ s }}'{%- if not loop.last -%},{%- endif -%}{%- endfor -%} )\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481804.1362739, "supported_languages": null}, "macro.fivetran_utils.redshift__json_parse": {"unique_id": "macro.fivetran_utils.redshift__json_parse", "package_name": "fivetran_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/fivetran_utils", "path": "macros/json_parse.sql", "original_file_path": "macros/json_parse.sql", "name": "redshift__json_parse", "macro_sql": "{% macro redshift__json_parse(string, string_path) %}\n\n json_extract_path_text({{string}}, {%- for s in string_path -%}'{{ s }}'{%- if not loop.last -%},{%- endif -%}{%- endfor -%} )\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481804.1365151, "supported_languages": null}, "macro.fivetran_utils.bigquery__json_parse": {"unique_id": "macro.fivetran_utils.bigquery__json_parse", "package_name": "fivetran_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/fivetran_utils", "path": "macros/json_parse.sql", "original_file_path": "macros/json_parse.sql", "name": "bigquery__json_parse", "macro_sql": "{% macro bigquery__json_parse(string, string_path) %}\n\n \n json_extract_scalar({{string}}, '$.{%- for s in string_path -%}{{ s }}{%- if not loop.last -%}.{%- endif -%}{%- endfor -%} ')\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481804.1367471, "supported_languages": null}, "macro.fivetran_utils.postgres__json_parse": {"unique_id": "macro.fivetran_utils.postgres__json_parse", "package_name": "fivetran_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/fivetran_utils", "path": "macros/json_parse.sql", "original_file_path": "macros/json_parse.sql", "name": "postgres__json_parse", "macro_sql": "{% macro postgres__json_parse(string, string_path) %}\n\n {{string}}::json #>> '{ {%- for s in string_path -%}{{ s }}{%- if not loop.last -%},{%- endif -%}{%- endfor -%} }'\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481804.1369789, "supported_languages": null}, "macro.fivetran_utils.snowflake__json_parse": {"unique_id": "macro.fivetran_utils.snowflake__json_parse", "package_name": "fivetran_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/fivetran_utils", "path": "macros/json_parse.sql", "original_file_path": "macros/json_parse.sql", "name": "snowflake__json_parse", "macro_sql": "{% macro snowflake__json_parse(string, string_path) %}\n\n parse_json( {{string}} ) {%- for s in string_path -%}{% if s is number %}[{{ s }}]{% else %}['{{ s }}']{% endif %}{%- endfor -%}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481804.137234, "supported_languages": null}, "macro.fivetran_utils.spark__json_parse": {"unique_id": "macro.fivetran_utils.spark__json_parse", "package_name": "fivetran_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/fivetran_utils", "path": "macros/json_parse.sql", "original_file_path": "macros/json_parse.sql", "name": "spark__json_parse", "macro_sql": "{% macro spark__json_parse(string, string_path) %}\n\n {{string}} : {%- for s in string_path -%}{% if s is number %}[{{ s }}]{% else %}['{{ s }}']{% endif %}{%- endfor -%}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481804.1374872, "supported_languages": null}, "macro.fivetran_utils.max_bool": {"unique_id": "macro.fivetran_utils.max_bool", "package_name": "fivetran_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/fivetran_utils", "path": "macros/max_bool.sql", "original_file_path": "macros/max_bool.sql", "name": "max_bool", "macro_sql": "{% macro max_bool(boolean_field) -%}\n\n{{ adapter.dispatch('max_bool', 'fivetran_utils') (boolean_field) }}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.fivetran_utils.default__max_bool"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481804.137873, "supported_languages": null}, "macro.fivetran_utils.default__max_bool": {"unique_id": "macro.fivetran_utils.default__max_bool", "package_name": "fivetran_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/fivetran_utils", "path": "macros/max_bool.sql", "original_file_path": "macros/max_bool.sql", "name": "default__max_bool", "macro_sql": "{% macro default__max_bool(boolean_field) %}\n\n bool_or( {{ boolean_field }} )\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481804.137974, "supported_languages": null}, "macro.fivetran_utils.snowflake__max_bool": {"unique_id": "macro.fivetran_utils.snowflake__max_bool", "package_name": "fivetran_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/fivetran_utils", "path": "macros/max_bool.sql", "original_file_path": "macros/max_bool.sql", "name": "snowflake__max_bool", "macro_sql": "{% macro snowflake__max_bool(boolean_field) %}\n\n max( {{ boolean_field }} )\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481804.1380732, "supported_languages": null}, "macro.fivetran_utils.bigquery__max_bool": {"unique_id": "macro.fivetran_utils.bigquery__max_bool", "package_name": "fivetran_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/fivetran_utils", "path": "macros/max_bool.sql", "original_file_path": "macros/max_bool.sql", "name": "bigquery__max_bool", "macro_sql": "{% macro bigquery__max_bool(boolean_field) %}\n\n max( {{ boolean_field }} )\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481804.1382332, "supported_languages": null}, "macro.fivetran_utils.calculated_fields": {"unique_id": "macro.fivetran_utils.calculated_fields", "package_name": "fivetran_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/fivetran_utils", "path": "macros/calculated_fields.sql", "original_file_path": "macros/calculated_fields.sql", "name": "calculated_fields", "macro_sql": "{% macro calculated_fields(variable) -%}\n\n{% if var(variable, none) %}\n {% for field in var(variable) %}\n , {{ field.transform_sql }} as {{ field.name }} \n {% endfor %}\n{% endif %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481804.138879, "supported_languages": null}, "macro.fivetran_utils.seed_data_helper": {"unique_id": "macro.fivetran_utils.seed_data_helper", "package_name": "fivetran_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/fivetran_utils", "path": "macros/seed_data_helper.sql", "original_file_path": "macros/seed_data_helper.sql", "name": "seed_data_helper", "macro_sql": "{% macro seed_data_helper(seed_name, warehouses) %}\n\n{% if target.type in warehouses %}\n {% for w in warehouses %}\n {% if target.type == w %}\n {{ return(ref(seed_name ~ \"_\" ~ w ~ \"\")) }}\n {% endif %}\n {% endfor %}\n{% else %}\n{{ return(ref(seed_name)) }}\n{% endif %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481804.139605, "supported_languages": null}, "macro.fivetran_utils.fill_pass_through_columns": {"unique_id": "macro.fivetran_utils.fill_pass_through_columns", "package_name": "fivetran_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/fivetran_utils", "path": "macros/fill_pass_through_columns.sql", "original_file_path": "macros/fill_pass_through_columns.sql", "name": "fill_pass_through_columns", "macro_sql": "{% macro fill_pass_through_columns(pass_through_variable) %}\n\n{% if var(pass_through_variable) %}\n {% for field in var(pass_through_variable) %}\n {% if field is mapping %}\n {% if field.transform_sql %}\n , {{ field.transform_sql }} as {{ field.alias if field.alias else field.name }}\n {% else %}\n , {{ field.alias if field.alias else field.name }}\n {% endif %}\n {% else %}\n , {{ field }}\n {% endif %}\n {% endfor %}\n{% endif %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481804.140586, "supported_languages": null}, "macro.fivetran_utils.string_agg": {"unique_id": "macro.fivetran_utils.string_agg", "package_name": "fivetran_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/fivetran_utils", "path": "macros/string_agg.sql", "original_file_path": "macros/string_agg.sql", "name": "string_agg", "macro_sql": "{% macro string_agg(field_to_agg, delimiter) -%}\n\n{{ adapter.dispatch('string_agg', 'fivetran_utils') (field_to_agg, delimiter) }}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.fivetran_utils.default__string_agg"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481804.1412249, "supported_languages": null}, "macro.fivetran_utils.default__string_agg": {"unique_id": "macro.fivetran_utils.default__string_agg", "package_name": "fivetran_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/fivetran_utils", "path": "macros/string_agg.sql", "original_file_path": "macros/string_agg.sql", "name": "default__string_agg", "macro_sql": "{% macro default__string_agg(field_to_agg, delimiter) %}\n string_agg({{ field_to_agg }}, {{ delimiter }})\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481804.141367, "supported_languages": null}, "macro.fivetran_utils.snowflake__string_agg": {"unique_id": "macro.fivetran_utils.snowflake__string_agg", "package_name": "fivetran_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/fivetran_utils", "path": "macros/string_agg.sql", "original_file_path": "macros/string_agg.sql", "name": "snowflake__string_agg", "macro_sql": "{% macro snowflake__string_agg(field_to_agg, delimiter) %}\n listagg({{ field_to_agg }}, {{ delimiter }})\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481804.141501, "supported_languages": null}, "macro.fivetran_utils.redshift__string_agg": {"unique_id": "macro.fivetran_utils.redshift__string_agg", "package_name": "fivetran_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/fivetran_utils", "path": "macros/string_agg.sql", "original_file_path": "macros/string_agg.sql", "name": "redshift__string_agg", "macro_sql": "{% macro redshift__string_agg(field_to_agg, delimiter) %}\n listagg({{ field_to_agg }}, {{ delimiter }})\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481804.1416278, "supported_languages": null}, "macro.fivetran_utils.spark__string_agg": {"unique_id": "macro.fivetran_utils.spark__string_agg", "package_name": "fivetran_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/fivetran_utils", "path": "macros/string_agg.sql", "original_file_path": "macros/string_agg.sql", "name": "spark__string_agg", "macro_sql": "{% macro spark__string_agg(field_to_agg, delimiter) %}\n -- collect set will remove duplicates\n replace(replace(replace(cast( collect_set({{ field_to_agg }}) as string), '[', ''), ']', ''), ', ', {{ delimiter }} )\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481804.141758, "supported_languages": null}, "macro.fivetran_utils.timestamp_diff": {"unique_id": "macro.fivetran_utils.timestamp_diff", "package_name": "fivetran_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/fivetran_utils", "path": "macros/timestamp_diff.sql", "original_file_path": "macros/timestamp_diff.sql", "name": "timestamp_diff", "macro_sql": "{% macro timestamp_diff(first_date, second_date, datepart) %}\n {{ adapter.dispatch('timestamp_diff', 'fivetran_utils')(first_date, second_date, datepart) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.fivetran_utils.postgres__timestamp_diff"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481804.144484, "supported_languages": null}, "macro.fivetran_utils.default__timestamp_diff": {"unique_id": "macro.fivetran_utils.default__timestamp_diff", "package_name": "fivetran_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/fivetran_utils", "path": "macros/timestamp_diff.sql", "original_file_path": "macros/timestamp_diff.sql", "name": "default__timestamp_diff", "macro_sql": "{% macro default__timestamp_diff(first_date, second_date, datepart) %}\n\n datediff(\n {{ datepart }},\n {{ first_date }},\n {{ second_date }}\n )\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481804.1446478, "supported_languages": null}, "macro.fivetran_utils.redshift__timestamp_diff": {"unique_id": "macro.fivetran_utils.redshift__timestamp_diff", "package_name": "fivetran_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/fivetran_utils", "path": "macros/timestamp_diff.sql", "original_file_path": "macros/timestamp_diff.sql", "name": "redshift__timestamp_diff", "macro_sql": "{% macro redshift__timestamp_diff(first_date, second_date, datepart) %}\n\n datediff(\n {{ datepart }},\n {{ first_date }},\n {{ second_date }}\n )\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481804.1448011, "supported_languages": null}, "macro.fivetran_utils.bigquery__timestamp_diff": {"unique_id": "macro.fivetran_utils.bigquery__timestamp_diff", "package_name": "fivetran_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/fivetran_utils", "path": "macros/timestamp_diff.sql", "original_file_path": "macros/timestamp_diff.sql", "name": "bigquery__timestamp_diff", "macro_sql": "{% macro bigquery__timestamp_diff(first_date, second_date, datepart) %}\n\n timestamp_diff(\n {{second_date}},\n {{first_date}},\n {{datepart}}\n )\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481804.1449559, "supported_languages": null}, "macro.fivetran_utils.postgres__timestamp_diff": {"unique_id": "macro.fivetran_utils.postgres__timestamp_diff", "package_name": "fivetran_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/fivetran_utils", "path": "macros/timestamp_diff.sql", "original_file_path": "macros/timestamp_diff.sql", "name": "postgres__timestamp_diff", "macro_sql": "{% macro postgres__timestamp_diff(first_date, second_date, datepart) %}\n\n {% if datepart == 'year' %}\n (date_part('year', ({{second_date}})::date) - date_part('year', ({{first_date}})::date))\n {% elif datepart == 'quarter' %}\n ({{ dbt.datediff(first_date, second_date, 'year') }} * 4 + date_part('quarter', ({{second_date}})::date) - date_part('quarter', ({{first_date}})::date))\n {% elif datepart == 'month' %}\n ({{ dbt.datediff(first_date, second_date, 'year') }} * 12 + date_part('month', ({{second_date}})::date) - date_part('month', ({{first_date}})::date))\n {% elif datepart == 'day' %}\n (({{second_date}})::date - ({{first_date}})::date)\n {% elif datepart == 'week' %}\n ({{ dbt.datediff(first_date, second_date, 'day') }} / 7 + case\n when date_part('dow', ({{first_date}})::timestamp) <= date_part('dow', ({{second_date}})::timestamp) then\n case when {{first_date}} <= {{second_date}} then 0 else -1 end\n else\n case when {{first_date}} <= {{second_date}} then 1 else 0 end\n end)\n {% elif datepart == 'hour' %}\n ({{ dbt.datediff(first_date, second_date, 'day') }} * 24 + date_part('hour', ({{second_date}})::timestamp) - date_part('hour', ({{first_date}})::timestamp))\n {% elif datepart == 'minute' %}\n ({{ dbt.datediff(first_date, second_date, 'hour') }} * 60 + date_part('minute', ({{second_date}})::timestamp) - date_part('minute', ({{first_date}})::timestamp))\n {% elif datepart == 'second' %}\n ({{ dbt.datediff(first_date, second_date, 'minute') }} * 60 + floor(date_part('second', ({{second_date}})::timestamp)) - floor(date_part('second', ({{first_date}})::timestamp)))\n {% elif datepart == 'millisecond' %}\n ({{ dbt.datediff(first_date, second_date, 'minute') }} * 60000 + floor(date_part('millisecond', ({{second_date}})::timestamp)) - floor(date_part('millisecond', ({{first_date}})::timestamp)))\n {% elif datepart == 'microsecond' %}\n ({{ dbt.datediff(first_date, second_date, 'minute') }} * 60000000 + floor(date_part('microsecond', ({{second_date}})::timestamp)) - floor(date_part('microsecond', ({{first_date}})::timestamp)))\n {% else %}\n {{ exceptions.raise_compiler_error(\"Unsupported datepart for macro datediff in postgres: {!r}\".format(datepart)) }}\n {% endif %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.datediff"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481804.146654, "supported_languages": null}, "macro.fivetran_utils.try_cast": {"unique_id": "macro.fivetran_utils.try_cast", "package_name": "fivetran_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/fivetran_utils", "path": "macros/try_cast.sql", "original_file_path": "macros/try_cast.sql", "name": "try_cast", "macro_sql": "{% macro try_cast(field, type) %}\n {{ adapter.dispatch('try_cast', 'fivetran_utils') (field, type) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.fivetran_utils.postgres__try_cast"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481804.1475341, "supported_languages": null}, "macro.fivetran_utils.default__safe_cast": {"unique_id": "macro.fivetran_utils.default__safe_cast", "package_name": "fivetran_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/fivetran_utils", "path": "macros/try_cast.sql", "original_file_path": "macros/try_cast.sql", "name": "default__safe_cast", "macro_sql": "{% macro default__safe_cast(field, type) %}\n {# most databases don't support this function yet\n so we just need to use cast #}\n cast({{field}} as {{type}})\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481804.147671, "supported_languages": null}, "macro.fivetran_utils.redshift__try_cast": {"unique_id": "macro.fivetran_utils.redshift__try_cast", "package_name": "fivetran_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/fivetran_utils", "path": "macros/try_cast.sql", "original_file_path": "macros/try_cast.sql", "name": "redshift__try_cast", "macro_sql": "{% macro redshift__try_cast(field, type) %}\n{%- if type == 'numeric' -%}\n\n case\n when trim({{field}}) ~ '^(0|[1-9][0-9]*)$' then trim({{field}})\n else null\n end::{{type}}\n\n{% else %}\n {{ exceptions.raise_compiler_error(\n \"non-numeric datatypes are not currently supported\") }}\n\n{% endif %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481804.147938, "supported_languages": null}, "macro.fivetran_utils.postgres__try_cast": {"unique_id": "macro.fivetran_utils.postgres__try_cast", "package_name": "fivetran_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/fivetran_utils", "path": "macros/try_cast.sql", "original_file_path": "macros/try_cast.sql", "name": "postgres__try_cast", "macro_sql": "{% macro postgres__try_cast(field, type) %}\n{%- if type == 'numeric' -%}\n\n case\n when replace(cast({{field}} as varchar),cast(' ' as varchar),cast('' as varchar)) ~ '^(0|[1-9][0-9]*)$' \n then replace(cast({{field}} as varchar),cast(' ' as varchar),cast('' as varchar))\n else null\n end::{{type}}\n\n{% else %}\n {{ exceptions.raise_compiler_error(\n \"non-numeric datatypes are not currently supported\") }}\n\n{% endif %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481804.1482172, "supported_languages": null}, "macro.fivetran_utils.snowflake__try_cast": {"unique_id": "macro.fivetran_utils.snowflake__try_cast", "package_name": "fivetran_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/fivetran_utils", "path": "macros/try_cast.sql", "original_file_path": "macros/try_cast.sql", "name": "snowflake__try_cast", "macro_sql": "{% macro snowflake__try_cast(field, type) %}\n try_cast(cast({{field}} as varchar) as {{type}})\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481804.1484, "supported_languages": null}, "macro.fivetran_utils.bigquery__try_cast": {"unique_id": "macro.fivetran_utils.bigquery__try_cast", "package_name": "fivetran_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/fivetran_utils", "path": "macros/try_cast.sql", "original_file_path": "macros/try_cast.sql", "name": "bigquery__try_cast", "macro_sql": "{% macro bigquery__try_cast(field, type) %}\n safe_cast({{field}} as {{type}})\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481804.1485598, "supported_languages": null}, "macro.fivetran_utils.spark__try_cast": {"unique_id": "macro.fivetran_utils.spark__try_cast", "package_name": "fivetran_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/fivetran_utils", "path": "macros/try_cast.sql", "original_file_path": "macros/try_cast.sql", "name": "spark__try_cast", "macro_sql": "{% macro spark__try_cast(field, type) %}\n try_cast({{field}} as {{type}})\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481804.148702, "supported_languages": null}, "macro.fivetran_utils.source_relation": {"unique_id": "macro.fivetran_utils.source_relation", "package_name": "fivetran_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/fivetran_utils", "path": "macros/source_relation.sql", "original_file_path": "macros/source_relation.sql", "name": "source_relation", "macro_sql": "{% macro source_relation(union_schema_variable='union_schemas', union_database_variable='union_databases') -%}\n\n{{ adapter.dispatch('source_relation', 'fivetran_utils') (union_schema_variable, union_database_variable) }}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.fivetran_utils.default__source_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481804.1493492, "supported_languages": null}, "macro.fivetran_utils.default__source_relation": {"unique_id": "macro.fivetran_utils.default__source_relation", "package_name": "fivetran_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/fivetran_utils", "path": "macros/source_relation.sql", "original_file_path": "macros/source_relation.sql", "name": "default__source_relation", "macro_sql": "{% macro default__source_relation(union_schema_variable, union_database_variable) %}\n\n{% if var(union_schema_variable, none) %}\n, case\n {% for schema in var(union_schema_variable) %}\n when lower(replace(replace(_dbt_source_relation,'\"',''),'`','')) like '%.{{ schema|lower }}.%' then '{{ schema|lower }}'\n {% endfor %}\n end as source_relation\n{% elif var(union_database_variable, none) %}\n, case\n {% for database in var(union_database_variable) %}\n when lower(replace(replace(_dbt_source_relation,'\"',''),'`','')) like '%{{ database|lower }}.%' then '{{ database|lower }}'\n {% endfor %}\n end as source_relation\n{% else %}\n, cast('' as {{ dbt.type_string() }}) as source_relation\n{% endif %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.type_string"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481804.1499772, "supported_languages": null}, "macro.fivetran_utils.first_value": {"unique_id": "macro.fivetran_utils.first_value", "package_name": "fivetran_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/fivetran_utils", "path": "macros/first_value.sql", "original_file_path": "macros/first_value.sql", "name": "first_value", "macro_sql": "{% macro first_value(first_value_field, partition_field, order_by_field, order=\"asc\") -%}\n\n{{ adapter.dispatch('first_value', 'fivetran_utils') (first_value_field, partition_field, order_by_field, order) }}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.fivetran_utils.default__first_value"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481804.150557, "supported_languages": null}, "macro.fivetran_utils.default__first_value": {"unique_id": "macro.fivetran_utils.default__first_value", "package_name": "fivetran_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/fivetran_utils", "path": "macros/first_value.sql", "original_file_path": "macros/first_value.sql", "name": "default__first_value", "macro_sql": "{% macro default__first_value(first_value_field, partition_field, order_by_field, order=\"asc\") %}\n\n first_value( {{ first_value_field }} ignore nulls ) over (partition by {{ partition_field }} order by {{ order_by_field }} {{ order }} )\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481804.15077, "supported_languages": null}, "macro.fivetran_utils.redshift__first_value": {"unique_id": "macro.fivetran_utils.redshift__first_value", "package_name": "fivetran_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/fivetran_utils", "path": "macros/first_value.sql", "original_file_path": "macros/first_value.sql", "name": "redshift__first_value", "macro_sql": "{% macro redshift__first_value(first_value_field, partition_field, order_by_field, order=\"asc\") %}\n\n first_value( {{ first_value_field }} ignore nulls ) over (partition by {{ partition_field }} order by {{ order_by_field }} {{ order }} , {{ partition_field }} rows unbounded preceding )\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481804.1509929, "supported_languages": null}, "macro.fivetran_utils.add_dbt_source_relation": {"unique_id": "macro.fivetran_utils.add_dbt_source_relation", "package_name": "fivetran_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/fivetran_utils", "path": "macros/add_dbt_source_relation.sql", "original_file_path": "macros/add_dbt_source_relation.sql", "name": "add_dbt_source_relation", "macro_sql": "{% macro add_dbt_source_relation() %}\n\n{% if var('union_schemas', none) or var('union_databases', none) %}\n, _dbt_source_relation\n{% endif %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481804.151328, "supported_languages": null}, "macro.fivetran_utils.add_pass_through_columns": {"unique_id": "macro.fivetran_utils.add_pass_through_columns", "package_name": "fivetran_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/fivetran_utils", "path": "macros/add_pass_through_columns.sql", "original_file_path": "macros/add_pass_through_columns.sql", "name": "add_pass_through_columns", "macro_sql": "{% macro add_pass_through_columns(base_columns, pass_through_var) %}\n\n {% if pass_through_var %}\n\n {% for column in pass_through_var %}\n\n {% if column is mapping %}\n\n {% if column.alias %}\n\n {% do base_columns.append({ \"name\": column.name, \"alias\": column.alias, \"datatype\": column.datatype if column.datatype else dbt.type_string()}) %}\n\n {% else %}\n\n {% do base_columns.append({ \"name\": column.name, \"datatype\": column.datatype if column.datatype else dbt.type_string()}) %}\n \n {% endif %}\n\n {% else %}\n\n {% do base_columns.append({ \"name\": column, \"datatype\": dbt.type_string()}) %}\n\n {% endif %}\n\n {% endfor %}\n\n {% endif %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.type_string"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481804.152534, "supported_languages": null}, "macro.fivetran_utils.union_relations": {"unique_id": "macro.fivetran_utils.union_relations", "package_name": "fivetran_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/fivetran_utils", "path": "macros/union_relations.sql", "original_file_path": "macros/union_relations.sql", "name": "union_relations", "macro_sql": "{%- macro union_relations(relations, aliases=none, column_override=none, include=[], exclude=[], source_column_name=none) -%}\n\n {%- if exclude and include -%}\n {{ exceptions.raise_compiler_error(\"Both an exclude and include list were provided to the `union` macro. Only one is allowed\") }}\n {%- endif -%}\n\n {#-- Prevent querying of db in parsing mode. This works because this macro does not create any new refs. -#}\n {%- if not execute %}\n {{ return('') }}\n {% endif -%}\n\n {%- set column_override = column_override if column_override is not none else {} -%}\n {%- set source_column_name = source_column_name if source_column_name is not none else '_dbt_source_relation' -%}\n\n {%- set relation_columns = {} -%}\n {%- set column_superset = {} -%}\n\n {%- for relation in relations -%}\n\n {%- do relation_columns.update({relation: []}) -%}\n\n {%- do dbt_utils._is_relation(relation, 'union_relations') -%}\n {%- set cols = adapter.get_columns_in_relation(relation) -%}\n {%- for col in cols -%}\n\n {#- If an exclude list was provided and the column is in the list, do nothing -#}\n {%- if exclude and col.column in exclude -%}\n\n {#- If an include list was provided and the column is not in the list, do nothing -#}\n {%- elif include and col.column not in include -%}\n\n {#- Otherwise add the column to the column superset -#}\n {%- else -%}\n\n {#- update the list of columns in this relation -#}\n {%- do relation_columns[relation].append(col.column) -%}\n\n {%- if col.column in column_superset -%}\n\n {%- set stored = column_superset[col.column] -%}\n {%- if col.is_string() and stored.is_string() and col.string_size() > stored.string_size() -%}\n\n {%- do column_superset.update({col.column: col}) -%}\n\n {%- endif %}\n\n {%- else -%}\n\n {%- do column_superset.update({col.column: col}) -%}\n\n {%- endif -%}\n\n {%- endif -%}\n\n {%- endfor -%}\n {%- endfor -%}\n\n {%- set ordered_column_names = column_superset.keys() -%}\n\n {%- for relation in relations %}\n\n (\n select\n\n cast({{ dbt.string_literal(relation) }} as {{ dbt.type_string() }}) as {{ source_column_name }},\n {% for col_name in ordered_column_names -%}\n\n {%- set col = column_superset[col_name] %}\n {%- set col_type = column_override.get(col.column, col.data_type) %}\n {%- set col_name = adapter.quote(col_name) if col_name in relation_columns[relation] else 'null' %}\n cast({{ col_name }} as {{ col_type }}) as {{ col.quoted }} {% if not loop.last %},{% endif -%}\n\n {%- endfor %}\n\n from {{ aliases[loop.index0] if aliases else relation }}\n )\n\n {% if not loop.last -%}\n union all\n {% endif -%}\n\n {%- endfor -%}\n\n{%- endmacro -%}\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils._is_relation", "macro.dbt.string_literal", "macro.dbt.type_string"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481804.156617, "supported_languages": null}, "macro.fivetran_utils.union_tables": {"unique_id": "macro.fivetran_utils.union_tables", "package_name": "fivetran_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/fivetran_utils", "path": "macros/union_relations.sql", "original_file_path": "macros/union_relations.sql", "name": "union_tables", "macro_sql": "{%- macro union_tables(tables, column_override=none, include=[], exclude=[], source_column_name='_dbt_source_table') -%}\n\n {%- do exceptions.warn(\"Warning: the `union_tables` macro is no longer supported and will be deprecated in a future release of dbt-utils. Use the `union_relations` macro instead\") -%}\n\n {{ return(dbt_utils.union_relations(tables, column_override, include, exclude, source_column_name)) }}\n\n{%- endmacro -%}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.union_relations"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481804.156985, "supported_languages": null}, "macro.fivetran_utils.snowflake_seed_data": {"unique_id": "macro.fivetran_utils.snowflake_seed_data", "package_name": "fivetran_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/fivetran_utils", "path": "macros/snowflake_seed_data.sql", "original_file_path": "macros/snowflake_seed_data.sql", "name": "snowflake_seed_data", "macro_sql": "{% macro snowflake_seed_data(seed_name) %}\n\n{% if target.type == 'snowflake' %}\n{{ return(ref(seed_name ~ '_snowflake')) }}\n{% else %}\n{{ return(ref(seed_name)) }}\n{% endif %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481804.1574621, "supported_languages": null}, "macro.fivetran_utils.fill_staging_columns": {"unique_id": "macro.fivetran_utils.fill_staging_columns", "package_name": "fivetran_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/fivetran_utils", "path": "macros/fill_staging_columns.sql", "original_file_path": "macros/fill_staging_columns.sql", "name": "fill_staging_columns", "macro_sql": "{% macro fill_staging_columns(source_columns, staging_columns) -%}\n\n{%- set source_column_names = source_columns|map(attribute='name')|map('lower')|list -%}\n\n{%- for column in staging_columns %}\n {% if column.name|lower in source_column_names -%}\n {{ fivetran_utils.quote_column(column) }} as \n {%- if 'alias' in column %} {{ column.alias }} {% else %} {{ fivetran_utils.quote_column(column) }} {%- endif -%}\n {%- else -%}\n cast(null as {{ column.datatype }})\n {%- if 'alias' in column %} as {{ column.alias }} {% else %} as {{ fivetran_utils.quote_column(column) }} {% endif -%}\n {%- endif -%}\n {%- if not loop.last -%} , {% endif -%}\n{% endfor %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.fivetran_utils.quote_column"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481804.159085, "supported_languages": null}, "macro.fivetran_utils.quote_column": {"unique_id": "macro.fivetran_utils.quote_column", "package_name": "fivetran_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/fivetran_utils", "path": "macros/fill_staging_columns.sql", "original_file_path": "macros/fill_staging_columns.sql", "name": "quote_column", "macro_sql": "{% macro quote_column(column) %}\n {% if 'quote' in column %}\n {% if column.quote %}\n {% if target.type in ('bigquery', 'spark') %}\n `{{ column.name }}`\n {% elif target.type == 'snowflake' %}\n \"{{ column.name | upper }}\"\n {% else %}\n \"{{ column.name }}\"\n {% endif %}\n {% else %}\n {{ column.name }}\n {% endif %}\n {% else %}\n {{ column.name }}\n {% endif %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481804.159667, "supported_languages": null}, "macro.fivetran_utils.json_extract": {"unique_id": "macro.fivetran_utils.json_extract", "package_name": "fivetran_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/fivetran_utils", "path": "macros/json_extract.sql", "original_file_path": "macros/json_extract.sql", "name": "json_extract", "macro_sql": "{% macro json_extract(string, string_path) -%}\n\n{{ adapter.dispatch('json_extract', 'fivetran_utils') (string, string_path) }}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.fivetran_utils.postgres__json_extract"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481804.160397, "supported_languages": null}, "macro.fivetran_utils.default__json_extract": {"unique_id": "macro.fivetran_utils.default__json_extract", "package_name": "fivetran_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/fivetran_utils", "path": "macros/json_extract.sql", "original_file_path": "macros/json_extract.sql", "name": "default__json_extract", "macro_sql": "{% macro default__json_extract(string, string_path) %}\n\n json_extract_path_text({{string}}, {{ \"'\" ~ string_path ~ \"'\" }} )\n \n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481804.160566, "supported_languages": null}, "macro.fivetran_utils.snowflake__json_extract": {"unique_id": "macro.fivetran_utils.snowflake__json_extract", "package_name": "fivetran_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/fivetran_utils", "path": "macros/json_extract.sql", "original_file_path": "macros/json_extract.sql", "name": "snowflake__json_extract", "macro_sql": "{% macro snowflake__json_extract(string, string_path) %}\n\n json_extract_path_text(try_parse_json( {{string}} ), {{ \"'\" ~ string_path ~ \"'\" }} )\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481804.1607208, "supported_languages": null}, "macro.fivetran_utils.redshift__json_extract": {"unique_id": "macro.fivetran_utils.redshift__json_extract", "package_name": "fivetran_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/fivetran_utils", "path": "macros/json_extract.sql", "original_file_path": "macros/json_extract.sql", "name": "redshift__json_extract", "macro_sql": "{% macro redshift__json_extract(string, string_path) %}\n\n case when is_valid_json( {{string}} ) then json_extract_path_text({{string}}, {{ \"'\" ~ string_path ~ \"'\" }} ) else null end\n \n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481804.160892, "supported_languages": null}, "macro.fivetran_utils.bigquery__json_extract": {"unique_id": "macro.fivetran_utils.bigquery__json_extract", "package_name": "fivetran_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/fivetran_utils", "path": "macros/json_extract.sql", "original_file_path": "macros/json_extract.sql", "name": "bigquery__json_extract", "macro_sql": "{% macro bigquery__json_extract(string, string_path) %}\n\n json_extract_scalar({{string}}, {{ \"'$.\" ~ string_path ~ \"'\" }} )\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481804.1610482, "supported_languages": null}, "macro.fivetran_utils.postgres__json_extract": {"unique_id": "macro.fivetran_utils.postgres__json_extract", "package_name": "fivetran_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/fivetran_utils", "path": "macros/json_extract.sql", "original_file_path": "macros/json_extract.sql", "name": "postgres__json_extract", "macro_sql": "{% macro postgres__json_extract(string, string_path) %}\n\n {{string}}::json->>{{\"'\" ~ string_path ~ \"'\" }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481804.161196, "supported_languages": null}, "macro.fivetran_utils.collect_freshness": {"unique_id": "macro.fivetran_utils.collect_freshness", "package_name": "fivetran_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/fivetran_utils", "path": "macros/collect_freshness.sql", "original_file_path": "macros/collect_freshness.sql", "name": "collect_freshness", "macro_sql": "{% macro collect_freshness(source, loaded_at_field, filter) %}\n {{ return(adapter.dispatch('collect_freshness')(source, loaded_at_field, filter))}}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.fivetran_utils.default__collect_freshness"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481804.162011, "supported_languages": null}, "macro.fivetran_utils.default__collect_freshness": {"unique_id": "macro.fivetran_utils.default__collect_freshness", "package_name": "fivetran_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/fivetran_utils", "path": "macros/collect_freshness.sql", "original_file_path": "macros/collect_freshness.sql", "name": "default__collect_freshness", "macro_sql": "{% macro default__collect_freshness(source, loaded_at_field, filter) %}\n {% call statement('collect_freshness', fetch_result=True, auto_begin=False) -%}\n\n {%- set enabled_array = [] -%}\n {% for node in graph.sources.values() %}\n {% if node.identifier == source.identifier %}\n {% if (node.meta['is_enabled'] | default(true)) %}\n {%- do enabled_array.append(1) -%}\n {% endif %}\n {% endif %}\n {% endfor %}\n {% set is_enabled = (enabled_array != []) %}\n\n select\n {% if is_enabled %}\n max({{ loaded_at_field }})\n {% else %} \n {{ current_timestamp() }} {% endif %} as max_loaded_at,\n {{ current_timestamp() }} as snapshotted_at\n\n {% if is_enabled %}\n from {{ source }}\n {% if filter %}\n where {{ filter }}\n {% endif %}\n {% endif %}\n\n {% endcall %}\n {{ return(load_result('collect_freshness').table) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.statement", "macro.dbt.current_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481804.163033, "supported_languages": null}, "macro.fivetran_utils.timestamp_add": {"unique_id": "macro.fivetran_utils.timestamp_add", "package_name": "fivetran_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/fivetran_utils", "path": "macros/timestamp_add.sql", "original_file_path": "macros/timestamp_add.sql", "name": "timestamp_add", "macro_sql": "{% macro timestamp_add(datepart, interval, from_timestamp) -%}\n\n{{ adapter.dispatch('timestamp_add', 'fivetran_utils') (datepart, interval, from_timestamp) }}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.fivetran_utils.postgres__timestamp_add"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481804.163828, "supported_languages": null}, "macro.fivetran_utils.default__timestamp_add": {"unique_id": "macro.fivetran_utils.default__timestamp_add", "package_name": "fivetran_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/fivetran_utils", "path": "macros/timestamp_add.sql", "original_file_path": "macros/timestamp_add.sql", "name": "default__timestamp_add", "macro_sql": "{% macro default__timestamp_add(datepart, interval, from_timestamp) %}\n\n timestampadd(\n {{ datepart }},\n {{ interval }},\n {{ from_timestamp }}\n )\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481804.164001, "supported_languages": null}, "macro.fivetran_utils.bigquery__timestamp_add": {"unique_id": "macro.fivetran_utils.bigquery__timestamp_add", "package_name": "fivetran_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/fivetran_utils", "path": "macros/timestamp_add.sql", "original_file_path": "macros/timestamp_add.sql", "name": "bigquery__timestamp_add", "macro_sql": "{% macro bigquery__timestamp_add(datepart, interval, from_timestamp) %}\n\n timestamp_add({{ from_timestamp }}, interval {{ interval }} {{ datepart }})\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481804.164165, "supported_languages": null}, "macro.fivetran_utils.redshift__timestamp_add": {"unique_id": "macro.fivetran_utils.redshift__timestamp_add", "package_name": "fivetran_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/fivetran_utils", "path": "macros/timestamp_add.sql", "original_file_path": "macros/timestamp_add.sql", "name": "redshift__timestamp_add", "macro_sql": "{% macro redshift__timestamp_add(datepart, interval, from_timestamp) %}\n\n dateadd(\n {{ datepart }},\n {{ interval }},\n {{ from_timestamp }}\n )\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481804.164332, "supported_languages": null}, "macro.fivetran_utils.postgres__timestamp_add": {"unique_id": "macro.fivetran_utils.postgres__timestamp_add", "package_name": "fivetran_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/fivetran_utils", "path": "macros/timestamp_add.sql", "original_file_path": "macros/timestamp_add.sql", "name": "postgres__timestamp_add", "macro_sql": "{% macro postgres__timestamp_add(datepart, interval, from_timestamp) %}\n\n {{ from_timestamp }} + ((interval '1 {{ datepart }}') * ({{ interval }}))\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481804.164497, "supported_languages": null}, "macro.fivetran_utils.spark__timestamp_add": {"unique_id": "macro.fivetran_utils.spark__timestamp_add", "package_name": "fivetran_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/fivetran_utils", "path": "macros/timestamp_add.sql", "original_file_path": "macros/timestamp_add.sql", "name": "spark__timestamp_add", "macro_sql": "{% macro spark__timestamp_add(datepart, interval, from_timestamp) %}\n\n {{ dbt.dateadd(datepart, interval, from_timestamp) }}\n \n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.dateadd"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481804.164675, "supported_languages": null}, "macro.fivetran_utils.ceiling": {"unique_id": "macro.fivetran_utils.ceiling", "package_name": "fivetran_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/fivetran_utils", "path": "macros/ceiling.sql", "original_file_path": "macros/ceiling.sql", "name": "ceiling", "macro_sql": "{% macro ceiling(num) -%}\n\n{{ adapter.dispatch('ceiling', 'fivetran_utils') (num) }}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.fivetran_utils.default__ceiling"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481804.165029, "supported_languages": null}, "macro.fivetran_utils.default__ceiling": {"unique_id": "macro.fivetran_utils.default__ceiling", "package_name": "fivetran_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/fivetran_utils", "path": "macros/ceiling.sql", "original_file_path": "macros/ceiling.sql", "name": "default__ceiling", "macro_sql": "{% macro default__ceiling(num) %}\n ceiling({{ num }})\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481804.165139, "supported_languages": null}, "macro.fivetran_utils.snowflake__ceiling": {"unique_id": "macro.fivetran_utils.snowflake__ceiling", "package_name": "fivetran_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/fivetran_utils", "path": "macros/ceiling.sql", "original_file_path": "macros/ceiling.sql", "name": "snowflake__ceiling", "macro_sql": "{% macro snowflake__ceiling(num) %}\n ceil({{ num }})\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481804.16532, "supported_languages": null}, "macro.fivetran_utils.remove_prefix_from_columns": {"unique_id": "macro.fivetran_utils.remove_prefix_from_columns", "package_name": "fivetran_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/fivetran_utils", "path": "macros/remove_prefix_from_columns.sql", "original_file_path": "macros/remove_prefix_from_columns.sql", "name": "remove_prefix_from_columns", "macro_sql": "{% macro remove_prefix_from_columns(columns, prefix='', exclude=[]) %}\n\n {%- for col in columns if col.name not in exclude -%}\n {%- if col.name[:prefix|length]|lower == prefix -%}\n {{ col.name }} as {{ col.name[prefix|length:] }}\n {%- else -%}\n {{ col.name }}\n {%- endif -%}\n {%- if not loop.last -%},{%- endif %}\n {% endfor -%}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481804.166055, "supported_languages": null}, "macro.fivetran_utils.union_data": {"unique_id": "macro.fivetran_utils.union_data", "package_name": "fivetran_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/fivetran_utils", "path": "macros/union_data.sql", "original_file_path": "macros/union_data.sql", "name": "union_data", "macro_sql": "{% macro union_data(table_identifier, database_variable, schema_variable, default_database, default_schema, default_variable, union_schema_variable='union_schemas', union_database_variable='union_databases') -%}\n\n{{ adapter.dispatch('union_data', 'fivetran_utils') (\n table_identifier, \n database_variable, \n schema_variable, \n default_database, \n default_schema, \n default_variable,\n union_schema_variable,\n union_database_variable\n ) }}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.fivetran_utils.default__union_data"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481804.16747, "supported_languages": null}, "macro.fivetran_utils.default__union_data": {"unique_id": "macro.fivetran_utils.default__union_data", "package_name": "fivetran_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/fivetran_utils", "path": "macros/union_data.sql", "original_file_path": "macros/union_data.sql", "name": "default__union_data", "macro_sql": "{% macro default__union_data(\n table_identifier, \n database_variable, \n schema_variable, \n default_database, \n default_schema, \n default_variable,\n union_schema_variable,\n union_database_variable\n ) %}\n\n{% if var(union_schema_variable, none) %}\n\n {% set relations = [] %}\n \n {% if var(union_schema_variable) is string %}\n {% set trimmed = var(union_schema_variable)|trim('[')|trim(']') %}\n {% set schemas = trimmed.split(',')|map('trim',\" \")|map('trim','\"')|map('trim',\"'\") %}\n {% else %}\n {% set schemas = var(union_schema_variable) %}\n {% endif %}\n\n {% for schema in var(union_schema_variable) %}\n {% set relation=adapter.get_relation(\n database=source(schema, table_identifier).database if var('has_defined_sources', false) else var(database_variable, default_database),\n schema=source(schema, table_identifier).schema if var('has_defined_sources', false) else schema,\n identifier=source(schema, table_identifier).identifier if var('has_defined_sources', false) else table_identifier\n ) -%}\n \n {% set relation_exists=relation is not none %}\n\n {% if relation_exists %}\n\n {% do relations.append(relation) %}\n \n {% endif %}\n\n {% endfor %}\n\n {{ dbt_utils.union_relations(relations) }}\n\n{% elif var(union_database_variable, none) %}\n\n {% set relations = [] %}\n\n {% for database in var(union_database_variable) %}\n\n {% set relation=adapter.get_relation(\n database=source(schema, table_identifier).database if var('has_defined_sources', false) else database,\n schema=source(schema, table_identifier).schema if var('has_defined_sources', false) else var(schema_variable, default_schema),\n identifier=source(schema, table_identifier).identifier if var('has_defined_sources', false) else table_identifier\n ) -%}\n\n {% set relation_exists=relation is not none %}\n\n {% if relation_exists %}\n\n {% do relations.append(relation) %}\n \n {% endif %}\n\n {% endfor %}\n\n {{ dbt_utils.union_relations(relations) }}\n\n{% else %}\n\n select * \n from {{ var(default_variable) }}\n\n{% endif %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.union_relations"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481804.1700978, "supported_languages": null}, "macro.fivetran_utils.dummy_coalesce_value": {"unique_id": "macro.fivetran_utils.dummy_coalesce_value", "package_name": "fivetran_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/fivetran_utils", "path": "macros/dummy_coalesce_value.sql", "original_file_path": "macros/dummy_coalesce_value.sql", "name": "dummy_coalesce_value", "macro_sql": "{% macro dummy_coalesce_value(column) %}\n\n{% set coalesce_value = {\n 'STRING': \"'DUMMY_STRING'\",\n 'BOOLEAN': 'null',\n 'INT': 999999999,\n 'FLOAT': 999999999.99,\n 'TIMESTAMP': 'cast(\"2099-12-31\" as timestamp)',\n 'DATE': 'cast(\"2099-12-31\" as date)',\n} %}\n\n{% if column.is_float() %}\n{{ return(coalesce_value['FLOAT']) }}\n\n{% elif column.is_numeric() %}\n{{ return(coalesce_value['INT']) }}\n\n{% elif column.is_string() %}\n{{ return(coalesce_value['STRING']) }}\n\n{% elif column.data_type|lower == 'boolean' %}\n{{ return(coalesce_value['BOOLEAN']) }}\n\n{% elif 'timestamp' in column.data_type|lower %}\n{{ return(coalesce_value['TIMESTAMP']) }}\n\n{% elif 'date' in column.data_type|lower %}\n{{ return(coalesce_value['DATE']) }}\n\n{% elif 'int' in column.data_type|lower %}\n{{ return(coalesce_value['INT']) }}\n\n{% endif %}\n\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481804.1718888, "supported_languages": null}, "macro.fivetran_utils.array_agg": {"unique_id": "macro.fivetran_utils.array_agg", "package_name": "fivetran_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/fivetran_utils", "path": "macros/array_agg.sql", "original_file_path": "macros/array_agg.sql", "name": "array_agg", "macro_sql": "{% macro array_agg(field_to_agg) -%}\n\n{{ adapter.dispatch('array_agg', 'fivetran_utils') (field_to_agg) }}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.fivetran_utils.default__array_agg"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481804.172313, "supported_languages": null}, "macro.fivetran_utils.default__array_agg": {"unique_id": "macro.fivetran_utils.default__array_agg", "package_name": "fivetran_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/fivetran_utils", "path": "macros/array_agg.sql", "original_file_path": "macros/array_agg.sql", "name": "default__array_agg", "macro_sql": "{% macro default__array_agg(field_to_agg) %}\n array_agg({{ field_to_agg }})\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481804.1724281, "supported_languages": null}, "macro.fivetran_utils.redshift__array_agg": {"unique_id": "macro.fivetran_utils.redshift__array_agg", "package_name": "fivetran_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/fivetran_utils", "path": "macros/array_agg.sql", "original_file_path": "macros/array_agg.sql", "name": "redshift__array_agg", "macro_sql": "{% macro redshift__array_agg(field_to_agg) %}\n listagg({{ field_to_agg }}, ',')\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481804.172538, "supported_languages": null}, "macro.fivetran_utils.empty_variable_warning": {"unique_id": "macro.fivetran_utils.empty_variable_warning", "package_name": "fivetran_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/fivetran_utils", "path": "macros/empty_variable_warning.sql", "original_file_path": "macros/empty_variable_warning.sql", "name": "empty_variable_warning", "macro_sql": "{% macro empty_variable_warning(variable, downstream_model) %}\n\n{% if not var(variable) %}\n{{ log(\n \"\"\"\n Warning: You have passed an empty list to the \"\"\" ~ variable ~ \"\"\".\n As a result, you won't see the history of any columns in the \"\"\" ~ downstream_model ~ \"\"\" model.\n \"\"\",\n info=True\n) }}\n{% endif %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481804.1730518, "supported_languages": null}, "macro.fivetran_utils.enabled_vars_one_true": {"unique_id": "macro.fivetran_utils.enabled_vars_one_true", "package_name": "fivetran_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/asana/dbt_asana/integration_tests/dbt_packages/fivetran_utils", "path": "macros/enabled_vars_one_true.sql", "original_file_path": "macros/enabled_vars_one_true.sql", "name": "enabled_vars_one_true", "macro_sql": "{% macro enabled_vars_one_true(vars) %}\n\n{% for v in vars %}\n \n {% if var(v, False) == True %}\n {{ return(True) }}\n {% endif %}\n\n{% endfor %}\n\n{{ return(False) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481804.1735392, "supported_languages": null}}, "docs": {"dbt.__overview__": {"unique_id": "dbt.__overview__", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "overview.md", "original_file_path": "docs/overview.md", "name": "__overview__", "block_contents": "### Welcome!\n\nWelcome to the auto-generated documentation for your dbt project!\n\n### Navigation\n\nYou can use the `Project` and `Database` navigation tabs on the left side of the window to explore the models\nin your project.\n\n#### Project Tab\nThe `Project` tab mirrors the directory structure of your dbt project. In this tab, you can see all of the\nmodels defined in your dbt project, as well as models imported from dbt packages.\n\n#### Database Tab\nThe `Database` tab also exposes your models, but in a format that looks more like a database explorer. This view\nshows relations (tables and views) grouped into database schemas. Note that ephemeral models are _not_ shown\nin this interface, as they do not exist in the database.\n\n### Graph Exploration\nYou can click the blue icon on the bottom-right corner of the page to view the lineage graph of your models.\n\nOn model pages, you'll see the immediate parents and children of the model you're exploring. By clicking the `Expand`\nbutton at the top-right of this lineage pane, you'll be able to see all of the models that are used to build,\nor are built from, the model you're exploring.\n\nOnce expanded, you'll be able to use the `--select` and `--exclude` model selection syntax to filter the\nmodels in the graph. For more information on model selection, check out the [dbt docs](https://docs.getdbt.com/docs/model-selection-syntax).\n\nNote that you can also right-click on models to interactively filter and explore the graph.\n\n---\n\n### More information\n\n- [What is dbt](https://docs.getdbt.com/docs/introduction)?\n- Read the [dbt viewpoint](https://docs.getdbt.com/docs/viewpoint)\n- [Installation](https://docs.getdbt.com/docs/installation)\n- Join the [dbt Community](https://www.getdbt.com/community/) for questions and discussion"}}, "exposures": {}, "metrics": {}, "selectors": {}, "disabled": {}, "parent_map": {"seed.asana_integration_tests.project_task_data": [], "seed.asana_integration_tests.story_data": [], "seed.asana_integration_tests.task_tag_data": [], "seed.asana_integration_tests.task_section_data": [], "seed.asana_integration_tests.task_data": [], "seed.asana_integration_tests.task_follower_data": [], "seed.asana_integration_tests.tag_data": [], "seed.asana_integration_tests.project_data": [], "seed.asana_integration_tests.user_data": [], "seed.asana_integration_tests.team_data": [], "seed.asana_integration_tests.section_data": [], "model.asana_source.stg_asana__user": ["model.asana_source.stg_asana__user_tmp", "model.asana_source.stg_asana__user_tmp"], "model.asana_source.stg_asana__task": ["model.asana_source.stg_asana__task_tmp", "model.asana_source.stg_asana__task_tmp"], "model.asana_source.stg_asana__task_section": ["model.asana_source.stg_asana__task_section_tmp", "model.asana_source.stg_asana__task_section_tmp"], "model.asana_source.stg_asana__section": ["model.asana_source.stg_asana__section_tmp", "model.asana_source.stg_asana__section_tmp"], "model.asana_source.stg_asana__team": ["model.asana_source.stg_asana__team_tmp", "model.asana_source.stg_asana__team_tmp"], "model.asana_source.stg_asana__task_tag": ["model.asana_source.stg_asana__task_tag_tmp", "model.asana_source.stg_asana__task_tag_tmp"], "model.asana_source.stg_asana__story": ["model.asana_source.stg_asana__story_tmp", "model.asana_source.stg_asana__story_tmp"], "model.asana_source.stg_asana__tag": ["model.asana_source.stg_asana__tag_tmp", "model.asana_source.stg_asana__tag_tmp"], "model.asana_source.stg_asana__project_task": ["model.asana_source.stg_asana__project_task_tmp", "model.asana_source.stg_asana__project_task_tmp"], "model.asana_source.stg_asana__project": ["model.asana_source.stg_asana__project_tmp", "model.asana_source.stg_asana__project_tmp"], "model.asana_source.stg_asana__task_follower": ["model.asana_source.stg_asana__task_follower_tmp", "model.asana_source.stg_asana__task_follower_tmp"], "model.asana_source.stg_asana__story_tmp": ["source.asana_source.asana.story"], "model.asana_source.stg_asana__team_tmp": ["source.asana_source.asana.team"], "model.asana_source.stg_asana__task_tmp": ["source.asana_source.asana.task"], "model.asana_source.stg_asana__task_follower_tmp": ["source.asana_source.asana.task_follower"], "model.asana_source.stg_asana__tag_tmp": ["source.asana_source.asana.tag"], "model.asana_source.stg_asana__task_section_tmp": ["source.asana_source.asana.task_section"], "model.asana_source.stg_asana__task_tag_tmp": ["source.asana_source.asana.task_tag"], "model.asana_source.stg_asana__user_tmp": ["source.asana_source.asana.user"], "model.asana_source.stg_asana__section_tmp": ["source.asana_source.asana.section"], "model.asana_source.stg_asana__project_tmp": ["source.asana_source.asana.project"], "model.asana_source.stg_asana__project_task_tmp": ["source.asana_source.asana.project_task"], "model.asana.asana__daily_metrics": ["model.asana.asana__task"], "model.asana.asana__user": ["model.asana.int_asana__project_user", "model.asana.int_asana__user_task_metrics", "model.asana_source.stg_asana__user"], "model.asana.asana__task": ["model.asana.int_asana__subtask_parent", "model.asana.int_asana__task_assignee", "model.asana.int_asana__task_comments", "model.asana.int_asana__task_first_modifier", "model.asana.int_asana__task_followers", "model.asana.int_asana__task_open_length", "model.asana.int_asana__task_projects", "model.asana.int_asana__task_tags", "model.asana_source.stg_asana__task"], "model.asana.asana__team": ["model.asana.asana__project", "model.asana_source.stg_asana__team"], "model.asana.asana__project": ["model.asana.int_asana__project_task_metrics", "model.asana.int_asana__project_user", "model.asana_source.stg_asana__project", "model.asana_source.stg_asana__section", "model.asana_source.stg_asana__team", "model.asana_source.stg_asana__user"], "model.asana.asana__tag": ["model.asana.asana__task", "model.asana_source.stg_asana__tag", "model.asana_source.stg_asana__task_tag"], "model.asana.int_asana__task_comments": ["model.asana.int_asana__task_story"], "model.asana.int_asana__project_task_metrics": ["model.asana.asana__task", "model.asana_source.stg_asana__project", "model.asana_source.stg_asana__project_task"], "model.asana.int_asana__user_task_metrics": ["model.asana.asana__task"], "model.asana.int_asana__task_tags": ["model.asana_source.stg_asana__tag", "model.asana_source.stg_asana__task_tag"], "model.asana.int_asana__task_open_length": ["model.asana.int_asana__task_story", "model.asana_source.stg_asana__task"], "model.asana.int_asana__task_followers": ["model.asana_source.stg_asana__task_follower", "model.asana_source.stg_asana__user"], "model.asana.int_asana__project_user": ["model.asana.int_asana__task_assignee", "model.asana_source.stg_asana__project", "model.asana_source.stg_asana__project_task"], "model.asana.int_asana__task_first_modifier": ["model.asana.int_asana__task_story"], "model.asana.int_asana__task_projects": ["model.asana_source.stg_asana__project", "model.asana_source.stg_asana__project_task", "model.asana_source.stg_asana__section", "model.asana_source.stg_asana__task_section"], "model.asana.int_asana__task_assignee": ["model.asana_source.stg_asana__task", "model.asana_source.stg_asana__user"], "model.asana.int_asana__subtask_parent": ["model.asana.int_asana__task_assignee"], "model.asana.int_asana__task_story": ["model.asana_source.stg_asana__story", "model.asana_source.stg_asana__user"], "test.asana_source.unique_stg_asana__project_project_id.67bfab1228": ["model.asana_source.stg_asana__project"], "test.asana_source.not_null_stg_asana__project_project_id.d27dae84fa": ["model.asana_source.stg_asana__project"], "test.asana_source.not_null_stg_asana__project_task_project_id.e2450d16b1": ["model.asana_source.stg_asana__project_task"], "test.asana_source.not_null_stg_asana__project_task_task_id.9479566014": ["model.asana_source.stg_asana__project_task"], "test.asana_source.unique_stg_asana__section_section_id.0495dd3d2f": ["model.asana_source.stg_asana__section"], "test.asana_source.not_null_stg_asana__section_section_id.389ebce958": ["model.asana_source.stg_asana__section"], "test.asana_source.unique_stg_asana__story_story_id.414f25bb84": ["model.asana_source.stg_asana__story"], "test.asana_source.not_null_stg_asana__story_story_id.ca847d0848": ["model.asana_source.stg_asana__story"], "test.asana_source.not_null_stg_asana__story_target_task_id.3f971de06e": ["model.asana_source.stg_asana__story"], "test.asana_source.unique_stg_asana__tag_tag_id.fd78b190c7": ["model.asana_source.stg_asana__tag"], "test.asana_source.not_null_stg_asana__tag_tag_id.c6a8187ca2": ["model.asana_source.stg_asana__tag"], "test.asana_source.unique_stg_asana__task_task_id.a5271275a5": ["model.asana_source.stg_asana__task"], "test.asana_source.not_null_stg_asana__task_task_id.924cc69000": ["model.asana_source.stg_asana__task"], "test.asana_source.not_null_stg_asana__task_follower_task_id.5af35f322c": ["model.asana_source.stg_asana__task_follower"], "test.asana_source.not_null_stg_asana__task_follower_user_id.e0aea0b15e": ["model.asana_source.stg_asana__task_follower"], "test.asana_source.not_null_stg_asana__task_section_task_id.ab81301de8": ["model.asana_source.stg_asana__task_section"], "test.asana_source.not_null_stg_asana__task_section_section_id.b0977a4cfe": ["model.asana_source.stg_asana__task_section"], "test.asana_source.not_null_stg_asana__task_tag_tag_id.d523de41d8": ["model.asana_source.stg_asana__task_tag"], "test.asana_source.not_null_stg_asana__task_tag_task_id.9d27624748": ["model.asana_source.stg_asana__task_tag"], "test.asana_source.unique_stg_asana__team_team_id.111fe15873": ["model.asana_source.stg_asana__team"], "test.asana_source.not_null_stg_asana__team_team_id.e12b563474": ["model.asana_source.stg_asana__team"], "test.asana_source.unique_stg_asana__user_user_id.73808d6267": ["model.asana_source.stg_asana__user"], "test.asana_source.not_null_stg_asana__user_user_id.4e900e8ec6": ["model.asana_source.stg_asana__user"], "test.asana.unique_asana__task_task_id.ebfe331df1": ["model.asana.asana__task"], "test.asana.not_null_asana__task_task_id.6d36eb2cd0": ["model.asana.asana__task"], "test.asana.unique_asana__user_user_id.3c4b63387e": ["model.asana.asana__user"], "test.asana.not_null_asana__user_user_id.eb9cd93a43": ["model.asana.asana__user"], "test.asana.unique_asana__project_project_id.66a76364ef": ["model.asana.asana__project"], "test.asana.not_null_asana__project_project_id.78420e1b45": ["model.asana.asana__project"], "test.asana.unique_asana__team_team_id.ada6b5e093": ["model.asana.asana__team"], "test.asana.not_null_asana__team_team_id.cd6b6c88bf": ["model.asana.asana__team"], "test.asana.unique_asana__tag_tag_id.46c0d2510f": ["model.asana.asana__tag"], "test.asana.not_null_asana__tag_tag_id.593d626953": ["model.asana.asana__tag"], "test.asana.unique_asana__daily_metrics_date_day.e8d67f545d": ["model.asana.asana__daily_metrics"], "test.asana.not_null_asana__daily_metrics_date_day.363a2a09cf": ["model.asana.asana__daily_metrics"], "test.asana.unique_int_asana__project_task_metrics_project_id.049cc9b8a6": ["model.asana.int_asana__project_task_metrics"], "test.asana.not_null_int_asana__project_task_metrics_project_id.804fd1daf3": ["model.asana.int_asana__project_task_metrics"], "test.asana.dbt_utils_unique_combination_of_columns_int_asana__project_user_project_id__user_id__role__currently_working_on.f9493098e0": ["model.asana.int_asana__project_user"], "test.asana.unique_int_asana__subtask_parent_subtask_id.641dfb3c8f": ["model.asana.int_asana__subtask_parent"], "test.asana.not_null_int_asana__subtask_parent_subtask_id.024565c768": ["model.asana.int_asana__subtask_parent"], "test.asana.unique_int_asana__task_assignee_task_id.b4e2ea04e1": ["model.asana.int_asana__task_assignee"], "test.asana.not_null_int_asana__task_assignee_task_id.a9c81bd443": ["model.asana.int_asana__task_assignee"], "test.asana.unique_int_asana__task_comments_task_id.f012fa6a04": ["model.asana.int_asana__task_comments"], "test.asana.not_null_int_asana__task_comments_task_id.6986f1d77f": ["model.asana.int_asana__task_comments"], "test.asana.unique_int_asana__task_first_modifier_task_id.59583c6dc2": ["model.asana.int_asana__task_first_modifier"], "test.asana.not_null_int_asana__task_first_modifier_task_id.495738ff52": ["model.asana.int_asana__task_first_modifier"], "test.asana.unique_int_asana__task_followers_task_id.eeb3667df9": ["model.asana.int_asana__task_followers"], "test.asana.not_null_int_asana__task_followers_task_id.6791bf2573": ["model.asana.int_asana__task_followers"], "test.asana.unique_int_asana__task_open_length_task_id.f26c49b044": ["model.asana.int_asana__task_open_length"], "test.asana.not_null_int_asana__task_open_length_task_id.23bb23b2e9": ["model.asana.int_asana__task_open_length"], "test.asana.unique_int_asana__task_projects_task_id.8a6b2f262d": ["model.asana.int_asana__task_projects"], "test.asana.not_null_int_asana__task_projects_task_id.322519ee10": ["model.asana.int_asana__task_projects"], "test.asana.unique_int_asana__task_story_story_id.92d7adbcf6": ["model.asana.int_asana__task_story"], "test.asana.not_null_int_asana__task_story_story_id.1ffdb99927": ["model.asana.int_asana__task_story"], "test.asana.unique_int_asana__task_tags_task_id.f28aff2685": ["model.asana.int_asana__task_tags"], "test.asana.not_null_int_asana__task_tags_task_id.34eec2b834": ["model.asana.int_asana__task_tags"], "test.asana.unique_int_asana__user_task_metrics_user_id.06a6a270b8": ["model.asana.int_asana__user_task_metrics"], "test.asana.not_null_int_asana__user_task_metrics_user_id.54eae7d721": ["model.asana.int_asana__user_task_metrics"], "source.asana_source.asana.user": [], "source.asana_source.asana.task": [], "source.asana_source.asana.project": [], "source.asana_source.asana.story": [], "source.asana_source.asana.team": [], "source.asana_source.asana.tag": [], "source.asana_source.asana.section": [], "source.asana_source.asana.project_task": [], "source.asana_source.asana.task_follower": [], "source.asana_source.asana.task_tag": [], "source.asana_source.asana.task_section": []}, "child_map": {"seed.asana_integration_tests.project_task_data": [], "seed.asana_integration_tests.story_data": [], "seed.asana_integration_tests.task_tag_data": [], "seed.asana_integration_tests.task_section_data": [], "seed.asana_integration_tests.task_data": [], "seed.asana_integration_tests.task_follower_data": [], "seed.asana_integration_tests.tag_data": [], "seed.asana_integration_tests.project_data": [], "seed.asana_integration_tests.user_data": [], "seed.asana_integration_tests.team_data": [], "seed.asana_integration_tests.section_data": [], "model.asana_source.stg_asana__user": ["model.asana.asana__project", "model.asana.asana__user", "model.asana.int_asana__task_assignee", "model.asana.int_asana__task_followers", "model.asana.int_asana__task_story", "test.asana_source.not_null_stg_asana__user_user_id.4e900e8ec6", "test.asana_source.unique_stg_asana__user_user_id.73808d6267"], "model.asana_source.stg_asana__task": ["model.asana.asana__task", "model.asana.int_asana__task_assignee", "model.asana.int_asana__task_open_length", "test.asana_source.not_null_stg_asana__task_task_id.924cc69000", "test.asana_source.unique_stg_asana__task_task_id.a5271275a5"], "model.asana_source.stg_asana__task_section": ["model.asana.int_asana__task_projects", "test.asana_source.not_null_stg_asana__task_section_section_id.b0977a4cfe", "test.asana_source.not_null_stg_asana__task_section_task_id.ab81301de8"], "model.asana_source.stg_asana__section": ["model.asana.asana__project", "model.asana.int_asana__task_projects", "test.asana_source.not_null_stg_asana__section_section_id.389ebce958", "test.asana_source.unique_stg_asana__section_section_id.0495dd3d2f"], "model.asana_source.stg_asana__team": ["model.asana.asana__project", "model.asana.asana__team", "test.asana_source.not_null_stg_asana__team_team_id.e12b563474", "test.asana_source.unique_stg_asana__team_team_id.111fe15873"], "model.asana_source.stg_asana__task_tag": ["model.asana.asana__tag", "model.asana.int_asana__task_tags", "test.asana_source.not_null_stg_asana__task_tag_tag_id.d523de41d8", "test.asana_source.not_null_stg_asana__task_tag_task_id.9d27624748"], "model.asana_source.stg_asana__story": ["model.asana.int_asana__task_story", "test.asana_source.not_null_stg_asana__story_story_id.ca847d0848", "test.asana_source.not_null_stg_asana__story_target_task_id.3f971de06e", "test.asana_source.unique_stg_asana__story_story_id.414f25bb84"], "model.asana_source.stg_asana__tag": ["model.asana.asana__tag", "model.asana.int_asana__task_tags", "test.asana_source.not_null_stg_asana__tag_tag_id.c6a8187ca2", "test.asana_source.unique_stg_asana__tag_tag_id.fd78b190c7"], "model.asana_source.stg_asana__project_task": ["model.asana.int_asana__project_task_metrics", "model.asana.int_asana__project_user", "model.asana.int_asana__task_projects", "test.asana_source.not_null_stg_asana__project_task_project_id.e2450d16b1", "test.asana_source.not_null_stg_asana__project_task_task_id.9479566014"], "model.asana_source.stg_asana__project": ["model.asana.asana__project", "model.asana.int_asana__project_task_metrics", "model.asana.int_asana__project_user", "model.asana.int_asana__task_projects", "test.asana_source.not_null_stg_asana__project_project_id.d27dae84fa", "test.asana_source.unique_stg_asana__project_project_id.67bfab1228"], "model.asana_source.stg_asana__task_follower": ["model.asana.int_asana__task_followers", "test.asana_source.not_null_stg_asana__task_follower_task_id.5af35f322c", "test.asana_source.not_null_stg_asana__task_follower_user_id.e0aea0b15e"], "model.asana_source.stg_asana__story_tmp": ["model.asana_source.stg_asana__story", "model.asana_source.stg_asana__story"], "model.asana_source.stg_asana__team_tmp": ["model.asana_source.stg_asana__team", "model.asana_source.stg_asana__team"], "model.asana_source.stg_asana__task_tmp": ["model.asana_source.stg_asana__task", "model.asana_source.stg_asana__task"], "model.asana_source.stg_asana__task_follower_tmp": ["model.asana_source.stg_asana__task_follower", "model.asana_source.stg_asana__task_follower"], "model.asana_source.stg_asana__tag_tmp": ["model.asana_source.stg_asana__tag", "model.asana_source.stg_asana__tag"], "model.asana_source.stg_asana__task_section_tmp": ["model.asana_source.stg_asana__task_section", "model.asana_source.stg_asana__task_section"], "model.asana_source.stg_asana__task_tag_tmp": ["model.asana_source.stg_asana__task_tag", "model.asana_source.stg_asana__task_tag"], "model.asana_source.stg_asana__user_tmp": ["model.asana_source.stg_asana__user", "model.asana_source.stg_asana__user"], "model.asana_source.stg_asana__section_tmp": ["model.asana_source.stg_asana__section", "model.asana_source.stg_asana__section"], "model.asana_source.stg_asana__project_tmp": ["model.asana_source.stg_asana__project", "model.asana_source.stg_asana__project"], "model.asana_source.stg_asana__project_task_tmp": ["model.asana_source.stg_asana__project_task", "model.asana_source.stg_asana__project_task"], "model.asana.asana__daily_metrics": ["test.asana.not_null_asana__daily_metrics_date_day.363a2a09cf", "test.asana.unique_asana__daily_metrics_date_day.e8d67f545d"], "model.asana.asana__user": ["test.asana.not_null_asana__user_user_id.eb9cd93a43", "test.asana.unique_asana__user_user_id.3c4b63387e"], "model.asana.asana__task": ["model.asana.asana__daily_metrics", "model.asana.asana__tag", "model.asana.int_asana__project_task_metrics", "model.asana.int_asana__user_task_metrics", "test.asana.not_null_asana__task_task_id.6d36eb2cd0", "test.asana.unique_asana__task_task_id.ebfe331df1"], "model.asana.asana__team": ["test.asana.not_null_asana__team_team_id.cd6b6c88bf", "test.asana.unique_asana__team_team_id.ada6b5e093"], "model.asana.asana__project": ["model.asana.asana__team", "test.asana.not_null_asana__project_project_id.78420e1b45", "test.asana.unique_asana__project_project_id.66a76364ef"], "model.asana.asana__tag": ["test.asana.not_null_asana__tag_tag_id.593d626953", "test.asana.unique_asana__tag_tag_id.46c0d2510f"], "model.asana.int_asana__task_comments": ["model.asana.asana__task", "test.asana.not_null_int_asana__task_comments_task_id.6986f1d77f", "test.asana.unique_int_asana__task_comments_task_id.f012fa6a04"], "model.asana.int_asana__project_task_metrics": ["model.asana.asana__project", "test.asana.not_null_int_asana__project_task_metrics_project_id.804fd1daf3", "test.asana.unique_int_asana__project_task_metrics_project_id.049cc9b8a6"], "model.asana.int_asana__user_task_metrics": ["model.asana.asana__user", "test.asana.not_null_int_asana__user_task_metrics_user_id.54eae7d721", "test.asana.unique_int_asana__user_task_metrics_user_id.06a6a270b8"], "model.asana.int_asana__task_tags": ["model.asana.asana__task", "test.asana.not_null_int_asana__task_tags_task_id.34eec2b834", "test.asana.unique_int_asana__task_tags_task_id.f28aff2685"], "model.asana.int_asana__task_open_length": ["model.asana.asana__task", "test.asana.not_null_int_asana__task_open_length_task_id.23bb23b2e9", "test.asana.unique_int_asana__task_open_length_task_id.f26c49b044"], "model.asana.int_asana__task_followers": ["model.asana.asana__task", "test.asana.not_null_int_asana__task_followers_task_id.6791bf2573", "test.asana.unique_int_asana__task_followers_task_id.eeb3667df9"], "model.asana.int_asana__project_user": ["model.asana.asana__project", "model.asana.asana__user", "test.asana.dbt_utils_unique_combination_of_columns_int_asana__project_user_project_id__user_id__role__currently_working_on.f9493098e0"], "model.asana.int_asana__task_first_modifier": ["model.asana.asana__task", "test.asana.not_null_int_asana__task_first_modifier_task_id.495738ff52", "test.asana.unique_int_asana__task_first_modifier_task_id.59583c6dc2"], "model.asana.int_asana__task_projects": ["model.asana.asana__task", "test.asana.not_null_int_asana__task_projects_task_id.322519ee10", "test.asana.unique_int_asana__task_projects_task_id.8a6b2f262d"], "model.asana.int_asana__task_assignee": ["model.asana.asana__task", "model.asana.int_asana__project_user", "model.asana.int_asana__subtask_parent", "test.asana.not_null_int_asana__task_assignee_task_id.a9c81bd443", "test.asana.unique_int_asana__task_assignee_task_id.b4e2ea04e1"], "model.asana.int_asana__subtask_parent": ["model.asana.asana__task", "test.asana.not_null_int_asana__subtask_parent_subtask_id.024565c768", "test.asana.unique_int_asana__subtask_parent_subtask_id.641dfb3c8f"], "model.asana.int_asana__task_story": ["model.asana.int_asana__task_comments", "model.asana.int_asana__task_first_modifier", "model.asana.int_asana__task_open_length", "test.asana.not_null_int_asana__task_story_story_id.1ffdb99927", "test.asana.unique_int_asana__task_story_story_id.92d7adbcf6"], "test.asana_source.unique_stg_asana__project_project_id.67bfab1228": [], "test.asana_source.not_null_stg_asana__project_project_id.d27dae84fa": [], "test.asana_source.not_null_stg_asana__project_task_project_id.e2450d16b1": [], "test.asana_source.not_null_stg_asana__project_task_task_id.9479566014": [], "test.asana_source.unique_stg_asana__section_section_id.0495dd3d2f": [], "test.asana_source.not_null_stg_asana__section_section_id.389ebce958": [], "test.asana_source.unique_stg_asana__story_story_id.414f25bb84": [], "test.asana_source.not_null_stg_asana__story_story_id.ca847d0848": [], "test.asana_source.not_null_stg_asana__story_target_task_id.3f971de06e": [], "test.asana_source.unique_stg_asana__tag_tag_id.fd78b190c7": [], "test.asana_source.not_null_stg_asana__tag_tag_id.c6a8187ca2": [], "test.asana_source.unique_stg_asana__task_task_id.a5271275a5": [], "test.asana_source.not_null_stg_asana__task_task_id.924cc69000": [], "test.asana_source.not_null_stg_asana__task_follower_task_id.5af35f322c": [], "test.asana_source.not_null_stg_asana__task_follower_user_id.e0aea0b15e": [], "test.asana_source.not_null_stg_asana__task_section_task_id.ab81301de8": [], "test.asana_source.not_null_stg_asana__task_section_section_id.b0977a4cfe": [], "test.asana_source.not_null_stg_asana__task_tag_tag_id.d523de41d8": [], "test.asana_source.not_null_stg_asana__task_tag_task_id.9d27624748": [], "test.asana_source.unique_stg_asana__team_team_id.111fe15873": [], "test.asana_source.not_null_stg_asana__team_team_id.e12b563474": [], "test.asana_source.unique_stg_asana__user_user_id.73808d6267": [], "test.asana_source.not_null_stg_asana__user_user_id.4e900e8ec6": [], "test.asana.unique_asana__task_task_id.ebfe331df1": [], "test.asana.not_null_asana__task_task_id.6d36eb2cd0": [], "test.asana.unique_asana__user_user_id.3c4b63387e": [], "test.asana.not_null_asana__user_user_id.eb9cd93a43": [], "test.asana.unique_asana__project_project_id.66a76364ef": [], "test.asana.not_null_asana__project_project_id.78420e1b45": [], "test.asana.unique_asana__team_team_id.ada6b5e093": [], "test.asana.not_null_asana__team_team_id.cd6b6c88bf": [], "test.asana.unique_asana__tag_tag_id.46c0d2510f": [], "test.asana.not_null_asana__tag_tag_id.593d626953": [], "test.asana.unique_asana__daily_metrics_date_day.e8d67f545d": [], "test.asana.not_null_asana__daily_metrics_date_day.363a2a09cf": [], "test.asana.unique_int_asana__project_task_metrics_project_id.049cc9b8a6": [], "test.asana.not_null_int_asana__project_task_metrics_project_id.804fd1daf3": [], "test.asana.dbt_utils_unique_combination_of_columns_int_asana__project_user_project_id__user_id__role__currently_working_on.f9493098e0": [], "test.asana.unique_int_asana__subtask_parent_subtask_id.641dfb3c8f": [], "test.asana.not_null_int_asana__subtask_parent_subtask_id.024565c768": [], "test.asana.unique_int_asana__task_assignee_task_id.b4e2ea04e1": [], "test.asana.not_null_int_asana__task_assignee_task_id.a9c81bd443": [], "test.asana.unique_int_asana__task_comments_task_id.f012fa6a04": [], "test.asana.not_null_int_asana__task_comments_task_id.6986f1d77f": [], "test.asana.unique_int_asana__task_first_modifier_task_id.59583c6dc2": [], "test.asana.not_null_int_asana__task_first_modifier_task_id.495738ff52": [], "test.asana.unique_int_asana__task_followers_task_id.eeb3667df9": [], "test.asana.not_null_int_asana__task_followers_task_id.6791bf2573": [], "test.asana.unique_int_asana__task_open_length_task_id.f26c49b044": [], "test.asana.not_null_int_asana__task_open_length_task_id.23bb23b2e9": [], "test.asana.unique_int_asana__task_projects_task_id.8a6b2f262d": [], "test.asana.not_null_int_asana__task_projects_task_id.322519ee10": [], "test.asana.unique_int_asana__task_story_story_id.92d7adbcf6": [], "test.asana.not_null_int_asana__task_story_story_id.1ffdb99927": [], "test.asana.unique_int_asana__task_tags_task_id.f28aff2685": [], "test.asana.not_null_int_asana__task_tags_task_id.34eec2b834": [], "test.asana.unique_int_asana__user_task_metrics_user_id.06a6a270b8": [], "test.asana.not_null_int_asana__user_task_metrics_user_id.54eae7d721": [], "source.asana_source.asana.user": ["model.asana_source.stg_asana__user_tmp"], "source.asana_source.asana.task": ["model.asana_source.stg_asana__task_tmp"], "source.asana_source.asana.project": ["model.asana_source.stg_asana__project_tmp"], "source.asana_source.asana.story": ["model.asana_source.stg_asana__story_tmp"], "source.asana_source.asana.team": ["model.asana_source.stg_asana__team_tmp"], "source.asana_source.asana.tag": ["model.asana_source.stg_asana__tag_tmp"], "source.asana_source.asana.section": ["model.asana_source.stg_asana__section_tmp"], "source.asana_source.asana.project_task": ["model.asana_source.stg_asana__project_task_tmp"], "source.asana_source.asana.task_follower": ["model.asana_source.stg_asana__task_follower_tmp"], "source.asana_source.asana.task_tag": ["model.asana_source.stg_asana__task_tag_tmp"], "source.asana_source.asana.task_section": ["model.asana_source.stg_asana__task_section_tmp"]}} \ No newline at end of file diff --git a/docs/run_results.json b/docs/run_results.json index e337ab8..fe1b2e2 100644 --- a/docs/run_results.json +++ b/docs/run_results.json @@ -1 +1 @@ -{"metadata": {"dbt_schema_version": "https://schemas.getdbt.com/dbt/run-results/v4.json", "dbt_version": "1.2.0", "generated_at": "2022-09-19T15:40:11.871579Z", "invocation_id": "ca1d8c4c-7612-4d61-ac01-69647773b393", "env": {}}, "results": [{"status": "success", "timing": [{"name": "compile", "started_at": "2022-09-19T15:40:05.927669Z", "completed_at": "2022-09-19T15:40:05.934714Z"}, {"name": "execute", "started_at": "2022-09-19T15:40:05.935030Z", "completed_at": "2022-09-19T15:40:05.935060Z"}], "thread_id": "Thread-1", "execution_time": 0.00838780403137207, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.asana_source.stg_asana__project_task_tmp"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-09-19T15:40:05.936372Z", "completed_at": "2022-09-19T15:40:05.945731Z"}, {"name": "execute", "started_at": "2022-09-19T15:40:05.945968Z", "completed_at": "2022-09-19T15:40:05.945977Z"}], "thread_id": "Thread-1", "execution_time": 0.010323047637939453, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.asana_source.stg_asana__project_tmp"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-09-19T15:40:05.947354Z", "completed_at": "2022-09-19T15:40:05.950932Z"}, {"name": "execute", "started_at": "2022-09-19T15:40:05.951135Z", "completed_at": "2022-09-19T15:40:05.951142Z"}], "thread_id": "Thread-1", "execution_time": 0.0046961307525634766, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.asana_source.stg_asana__section_tmp"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-09-19T15:40:05.952202Z", "completed_at": "2022-09-19T15:40:05.955116Z"}, {"name": "execute", "started_at": "2022-09-19T15:40:05.955278Z", "completed_at": "2022-09-19T15:40:05.955284Z"}], "thread_id": "Thread-1", "execution_time": 0.0037088394165039062, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.asana_source.stg_asana__story_tmp"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-09-19T15:40:05.956295Z", "completed_at": "2022-09-19T15:40:05.959105Z"}, {"name": "execute", "started_at": "2022-09-19T15:40:05.959255Z", "completed_at": "2022-09-19T15:40:05.959260Z"}], "thread_id": "Thread-1", "execution_time": 0.0035271644592285156, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.asana_source.stg_asana__tag_tmp"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-09-19T15:40:05.960188Z", "completed_at": "2022-09-19T15:40:05.962829Z"}, {"name": "execute", "started_at": "2022-09-19T15:40:05.962988Z", "completed_at": "2022-09-19T15:40:05.962994Z"}], "thread_id": "Thread-1", "execution_time": 0.003528118133544922, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.asana_source.stg_asana__task_follower_tmp"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-09-19T15:40:05.963924Z", "completed_at": "2022-09-19T15:40:05.967327Z"}, {"name": "execute", "started_at": "2022-09-19T15:40:05.967484Z", "completed_at": "2022-09-19T15:40:05.967491Z"}], "thread_id": "Thread-1", "execution_time": 0.004291057586669922, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.asana_source.stg_asana__task_section_tmp"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-09-19T15:40:05.968606Z", "completed_at": "2022-09-19T15:40:05.971323Z"}, {"name": "execute", "started_at": "2022-09-19T15:40:05.971478Z", "completed_at": "2022-09-19T15:40:05.971484Z"}], "thread_id": "Thread-1", "execution_time": 0.003553152084350586, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.asana_source.stg_asana__task_tag_tmp"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-09-19T15:40:05.972602Z", "completed_at": "2022-09-19T15:40:05.975035Z"}, {"name": "execute", "started_at": "2022-09-19T15:40:05.975183Z", "completed_at": "2022-09-19T15:40:05.975188Z"}], "thread_id": "Thread-1", "execution_time": 0.0033011436462402344, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.asana_source.stg_asana__task_tmp"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-09-19T15:40:05.975860Z", "completed_at": "2022-09-19T15:40:05.978291Z"}, {"name": "execute", "started_at": "2022-09-19T15:40:05.978442Z", "completed_at": "2022-09-19T15:40:05.978447Z"}], "thread_id": "Thread-1", "execution_time": 0.002978086471557617, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.asana_source.stg_asana__team_tmp"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-09-19T15:40:05.979102Z", "completed_at": "2022-09-19T15:40:05.981651Z"}, {"name": "execute", "started_at": "2022-09-19T15:40:05.981814Z", "completed_at": "2022-09-19T15:40:05.981820Z"}], "thread_id": "Thread-1", "execution_time": 0.003103971481323242, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.asana_source.stg_asana__user_tmp"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-09-19T15:40:05.982533Z", "completed_at": "2022-09-19T15:40:05.984646Z"}, {"name": "execute", "started_at": "2022-09-19T15:40:05.984768Z", "completed_at": "2022-09-19T15:40:05.984772Z"}], "thread_id": "Thread-1", "execution_time": 0.0025758743286132812, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.asana_integration_tests.project_data"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-09-19T15:40:05.985344Z", "completed_at": "2022-09-19T15:40:05.986529Z"}, {"name": "execute", "started_at": "2022-09-19T15:40:05.986645Z", "completed_at": "2022-09-19T15:40:05.986649Z"}], "thread_id": "Thread-1", "execution_time": 0.0016329288482666016, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.asana_integration_tests.project_task_data"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-09-19T15:40:05.987165Z", "completed_at": "2022-09-19T15:40:05.988345Z"}, {"name": "execute", "started_at": "2022-09-19T15:40:05.988463Z", "completed_at": "2022-09-19T15:40:05.988467Z"}], "thread_id": "Thread-1", "execution_time": 0.0016021728515625, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.asana_integration_tests.section_data"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-09-19T15:40:05.988974Z", "completed_at": "2022-09-19T15:40:05.990175Z"}, {"name": "execute", "started_at": "2022-09-19T15:40:05.990311Z", "completed_at": "2022-09-19T15:40:05.990315Z"}], "thread_id": "Thread-1", "execution_time": 0.001653909683227539, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.asana_integration_tests.story_data"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-09-19T15:40:05.990863Z", "completed_at": "2022-09-19T15:40:05.992002Z"}, {"name": "execute", "started_at": "2022-09-19T15:40:05.992108Z", "completed_at": "2022-09-19T15:40:05.992111Z"}], "thread_id": "Thread-1", "execution_time": 0.0015349388122558594, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.asana_integration_tests.tag_data"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-09-19T15:40:05.992580Z", "completed_at": "2022-09-19T15:40:05.994223Z"}, {"name": "execute", "started_at": "2022-09-19T15:40:05.994334Z", "completed_at": "2022-09-19T15:40:05.994337Z"}], "thread_id": "Thread-1", "execution_time": 0.002029895782470703, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.asana_integration_tests.task_data"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-09-19T15:40:05.994803Z", "completed_at": "2022-09-19T15:40:05.995844Z"}, {"name": "execute", "started_at": "2022-09-19T15:40:05.995948Z", "completed_at": "2022-09-19T15:40:05.995951Z"}], "thread_id": "Thread-1", "execution_time": 0.0014181137084960938, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.asana_integration_tests.task_follower_data"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-09-19T15:40:05.996443Z", "completed_at": "2022-09-19T15:40:05.997503Z"}, {"name": "execute", "started_at": "2022-09-19T15:40:05.997613Z", "completed_at": "2022-09-19T15:40:05.997615Z"}], "thread_id": "Thread-1", "execution_time": 0.0014770030975341797, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.asana_integration_tests.task_section_data"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-09-19T15:40:05.998034Z", "completed_at": "2022-09-19T15:40:05.999076Z"}, {"name": "execute", "started_at": "2022-09-19T15:40:05.999188Z", "completed_at": "2022-09-19T15:40:05.999191Z"}], "thread_id": "Thread-1", "execution_time": 0.001425027847290039, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.asana_integration_tests.task_tag_data"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-09-19T15:40:05.999626Z", "completed_at": "2022-09-19T15:40:06.000682Z"}, {"name": "execute", "started_at": "2022-09-19T15:40:06.000790Z", "completed_at": "2022-09-19T15:40:06.000793Z"}], "thread_id": "Thread-1", "execution_time": 0.001474142074584961, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.asana_integration_tests.team_data"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-09-19T15:40:06.001239Z", "completed_at": "2022-09-19T15:40:06.002806Z"}, {"name": "execute", "started_at": "2022-09-19T15:40:06.002925Z", "completed_at": "2022-09-19T15:40:06.002928Z"}], "thread_id": "Thread-1", "execution_time": 0.001965045928955078, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.asana_integration_tests.user_data"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-09-19T15:40:06.003359Z", "completed_at": "2022-09-19T15:40:06.298987Z"}, {"name": "execute", "started_at": "2022-09-19T15:40:06.299169Z", "completed_at": "2022-09-19T15:40:06.299178Z"}], "thread_id": "Thread-1", "execution_time": 0.29616713523864746, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.asana_source.stg_asana__project_task"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-09-19T15:40:06.300030Z", "completed_at": "2022-09-19T15:40:06.582654Z"}, {"name": "execute", "started_at": "2022-09-19T15:40:06.582947Z", "completed_at": "2022-09-19T15:40:06.582965Z"}], "thread_id": "Thread-1", "execution_time": 0.283618688583374, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.asana_source.stg_asana__project"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-09-19T15:40:06.584324Z", "completed_at": "2022-09-19T15:40:06.812277Z"}, {"name": "execute", "started_at": "2022-09-19T15:40:06.812593Z", "completed_at": "2022-09-19T15:40:06.812607Z"}], "thread_id": "Thread-1", "execution_time": 0.2292618751525879, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.asana_source.stg_asana__section"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-09-19T15:40:06.814242Z", "completed_at": "2022-09-19T15:40:07.091354Z"}, {"name": "execute", "started_at": "2022-09-19T15:40:07.091528Z", "completed_at": "2022-09-19T15:40:07.091536Z"}], "thread_id": "Thread-1", "execution_time": 0.277982234954834, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.asana_source.stg_asana__story"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-09-19T15:40:07.092403Z", "completed_at": "2022-09-19T15:40:07.339023Z"}, {"name": "execute", "started_at": "2022-09-19T15:40:07.339331Z", "completed_at": "2022-09-19T15:40:07.339350Z"}], "thread_id": "Thread-1", "execution_time": 0.24762177467346191, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.asana_source.stg_asana__tag"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-09-19T15:40:07.340905Z", "completed_at": "2022-09-19T15:40:07.637113Z"}, {"name": "execute", "started_at": "2022-09-19T15:40:07.637401Z", "completed_at": "2022-09-19T15:40:07.637416Z"}], "thread_id": "Thread-1", "execution_time": 0.297558069229126, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.asana_source.stg_asana__task_follower"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-09-19T15:40:07.638822Z", "completed_at": "2022-09-19T15:40:07.925623Z"}, {"name": "execute", "started_at": "2022-09-19T15:40:07.925982Z", "completed_at": "2022-09-19T15:40:07.925998Z"}], "thread_id": "Thread-1", "execution_time": 0.28792905807495117, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.asana_source.stg_asana__task_section"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-09-19T15:40:07.927395Z", "completed_at": "2022-09-19T15:40:08.242372Z"}, {"name": "execute", "started_at": "2022-09-19T15:40:08.242653Z", "completed_at": "2022-09-19T15:40:08.242671Z"}], "thread_id": "Thread-1", "execution_time": 0.3160560131072998, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.asana_source.stg_asana__task_tag"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-09-19T15:40:08.244061Z", "completed_at": "2022-09-19T15:40:08.533040Z"}, {"name": "execute", "started_at": "2022-09-19T15:40:08.533225Z", "completed_at": "2022-09-19T15:40:08.533232Z"}], "thread_id": "Thread-1", "execution_time": 0.2898712158203125, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.asana_source.stg_asana__task"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-09-19T15:40:08.534119Z", "completed_at": "2022-09-19T15:40:08.807157Z"}, {"name": "execute", "started_at": "2022-09-19T15:40:08.807524Z", "completed_at": "2022-09-19T15:40:08.807557Z"}], "thread_id": "Thread-1", "execution_time": 0.2742149829864502, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.asana_source.stg_asana__team"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-09-19T15:40:08.809253Z", "completed_at": "2022-09-19T15:40:09.099560Z"}, {"name": "execute", "started_at": "2022-09-19T15:40:09.099920Z", "completed_at": "2022-09-19T15:40:09.099937Z"}], "thread_id": "Thread-1", "execution_time": 0.29154396057128906, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.asana_source.stg_asana__user"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-09-19T15:40:09.101764Z", "completed_at": "2022-09-19T15:40:09.115218Z"}, {"name": "execute", "started_at": "2022-09-19T15:40:09.115469Z", "completed_at": "2022-09-19T15:40:09.115477Z"}], "thread_id": "Thread-1", "execution_time": 0.014809131622314453, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.asana_source.not_null_stg_asana__project_task_project_id.e2450d16b1"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-09-19T15:40:09.116371Z", "completed_at": "2022-09-19T15:40:09.120081Z"}, {"name": "execute", "started_at": "2022-09-19T15:40:09.120281Z", "completed_at": "2022-09-19T15:40:09.120286Z"}], "thread_id": "Thread-1", "execution_time": 0.00439000129699707, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.asana_source.not_null_stg_asana__project_task_task_id.9479566014"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-09-19T15:40:09.121094Z", "completed_at": "2022-09-19T15:40:09.126989Z"}, {"name": "execute", "started_at": "2022-09-19T15:40:09.127172Z", "completed_at": "2022-09-19T15:40:09.127177Z"}], "thread_id": "Thread-1", "execution_time": 0.0065500736236572266, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.asana_source.not_null_stg_asana__project_project_id.d27dae84fa"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-09-19T15:40:09.127920Z", "completed_at": "2022-09-19T15:40:09.132618Z"}, {"name": "execute", "started_at": "2022-09-19T15:40:09.132808Z", "completed_at": "2022-09-19T15:40:09.132813Z"}], "thread_id": "Thread-1", "execution_time": 0.005303859710693359, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.asana_source.unique_stg_asana__project_project_id.67bfab1228"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-09-19T15:40:09.133470Z", "completed_at": "2022-09-19T15:40:09.136420Z"}, {"name": "execute", "started_at": "2022-09-19T15:40:09.136577Z", "completed_at": "2022-09-19T15:40:09.136582Z"}], "thread_id": "Thread-1", "execution_time": 0.003487110137939453, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.asana_source.not_null_stg_asana__section_section_id.389ebce958"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-09-19T15:40:09.137199Z", "completed_at": "2022-09-19T15:40:09.139972Z"}, {"name": "execute", "started_at": "2022-09-19T15:40:09.140130Z", "completed_at": "2022-09-19T15:40:09.140134Z"}], "thread_id": "Thread-1", "execution_time": 0.003304004669189453, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.asana_source.unique_stg_asana__section_section_id.0495dd3d2f"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-09-19T15:40:09.140795Z", "completed_at": "2022-09-19T15:40:09.144274Z"}, {"name": "execute", "started_at": "2022-09-19T15:40:09.144426Z", "completed_at": "2022-09-19T15:40:09.144431Z"}], "thread_id": "Thread-1", "execution_time": 0.004008054733276367, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.asana_source.not_null_stg_asana__story_story_id.ca847d0848"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-09-19T15:40:09.145019Z", "completed_at": "2022-09-19T15:40:09.147636Z"}, {"name": "execute", "started_at": "2022-09-19T15:40:09.147777Z", "completed_at": "2022-09-19T15:40:09.147781Z"}], "thread_id": "Thread-1", "execution_time": 0.0030989646911621094, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.asana_source.not_null_stg_asana__story_target_task_id.3f971de06e"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-09-19T15:40:09.148347Z", "completed_at": "2022-09-19T15:40:09.150954Z"}, {"name": "execute", "started_at": "2022-09-19T15:40:09.151100Z", "completed_at": "2022-09-19T15:40:09.151104Z"}], "thread_id": "Thread-1", "execution_time": 0.003095865249633789, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.asana_source.unique_stg_asana__story_story_id.414f25bb84"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-09-19T15:40:09.151675Z", "completed_at": "2022-09-19T15:40:09.154183Z"}, {"name": "execute", "started_at": "2022-09-19T15:40:09.154319Z", "completed_at": "2022-09-19T15:40:09.154323Z"}], "thread_id": "Thread-1", "execution_time": 0.0029740333557128906, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.asana_source.not_null_stg_asana__tag_tag_id.c6a8187ca2"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-09-19T15:40:09.154874Z", "completed_at": "2022-09-19T15:40:09.157348Z"}, {"name": "execute", "started_at": "2022-09-19T15:40:09.157478Z", "completed_at": "2022-09-19T15:40:09.157482Z"}], "thread_id": "Thread-1", "execution_time": 0.0029392242431640625, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.asana_source.unique_stg_asana__tag_tag_id.fd78b190c7"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-09-19T15:40:09.158018Z", "completed_at": "2022-09-19T15:40:09.161086Z"}, {"name": "execute", "started_at": "2022-09-19T15:40:09.161220Z", "completed_at": "2022-09-19T15:40:09.161224Z"}], "thread_id": "Thread-1", "execution_time": 0.0035240650177001953, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.asana_source.not_null_stg_asana__task_follower_task_id.5af35f322c"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-09-19T15:40:09.161812Z", "completed_at": "2022-09-19T15:40:09.164278Z"}, {"name": "execute", "started_at": "2022-09-19T15:40:09.164415Z", "completed_at": "2022-09-19T15:40:09.164419Z"}], "thread_id": "Thread-1", "execution_time": 0.0029299259185791016, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.asana_source.not_null_stg_asana__task_follower_user_id.e0aea0b15e"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-09-19T15:40:09.170042Z", "completed_at": "2022-09-19T15:40:09.172399Z"}, {"name": "execute", "started_at": "2022-09-19T15:40:09.172526Z", "completed_at": "2022-09-19T15:40:09.172529Z"}], "thread_id": "Thread-1", "execution_time": 0.002791881561279297, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.asana_source.not_null_stg_asana__task_section_section_id.b0977a4cfe"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-09-19T15:40:09.173019Z", "completed_at": "2022-09-19T15:40:09.175258Z"}, {"name": "execute", "started_at": "2022-09-19T15:40:09.175381Z", "completed_at": "2022-09-19T15:40:09.175384Z"}], "thread_id": "Thread-1", "execution_time": 0.0026540756225585938, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.asana_source.not_null_stg_asana__task_section_task_id.ab81301de8"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-09-19T15:40:09.179714Z", "completed_at": "2022-09-19T15:40:09.181887Z"}, {"name": "execute", "started_at": "2022-09-19T15:40:09.182013Z", "completed_at": "2022-09-19T15:40:09.182017Z"}], "thread_id": "Thread-1", "execution_time": 0.0025930404663085938, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.asana_source.not_null_stg_asana__task_tag_tag_id.d523de41d8"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-09-19T15:40:09.182499Z", "completed_at": "2022-09-19T15:40:09.184696Z"}, {"name": "execute", "started_at": "2022-09-19T15:40:09.184819Z", "completed_at": "2022-09-19T15:40:09.184823Z"}], "thread_id": "Thread-1", "execution_time": 0.0026102066040039062, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.asana_source.not_null_stg_asana__task_tag_task_id.9d27624748"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-09-19T15:40:09.185302Z", "completed_at": "2022-09-19T15:40:09.187472Z"}, {"name": "execute", "started_at": "2022-09-19T15:40:09.187598Z", "completed_at": "2022-09-19T15:40:09.187601Z"}], "thread_id": "Thread-1", "execution_time": 0.0025877952575683594, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.asana_source.not_null_stg_asana__task_task_id.924cc69000"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-09-19T15:40:09.188089Z", "completed_at": "2022-09-19T15:40:09.190267Z"}, {"name": "execute", "started_at": "2022-09-19T15:40:09.190387Z", "completed_at": "2022-09-19T15:40:09.190390Z"}], "thread_id": "Thread-1", "execution_time": 0.002590179443359375, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.asana_source.unique_stg_asana__task_task_id.a5271275a5"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-09-19T15:40:09.190863Z", "completed_at": "2022-09-19T15:40:09.193622Z"}, {"name": "execute", "started_at": "2022-09-19T15:40:09.193748Z", "completed_at": "2022-09-19T15:40:09.193751Z"}], "thread_id": "Thread-1", "execution_time": 0.0031769275665283203, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.asana_source.not_null_stg_asana__team_team_id.e12b563474"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-09-19T15:40:09.194234Z", "completed_at": "2022-09-19T15:40:09.196406Z"}, {"name": "execute", "started_at": "2022-09-19T15:40:09.196526Z", "completed_at": "2022-09-19T15:40:09.196529Z"}], "thread_id": "Thread-1", "execution_time": 0.002585172653198242, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.asana_source.unique_stg_asana__team_team_id.111fe15873"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-09-19T15:40:09.208752Z", "completed_at": "2022-09-19T15:40:09.210988Z"}, {"name": "execute", "started_at": "2022-09-19T15:40:09.211115Z", "completed_at": "2022-09-19T15:40:09.211119Z"}], "thread_id": "Thread-1", "execution_time": 0.002668142318725586, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.asana_source.not_null_stg_asana__user_user_id.4e900e8ec6"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-09-19T15:40:09.211666Z", "completed_at": "2022-09-19T15:40:09.213882Z"}, {"name": "execute", "started_at": "2022-09-19T15:40:09.214004Z", "completed_at": "2022-09-19T15:40:09.214007Z"}], "thread_id": "Thread-1", "execution_time": 0.0026679039001464844, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.asana_source.unique_stg_asana__user_user_id.73808d6267"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-09-19T15:40:09.214489Z", "completed_at": "2022-09-19T15:40:09.220816Z"}, {"name": "execute", "started_at": "2022-09-19T15:40:09.220950Z", "completed_at": "2022-09-19T15:40:09.220954Z"}], "thread_id": "Thread-1", "execution_time": 0.006770133972167969, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.asana.not_null_int_asana__task_projects_task_id.322519ee10"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-09-19T15:40:09.221476Z", "completed_at": "2022-09-19T15:40:09.225381Z"}, {"name": "execute", "started_at": "2022-09-19T15:40:09.225513Z", "completed_at": "2022-09-19T15:40:09.225517Z"}], "thread_id": "Thread-1", "execution_time": 0.004346132278442383, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.asana.unique_int_asana__task_projects_task_id.8a6b2f262d"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-09-19T15:40:09.226029Z", "completed_at": "2022-09-19T15:40:09.229679Z"}, {"name": "execute", "started_at": "2022-09-19T15:40:09.229807Z", "completed_at": "2022-09-19T15:40:09.229811Z"}], "thread_id": "Thread-1", "execution_time": 0.004083156585693359, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.asana.not_null_int_asana__task_tags_task_id.34eec2b834"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-09-19T15:40:09.230329Z", "completed_at": "2022-09-19T15:40:09.234282Z"}, {"name": "execute", "started_at": "2022-09-19T15:40:09.234409Z", "completed_at": "2022-09-19T15:40:09.234413Z"}], "thread_id": "Thread-1", "execution_time": 0.004400014877319336, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.asana.unique_int_asana__task_tags_task_id.f28aff2685"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-09-19T15:40:09.253745Z", "completed_at": "2022-09-19T15:40:09.256746Z"}, {"name": "execute", "started_at": "2022-09-19T15:40:09.256872Z", "completed_at": "2022-09-19T15:40:09.256876Z"}], "thread_id": "Thread-1", "execution_time": 0.003439188003540039, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.asana.not_null_int_asana__task_assignee_task_id.a9c81bd443"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-09-19T15:40:09.257370Z", "completed_at": "2022-09-19T15:40:09.261239Z"}, {"name": "execute", "started_at": "2022-09-19T15:40:09.261367Z", "completed_at": "2022-09-19T15:40:09.261371Z"}], "thread_id": "Thread-1", "execution_time": 0.004297971725463867, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.asana.unique_int_asana__task_assignee_task_id.b4e2ea04e1"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-09-19T15:40:09.261878Z", "completed_at": "2022-09-19T15:40:09.264945Z"}, {"name": "execute", "started_at": "2022-09-19T15:40:09.265070Z", "completed_at": "2022-09-19T15:40:09.265073Z"}], "thread_id": "Thread-1", "execution_time": 0.003509998321533203, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.asana.not_null_int_asana__task_followers_task_id.6791bf2573"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-09-19T15:40:09.265564Z", "completed_at": "2022-09-19T15:40:09.269349Z"}, {"name": "execute", "started_at": "2022-09-19T15:40:09.269490Z", "completed_at": "2022-09-19T15:40:09.269494Z"}], "thread_id": "Thread-1", "execution_time": 0.0042378902435302734, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.asana.unique_int_asana__task_followers_task_id.eeb3667df9"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-09-19T15:40:09.295074Z", "completed_at": "2022-09-19T15:40:09.298241Z"}, {"name": "execute", "started_at": "2022-09-19T15:40:09.298371Z", "completed_at": "2022-09-19T15:40:09.298376Z"}], "thread_id": "Thread-1", "execution_time": 0.0036029815673828125, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.asana.not_null_int_asana__task_story_story_id.1ffdb99927"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-09-19T15:40:09.298867Z", "completed_at": "2022-09-19T15:40:09.303401Z"}, {"name": "execute", "started_at": "2022-09-19T15:40:09.303530Z", "completed_at": "2022-09-19T15:40:09.303534Z"}], "thread_id": "Thread-1", "execution_time": 0.004967927932739258, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.asana.unique_int_asana__task_story_story_id.92d7adbcf6"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-09-19T15:40:09.304024Z", "completed_at": "2022-09-19T15:40:09.311038Z"}, {"name": "execute", "started_at": "2022-09-19T15:40:09.311173Z", "completed_at": "2022-09-19T15:40:09.311177Z"}], "thread_id": "Thread-1", "execution_time": 0.00745391845703125, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.asana.dbt_utils_unique_combination_of_columns_int_asana__project_user_project_id__user_id__role__currently_working_on.f9493098e0"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-09-19T15:40:09.311692Z", "completed_at": "2022-09-19T15:40:09.314776Z"}, {"name": "execute", "started_at": "2022-09-19T15:40:09.314903Z", "completed_at": "2022-09-19T15:40:09.314907Z"}], "thread_id": "Thread-1", "execution_time": 0.0035173892974853516, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.asana.not_null_int_asana__subtask_parent_subtask_id.024565c768"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-09-19T15:40:09.315417Z", "completed_at": "2022-09-19T15:40:09.319311Z"}, {"name": "execute", "started_at": "2022-09-19T15:40:09.319438Z", "completed_at": "2022-09-19T15:40:09.319442Z"}], "thread_id": "Thread-1", "execution_time": 0.00433802604675293, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.asana.unique_int_asana__subtask_parent_subtask_id.641dfb3c8f"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-09-19T15:40:09.319938Z", "completed_at": "2022-09-19T15:40:09.323483Z"}, {"name": "execute", "started_at": "2022-09-19T15:40:09.323608Z", "completed_at": "2022-09-19T15:40:09.323611Z"}], "thread_id": "Thread-1", "execution_time": 0.003969907760620117, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.asana.not_null_int_asana__task_comments_task_id.6986f1d77f"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-09-19T15:40:09.324099Z", "completed_at": "2022-09-19T15:40:09.328007Z"}, {"name": "execute", "started_at": "2022-09-19T15:40:09.328131Z", "completed_at": "2022-09-19T15:40:09.328135Z"}], "thread_id": "Thread-1", "execution_time": 0.004332065582275391, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.asana.unique_int_asana__task_comments_task_id.f012fa6a04"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-09-19T15:40:09.328623Z", "completed_at": "2022-09-19T15:40:09.331584Z"}, {"name": "execute", "started_at": "2022-09-19T15:40:09.331712Z", "completed_at": "2022-09-19T15:40:09.331715Z"}], "thread_id": "Thread-1", "execution_time": 0.0033867359161376953, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.asana.not_null_int_asana__task_first_modifier_task_id.495738ff52"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-09-19T15:40:09.332211Z", "completed_at": "2022-09-19T15:40:09.336106Z"}, {"name": "execute", "started_at": "2022-09-19T15:40:09.336235Z", "completed_at": "2022-09-19T15:40:09.336239Z"}], "thread_id": "Thread-1", "execution_time": 0.0043451786041259766, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.asana.unique_int_asana__task_first_modifier_task_id.59583c6dc2"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-09-19T15:40:09.336744Z", "completed_at": "2022-09-19T15:40:09.352540Z"}, {"name": "execute", "started_at": "2022-09-19T15:40:09.352669Z", "completed_at": "2022-09-19T15:40:09.352674Z"}], "thread_id": "Thread-1", "execution_time": 0.01623821258544922, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.asana.asana__task"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-09-19T15:40:09.353208Z", "completed_at": "2022-09-19T15:40:09.356368Z"}, {"name": "execute", "started_at": "2022-09-19T15:40:09.356499Z", "completed_at": "2022-09-19T15:40:09.356503Z"}], "thread_id": "Thread-1", "execution_time": 0.0035991668701171875, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.asana.not_null_int_asana__task_open_length_task_id.23bb23b2e9"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-09-19T15:40:09.356990Z", "completed_at": "2022-09-19T15:40:09.360805Z"}, {"name": "execute", "started_at": "2022-09-19T15:40:09.360930Z", "completed_at": "2022-09-19T15:40:09.360934Z"}], "thread_id": "Thread-1", "execution_time": 0.004239082336425781, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.asana.unique_int_asana__task_open_length_task_id.f26c49b044"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-09-19T15:40:09.361415Z", "completed_at": "2022-09-19T15:40:11.740826Z"}, {"name": "execute", "started_at": "2022-09-19T15:40:11.741009Z", "completed_at": "2022-09-19T15:40:11.741020Z"}], "thread_id": "Thread-1", "execution_time": 2.3799569606781006, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.asana.asana__daily_metrics"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-09-19T15:40:11.741677Z", "completed_at": "2022-09-19T15:40:11.746876Z"}, {"name": "execute", "started_at": "2022-09-19T15:40:11.747022Z", "completed_at": "2022-09-19T15:40:11.747026Z"}], "thread_id": "Thread-1", "execution_time": 0.005670785903930664, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.asana.asana__tag"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-09-19T15:40:11.752945Z", "completed_at": "2022-09-19T15:40:11.755323Z"}, {"name": "execute", "started_at": "2022-09-19T15:40:11.755451Z", "completed_at": "2022-09-19T15:40:11.755455Z"}], "thread_id": "Thread-1", "execution_time": 0.002811908721923828, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.asana.not_null_asana__task_task_id.6d36eb2cd0"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-09-19T15:40:11.755945Z", "completed_at": "2022-09-19T15:40:11.758740Z"}, {"name": "execute", "started_at": "2022-09-19T15:40:11.758865Z", "completed_at": "2022-09-19T15:40:11.758869Z"}], "thread_id": "Thread-1", "execution_time": 0.003214120864868164, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.asana.unique_asana__task_task_id.ebfe331df1"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-09-19T15:40:11.759349Z", "completed_at": "2022-09-19T15:40:11.795398Z"}, {"name": "execute", "started_at": "2022-09-19T15:40:11.795543Z", "completed_at": "2022-09-19T15:40:11.795548Z"}], "thread_id": "Thread-1", "execution_time": 0.03650999069213867, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.asana.not_null_asana__daily_metrics_date_day.363a2a09cf"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-09-19T15:40:11.796044Z", "completed_at": "2022-09-19T15:40:11.798280Z"}, {"name": "execute", "started_at": "2022-09-19T15:40:11.798400Z", "completed_at": "2022-09-19T15:40:11.798404Z"}], "thread_id": "Thread-1", "execution_time": 0.002650022506713867, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.asana.unique_asana__daily_metrics_date_day.e8d67f545d"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-09-19T15:40:11.798875Z", "completed_at": "2022-09-19T15:40:11.801024Z"}, {"name": "execute", "started_at": "2022-09-19T15:40:11.801145Z", "completed_at": "2022-09-19T15:40:11.801148Z"}], "thread_id": "Thread-1", "execution_time": 0.0025589466094970703, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.asana.not_null_asana__tag_tag_id.593d626953"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-09-19T15:40:11.801617Z", "completed_at": "2022-09-19T15:40:11.803802Z"}, {"name": "execute", "started_at": "2022-09-19T15:40:11.803925Z", "completed_at": "2022-09-19T15:40:11.803929Z"}], "thread_id": "Thread-1", "execution_time": 0.0026040077209472656, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.asana.unique_asana__tag_tag_id.46c0d2510f"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-09-19T15:40:11.804410Z", "completed_at": "2022-09-19T15:40:11.821423Z"}, {"name": "execute", "started_at": "2022-09-19T15:40:11.821555Z", "completed_at": "2022-09-19T15:40:11.821559Z"}], "thread_id": "Thread-1", "execution_time": 0.017445087432861328, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.asana.asana__project"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-09-19T15:40:11.822063Z", "completed_at": "2022-09-19T15:40:11.825116Z"}, {"name": "execute", "started_at": "2022-09-19T15:40:11.825246Z", "completed_at": "2022-09-19T15:40:11.825250Z"}], "thread_id": "Thread-1", "execution_time": 0.0034868717193603516, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.asana.not_null_int_asana__project_task_metrics_project_id.804fd1daf3"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-09-19T15:40:11.825729Z", "completed_at": "2022-09-19T15:40:11.829570Z"}, {"name": "execute", "started_at": "2022-09-19T15:40:11.829702Z", "completed_at": "2022-09-19T15:40:11.829706Z"}], "thread_id": "Thread-1", "execution_time": 0.004271984100341797, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.asana.unique_int_asana__project_task_metrics_project_id.049cc9b8a6"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-09-19T15:40:11.830181Z", "completed_at": "2022-09-19T15:40:11.841229Z"}, {"name": "execute", "started_at": "2022-09-19T15:40:11.841356Z", "completed_at": "2022-09-19T15:40:11.841360Z"}], "thread_id": "Thread-1", "execution_time": 0.011473894119262695, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.asana.asana__user"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-09-19T15:40:11.841900Z", "completed_at": "2022-09-19T15:40:11.845626Z"}, {"name": "execute", "started_at": "2022-09-19T15:40:11.845752Z", "completed_at": "2022-09-19T15:40:11.845756Z"}], "thread_id": "Thread-1", "execution_time": 0.004164934158325195, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.asana.not_null_int_asana__user_task_metrics_user_id.54eae7d721"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-09-19T15:40:11.846246Z", "completed_at": "2022-09-19T15:40:11.850087Z"}, {"name": "execute", "started_at": "2022-09-19T15:40:11.850229Z", "completed_at": "2022-09-19T15:40:11.850233Z"}], "thread_id": "Thread-1", "execution_time": 0.004290103912353516, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.asana.unique_int_asana__user_task_metrics_user_id.06a6a270b8"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-09-19T15:40:11.850723Z", "completed_at": "2022-09-19T15:40:11.853216Z"}, {"name": "execute", "started_at": "2022-09-19T15:40:11.853344Z", "completed_at": "2022-09-19T15:40:11.853348Z"}], "thread_id": "Thread-1", "execution_time": 0.002916097640991211, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.asana.asana__team"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-09-19T15:40:11.853916Z", "completed_at": "2022-09-19T15:40:11.856130Z"}, {"name": "execute", "started_at": "2022-09-19T15:40:11.856253Z", "completed_at": "2022-09-19T15:40:11.856256Z"}], "thread_id": "Thread-1", "execution_time": 0.002655029296875, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.asana.not_null_asana__project_project_id.78420e1b45"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-09-19T15:40:11.856722Z", "completed_at": "2022-09-19T15:40:11.859499Z"}, {"name": "execute", "started_at": "2022-09-19T15:40:11.859623Z", "completed_at": "2022-09-19T15:40:11.859627Z"}], "thread_id": "Thread-1", "execution_time": 0.003195047378540039, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.asana.unique_asana__project_project_id.66a76364ef"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-09-19T15:40:11.860158Z", "completed_at": "2022-09-19T15:40:11.862394Z"}, {"name": "execute", "started_at": "2022-09-19T15:40:11.862519Z", "completed_at": "2022-09-19T15:40:11.862523Z"}], "thread_id": "Thread-1", "execution_time": 0.0026879310607910156, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.asana.not_null_asana__user_user_id.eb9cd93a43"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-09-19T15:40:11.863010Z", "completed_at": "2022-09-19T15:40:11.865264Z"}, {"name": "execute", "started_at": "2022-09-19T15:40:11.865388Z", "completed_at": "2022-09-19T15:40:11.865392Z"}], "thread_id": "Thread-1", "execution_time": 0.0026726722717285156, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.asana.unique_asana__user_user_id.3c4b63387e"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-09-19T15:40:11.865874Z", "completed_at": "2022-09-19T15:40:11.868024Z"}, {"name": "execute", "started_at": "2022-09-19T15:40:11.868150Z", "completed_at": "2022-09-19T15:40:11.868154Z"}], "thread_id": "Thread-1", "execution_time": 0.002568960189819336, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.asana.not_null_asana__team_team_id.cd6b6c88bf"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-09-19T15:40:11.868630Z", "completed_at": "2022-09-19T15:40:11.870796Z"}, {"name": "execute", "started_at": "2022-09-19T15:40:11.870917Z", "completed_at": "2022-09-19T15:40:11.870921Z"}], "thread_id": "Thread-1", "execution_time": 0.002579927444458008, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.asana.unique_asana__team_team_id.ada6b5e093"}], "elapsed_time": 8.258373260498047, "args": {"write_json": true, "use_colors": true, "printer_width": 80, "version_check": true, "partial_parse": true, "static_parser": true, "profiles_dir": "/Users/catherinefritz/.dbt", "send_anonymous_usage_stats": true, "event_buffer_size": 100000, "quiet": false, "no_print": false, "compile": true, "which": "generate", "rpc_method": "docs.generate", "indirect_selection": "eager"}} \ No newline at end of file +{"metadata": {"dbt_schema_version": "https://schemas.getdbt.com/dbt/run-results/v4.json", "dbt_version": "1.3.0", "generated_at": "2022-12-19T20:30:19.570606Z", "invocation_id": "5399ad9a-7e64-4cd8-8664-6d244aa13f8f", "env": {}}, "results": [{"status": "success", "timing": [{"name": "compile", "started_at": "2022-12-19T20:30:18.013609Z", "completed_at": "2022-12-19T20:30:18.019934Z"}, {"name": "execute", "started_at": "2022-12-19T20:30:18.027994Z", "completed_at": "2022-12-19T20:30:18.028006Z"}], "thread_id": "Thread-1", "execution_time": 0.01698613166809082, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.asana_source.stg_asana__project_task_tmp"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-12-19T20:30:18.019593Z", "completed_at": "2022-12-19T20:30:18.027560Z"}, {"name": "execute", "started_at": "2022-12-19T20:30:18.028771Z", "completed_at": "2022-12-19T20:30:18.028775Z"}], "thread_id": "Thread-3", "execution_time": 0.0157468318939209, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.asana_source.stg_asana__section_tmp"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-12-19T20:30:18.019741Z", "completed_at": "2022-12-19T20:30:18.027790Z"}, {"name": "execute", "started_at": "2022-12-19T20:30:18.028865Z", "completed_at": "2022-12-19T20:30:18.028867Z"}], "thread_id": "Thread-4", "execution_time": 0.015749216079711914, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.asana_source.stg_asana__story_tmp"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-12-19T20:30:18.019853Z", "completed_at": "2022-12-19T20:30:18.027892Z"}, {"name": "execute", "started_at": "2022-12-19T20:30:18.028944Z", "completed_at": "2022-12-19T20:30:18.028947Z"}], "thread_id": "Thread-2", "execution_time": 0.015790224075317383, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.asana_source.stg_asana__project_tmp"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-12-19T20:30:18.032676Z", "completed_at": "2022-12-19T20:30:18.042760Z"}, {"name": "execute", "started_at": "2022-12-19T20:30:18.043429Z", "completed_at": "2022-12-19T20:30:18.043435Z"}], "thread_id": "Thread-1", "execution_time": 0.013253927230834961, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.asana_source.stg_asana__tag_tmp"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-12-19T20:30:18.035699Z", "completed_at": "2022-12-19T20:30:18.043045Z"}, {"name": "execute", "started_at": "2022-12-19T20:30:18.043593Z", "completed_at": "2022-12-19T20:30:18.043595Z"}], "thread_id": "Thread-3", "execution_time": 0.012427091598510742, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.asana_source.stg_asana__task_follower_tmp"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-12-19T20:30:18.035827Z", "completed_at": "2022-12-19T20:30:18.043186Z"}, {"name": "execute", "started_at": "2022-12-19T20:30:18.044051Z", "completed_at": "2022-12-19T20:30:18.044054Z"}], "thread_id": "Thread-4", "execution_time": 0.012683868408203125, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.asana_source.stg_asana__task_section_tmp"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-12-19T20:30:18.035922Z", "completed_at": "2022-12-19T20:30:18.043342Z"}, {"name": "execute", "started_at": "2022-12-19T20:30:18.044417Z", "completed_at": "2022-12-19T20:30:18.044421Z"}], "thread_id": "Thread-2", "execution_time": 0.012848854064941406, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.asana_source.stg_asana__task_tag_tmp"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-12-19T20:30:18.046760Z", "completed_at": "2022-12-19T20:30:18.054186Z"}, {"name": "execute", "started_at": "2022-12-19T20:30:18.054749Z", "completed_at": "2022-12-19T20:30:18.054755Z"}], "thread_id": "Thread-1", "execution_time": 0.009810924530029297, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.asana_source.stg_asana__task_tmp"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-12-19T20:30:18.051129Z", "completed_at": "2022-12-19T20:30:18.054286Z"}, {"name": "execute", "started_at": "2022-12-19T20:30:18.054899Z", "completed_at": "2022-12-19T20:30:18.054901Z"}], "thread_id": "Thread-2", "execution_time": 0.009025812149047852, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.asana_integration_tests.project_data"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-12-19T20:30:18.046915Z", "completed_at": "2022-12-19T20:30:18.054355Z"}, {"name": "execute", "started_at": "2022-12-19T20:30:18.054971Z", "completed_at": "2022-12-19T20:30:18.054975Z"}], "thread_id": "Thread-3", "execution_time": 0.010025978088378906, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.asana_source.stg_asana__team_tmp"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-12-19T20:30:18.049107Z", "completed_at": "2022-12-19T20:30:18.054516Z"}, {"name": "execute", "started_at": "2022-12-19T20:30:18.055350Z", "completed_at": "2022-12-19T20:30:18.055353Z"}], "thread_id": "Thread-4", "execution_time": 0.0100250244140625, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.asana_source.stg_asana__user_tmp"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-12-19T20:30:18.058026Z", "completed_at": "2022-12-19T20:30:18.061956Z"}, {"name": "execute", "started_at": "2022-12-19T20:30:18.063387Z", "completed_at": "2022-12-19T20:30:18.063391Z"}], "thread_id": "Thread-1", "execution_time": 0.007185935974121094, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.asana_integration_tests.project_task_data"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-12-19T20:30:18.058167Z", "completed_at": "2022-12-19T20:30:18.062919Z"}, {"name": "execute", "started_at": "2022-12-19T20:30:18.063535Z", "completed_at": "2022-12-19T20:30:18.063538Z"}], "thread_id": "Thread-2", "execution_time": 0.007097005844116211, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.asana_integration_tests.section_data"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-12-19T20:30:18.058236Z", "completed_at": "2022-12-19T20:30:18.063006Z"}, {"name": "execute", "started_at": "2022-12-19T20:30:18.063618Z", "completed_at": "2022-12-19T20:30:18.063622Z"}], "thread_id": "Thread-3", "execution_time": 0.0071489810943603516, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.asana_integration_tests.story_data"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-12-19T20:30:18.059945Z", "completed_at": "2022-12-19T20:30:18.063167Z"}, {"name": "execute", "started_at": "2022-12-19T20:30:18.064029Z", "completed_at": "2022-12-19T20:30:18.064033Z"}], "thread_id": "Thread-4", "execution_time": 0.007268190383911133, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.asana_integration_tests.tag_data"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-12-19T20:30:18.066666Z", "completed_at": "2022-12-19T20:30:18.070022Z"}, {"name": "execute", "started_at": "2022-12-19T20:30:18.072273Z", "completed_at": "2022-12-19T20:30:18.072278Z"}], "thread_id": "Thread-1", "execution_time": 0.007424116134643555, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.asana_integration_tests.task_data"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-12-19T20:30:18.066826Z", "completed_at": "2022-12-19T20:30:18.071777Z"}, {"name": "execute", "started_at": "2022-12-19T20:30:18.072442Z", "completed_at": "2022-12-19T20:30:18.072444Z"}], "thread_id": "Thread-2", "execution_time": 0.007418155670166016, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.asana_integration_tests.task_follower_data"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-12-19T20:30:18.066898Z", "completed_at": "2022-12-19T20:30:18.071870Z"}, {"name": "execute", "started_at": "2022-12-19T20:30:18.072516Z", "completed_at": "2022-12-19T20:30:18.072518Z"}], "thread_id": "Thread-3", "execution_time": 0.007352113723754883, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.asana_integration_tests.task_section_data"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-12-19T20:30:18.067983Z", "completed_at": "2022-12-19T20:30:18.072038Z"}, {"name": "execute", "started_at": "2022-12-19T20:30:18.072902Z", "completed_at": "2022-12-19T20:30:18.072904Z"}], "thread_id": "Thread-4", "execution_time": 0.007397890090942383, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.asana_integration_tests.task_tag_data"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-12-19T20:30:18.075489Z", "completed_at": "2022-12-19T20:30:18.083546Z"}, {"name": "execute", "started_at": "2022-12-19T20:30:18.088039Z", "completed_at": "2022-12-19T20:30:18.088045Z"}], "thread_id": "Thread-1", "execution_time": 0.014415979385375977, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.asana_integration_tests.team_data"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-12-19T20:30:18.075629Z", "completed_at": "2022-12-19T20:30:18.087498Z"}, {"name": "execute", "started_at": "2022-12-19T20:30:18.088224Z", "completed_at": "2022-12-19T20:30:18.088228Z"}], "thread_id": "Thread-2", "execution_time": 0.014513969421386719, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.asana_integration_tests.user_data"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-12-19T20:30:18.075695Z", "completed_at": "2022-12-19T20:30:18.392098Z"}, {"name": "execute", "started_at": "2022-12-19T20:30:18.392790Z", "completed_at": "2022-12-19T20:30:18.392792Z"}], "thread_id": "Thread-3", "execution_time": 0.34299707412719727, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.asana_source.stg_asana__project_task"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-12-19T20:30:18.090213Z", "completed_at": "2022-12-19T20:30:18.391536Z"}, {"name": "execute", "started_at": "2022-12-19T20:30:18.392557Z", "completed_at": "2022-12-19T20:30:18.392564Z"}], "thread_id": "Thread-2", "execution_time": 0.32834672927856445, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.asana_source.stg_asana__project"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-12-19T20:30:18.076764Z", "completed_at": "2022-12-19T20:30:18.391999Z"}, {"name": "execute", "started_at": "2022-12-19T20:30:18.392719Z", "completed_at": "2022-12-19T20:30:18.392721Z"}], "thread_id": "Thread-4", "execution_time": 0.3481431007385254, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.asana_source.stg_asana__section"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-12-19T20:30:18.090120Z", "completed_at": "2022-12-19T20:30:18.391860Z"}, {"name": "execute", "started_at": "2022-12-19T20:30:18.392642Z", "completed_at": "2022-12-19T20:30:18.392645Z"}], "thread_id": "Thread-1", "execution_time": 0.33742570877075195, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.asana_source.stg_asana__story"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-12-19T20:30:18.419448Z", "completed_at": "2022-12-19T20:30:18.683971Z"}, {"name": "execute", "started_at": "2022-12-19T20:30:18.684156Z", "completed_at": "2022-12-19T20:30:18.684162Z"}], "thread_id": "Thread-2", "execution_time": 0.2893688678741455, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.asana_source.stg_asana__task_follower"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-12-19T20:30:18.419320Z", "completed_at": "2022-12-19T20:30:18.694768Z"}, {"name": "execute", "started_at": "2022-12-19T20:30:18.695154Z", "completed_at": "2022-12-19T20:30:18.695161Z"}], "thread_id": "Thread-3", "execution_time": 0.30025529861450195, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.asana_source.stg_asana__tag"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-12-19T20:30:18.428887Z", "completed_at": "2022-12-19T20:30:18.745639Z"}, {"name": "execute", "started_at": "2022-12-19T20:30:18.746011Z", "completed_at": "2022-12-19T20:30:18.746017Z"}], "thread_id": "Thread-1", "execution_time": 0.3453667163848877, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.asana_source.stg_asana__task_tag"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-12-19T20:30:18.428803Z", "completed_at": "2022-12-19T20:30:18.745754Z"}, {"name": "execute", "started_at": "2022-12-19T20:30:18.746091Z", "completed_at": "2022-12-19T20:30:18.746093Z"}], "thread_id": "Thread-4", "execution_time": 0.3460516929626465, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.asana_source.stg_asana__task_section"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-12-19T20:30:18.775277Z", "completed_at": "2022-12-19T20:30:18.785728Z"}, {"name": "execute", "started_at": "2022-12-19T20:30:18.785998Z", "completed_at": "2022-12-19T20:30:18.786005Z"}], "thread_id": "Thread-4", "execution_time": 0.011683225631713867, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.asana_source.not_null_stg_asana__project_project_id.d27dae84fa"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-12-19T20:30:18.787024Z", "completed_at": "2022-12-19T20:30:18.789950Z"}, {"name": "execute", "started_at": "2022-12-19T20:30:18.790131Z", "completed_at": "2022-12-19T20:30:18.790137Z"}], "thread_id": "Thread-4", "execution_time": 0.0037539005279541016, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.asana_source.not_null_stg_asana__project_task_project_id.e2450d16b1"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-12-19T20:30:18.790991Z", "completed_at": "2022-12-19T20:30:18.794404Z"}, {"name": "execute", "started_at": "2022-12-19T20:30:18.794586Z", "completed_at": "2022-12-19T20:30:18.794591Z"}], "thread_id": "Thread-4", "execution_time": 0.004164934158325195, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.asana_source.not_null_stg_asana__project_task_task_id.9479566014"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-12-19T20:30:18.795404Z", "completed_at": "2022-12-19T20:30:18.799394Z"}, {"name": "execute", "started_at": "2022-12-19T20:30:18.799597Z", "completed_at": "2022-12-19T20:30:18.799602Z"}], "thread_id": "Thread-4", "execution_time": 0.004752159118652344, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.asana_source.unique_stg_asana__project_project_id.67bfab1228"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-12-19T20:30:18.800572Z", "completed_at": "2022-12-19T20:30:18.803443Z"}, {"name": "execute", "started_at": "2022-12-19T20:30:18.803598Z", "completed_at": "2022-12-19T20:30:18.803604Z"}], "thread_id": "Thread-4", "execution_time": 0.0036470890045166016, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.asana_source.not_null_stg_asana__section_section_id.389ebce958"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-12-19T20:30:18.804397Z", "completed_at": "2022-12-19T20:30:18.806941Z"}, {"name": "execute", "started_at": "2022-12-19T20:30:18.807100Z", "completed_at": "2022-12-19T20:30:18.807105Z"}], "thread_id": "Thread-4", "execution_time": 0.003226041793823242, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.asana_source.unique_stg_asana__section_section_id.0495dd3d2f"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-12-19T20:30:18.808057Z", "completed_at": "2022-12-19T20:30:18.810784Z"}, {"name": "execute", "started_at": "2022-12-19T20:30:18.810951Z", "completed_at": "2022-12-19T20:30:18.810956Z"}], "thread_id": "Thread-4", "execution_time": 0.0035948753356933594, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.asana_source.not_null_stg_asana__story_story_id.ca847d0848"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-12-19T20:30:18.811797Z", "completed_at": "2022-12-19T20:30:18.814658Z"}, {"name": "execute", "started_at": "2022-12-19T20:30:18.814834Z", "completed_at": "2022-12-19T20:30:18.814839Z"}], "thread_id": "Thread-4", "execution_time": 0.003612995147705078, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.asana_source.not_null_stg_asana__story_target_task_id.3f971de06e"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-12-19T20:30:18.815724Z", "completed_at": "2022-12-19T20:30:18.818447Z"}, {"name": "execute", "started_at": "2022-12-19T20:30:18.818631Z", "completed_at": "2022-12-19T20:30:18.818635Z"}], "thread_id": "Thread-4", "execution_time": 0.004312992095947266, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.asana_source.unique_stg_asana__story_story_id.414f25bb84"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-12-19T20:30:18.820357Z", "completed_at": "2022-12-19T20:30:18.823124Z"}, {"name": "execute", "started_at": "2022-12-19T20:30:18.823298Z", "completed_at": "2022-12-19T20:30:18.823303Z"}], "thread_id": "Thread-4", "execution_time": 0.0035321712493896484, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.asana_source.not_null_stg_asana__task_follower_task_id.5af35f322c"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-12-19T20:30:18.824254Z", "completed_at": "2022-12-19T20:30:18.826923Z"}, {"name": "execute", "started_at": "2022-12-19T20:30:18.827105Z", "completed_at": "2022-12-19T20:30:18.827110Z"}], "thread_id": "Thread-4", "execution_time": 0.0034668445587158203, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.asana_source.not_null_stg_asana__task_follower_user_id.e0aea0b15e"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-12-19T20:30:18.828050Z", "completed_at": "2022-12-19T20:30:18.831071Z"}, {"name": "execute", "started_at": "2022-12-19T20:30:18.831244Z", "completed_at": "2022-12-19T20:30:18.831250Z"}], "thread_id": "Thread-4", "execution_time": 0.0038399696350097656, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.asana_source.not_null_stg_asana__tag_tag_id.c6a8187ca2"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-12-19T20:30:18.832123Z", "completed_at": "2022-12-19T20:30:18.834817Z"}, {"name": "execute", "started_at": "2022-12-19T20:30:18.834973Z", "completed_at": "2022-12-19T20:30:18.834977Z"}], "thread_id": "Thread-4", "execution_time": 0.0034132003784179688, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.asana_source.unique_stg_asana__tag_tag_id.fd78b190c7"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-12-19T20:30:18.840837Z", "completed_at": "2022-12-19T20:30:18.844367Z"}, {"name": "execute", "started_at": "2022-12-19T20:30:18.844544Z", "completed_at": "2022-12-19T20:30:18.844550Z"}], "thread_id": "Thread-4", "execution_time": 0.004251956939697266, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.asana_source.not_null_stg_asana__task_tag_tag_id.d523de41d8"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-12-19T20:30:18.845359Z", "completed_at": "2022-12-19T20:30:18.848391Z"}, {"name": "execute", "started_at": "2022-12-19T20:30:18.848562Z", "completed_at": "2022-12-19T20:30:18.848567Z"}], "thread_id": "Thread-4", "execution_time": 0.0037429332733154297, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.asana_source.not_null_stg_asana__task_tag_task_id.9d27624748"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-12-19T20:30:18.855505Z", "completed_at": "2022-12-19T20:30:18.858577Z"}, {"name": "execute", "started_at": "2022-12-19T20:30:18.858767Z", "completed_at": "2022-12-19T20:30:18.858773Z"}], "thread_id": "Thread-4", "execution_time": 0.004271745681762695, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.asana_source.not_null_stg_asana__task_section_section_id.b0977a4cfe"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-12-19T20:30:18.859688Z", "completed_at": "2022-12-19T20:30:18.862808Z"}, {"name": "execute", "started_at": "2022-12-19T20:30:18.862993Z", "completed_at": "2022-12-19T20:30:18.862999Z"}], "thread_id": "Thread-4", "execution_time": 0.003960132598876953, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.asana_source.not_null_stg_asana__task_section_task_id.ab81301de8"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-12-19T20:30:18.863927Z", "completed_at": "2022-12-19T20:30:18.870918Z"}, {"name": "execute", "started_at": "2022-12-19T20:30:18.871113Z", "completed_at": "2022-12-19T20:30:18.871118Z"}], "thread_id": "Thread-4", "execution_time": 0.00780797004699707, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.asana.not_null_int_asana__task_tags_task_id.34eec2b834"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-12-19T20:30:18.872166Z", "completed_at": "2022-12-19T20:30:18.877199Z"}, {"name": "execute", "started_at": "2022-12-19T20:30:18.877375Z", "completed_at": "2022-12-19T20:30:18.877380Z"}], "thread_id": "Thread-4", "execution_time": 0.0058879852294921875, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.asana.unique_int_asana__task_tags_task_id.f28aff2685"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-12-19T20:30:18.878364Z", "completed_at": "2022-12-19T20:30:18.881931Z"}, {"name": "execute", "started_at": "2022-12-19T20:30:18.882111Z", "completed_at": "2022-12-19T20:30:18.882116Z"}], "thread_id": "Thread-4", "execution_time": 0.0044171810150146484, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.asana.not_null_int_asana__task_projects_task_id.322519ee10"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-12-19T20:30:18.883142Z", "completed_at": "2022-12-19T20:30:18.887693Z"}, {"name": "execute", "started_at": "2022-12-19T20:30:18.887900Z", "completed_at": "2022-12-19T20:30:18.887906Z"}], "thread_id": "Thread-4", "execution_time": 0.00548100471496582, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.asana.unique_int_asana__task_projects_task_id.8a6b2f262d"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-12-19T20:30:18.708779Z", "completed_at": "2022-12-19T20:30:18.985072Z"}, {"name": "execute", "started_at": "2022-12-19T20:30:18.985257Z", "completed_at": "2022-12-19T20:30:18.985263Z"}], "thread_id": "Thread-2", "execution_time": 0.30473875999450684, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.asana_source.stg_asana__task"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-12-19T20:30:19.014321Z", "completed_at": "2022-12-19T20:30:19.020372Z"}, {"name": "execute", "started_at": "2022-12-19T20:30:19.020705Z", "completed_at": "2022-12-19T20:30:19.020710Z"}], "thread_id": "Thread-4", "execution_time": 0.007362842559814453, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.asana_source.not_null_stg_asana__task_task_id.924cc69000"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-12-19T20:30:19.017102Z", "completed_at": "2022-12-19T20:30:19.020475Z"}, {"name": "execute", "started_at": "2022-12-19T20:30:19.020783Z", "completed_at": "2022-12-19T20:30:19.020785Z"}], "thread_id": "Thread-2", "execution_time": 0.007225751876831055, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.asana_source.unique_stg_asana__task_task_id.a5271275a5"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-12-19T20:30:18.719533Z", "completed_at": "2022-12-19T20:30:18.999563Z"}, {"name": "execute", "started_at": "2022-12-19T20:30:18.999727Z", "completed_at": "2022-12-19T20:30:18.999732Z"}], "thread_id": "Thread-3", "execution_time": 0.3071732521057129, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.asana_source.stg_asana__team"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-12-19T20:30:19.027474Z", "completed_at": "2022-12-19T20:30:19.032902Z"}, {"name": "execute", "started_at": "2022-12-19T20:30:19.033173Z", "completed_at": "2022-12-19T20:30:19.033178Z"}], "thread_id": "Thread-4", "execution_time": 0.006721019744873047, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.asana_source.not_null_stg_asana__team_team_id.e12b563474"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-12-19T20:30:19.027570Z", "completed_at": "2022-12-19T20:30:19.033092Z"}, {"name": "execute", "started_at": "2022-12-19T20:30:19.033657Z", "completed_at": "2022-12-19T20:30:19.033661Z"}], "thread_id": "Thread-2", "execution_time": 0.006891965866088867, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.asana_source.unique_stg_asana__team_team_id.111fe15873"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-12-19T20:30:18.774977Z", "completed_at": "2022-12-19T20:30:19.042398Z"}, {"name": "execute", "started_at": "2022-12-19T20:30:19.042561Z", "completed_at": "2022-12-19T20:30:19.042566Z"}], "thread_id": "Thread-1", "execution_time": 0.2954528331756592, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.asana_source.stg_asana__user"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-12-19T20:30:19.075018Z", "completed_at": "2022-12-19T20:30:19.086679Z"}, {"name": "execute", "started_at": "2022-12-19T20:30:19.088185Z", "completed_at": "2022-12-19T20:30:19.088194Z"}], "thread_id": "Thread-1", "execution_time": 0.01748204231262207, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.asana_source.not_null_stg_asana__user_user_id.4e900e8ec6"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-12-19T20:30:19.088505Z", "completed_at": "2022-12-19T20:30:19.104680Z"}, {"name": "execute", "started_at": "2022-12-19T20:30:19.112220Z", "completed_at": "2022-12-19T20:30:19.112226Z"}], "thread_id": "Thread-3", "execution_time": 0.029633045196533203, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.asana_source.unique_stg_asana__user_user_id.73808d6267"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-12-19T20:30:19.111866Z", "completed_at": "2022-12-19T20:30:19.117343Z"}, {"name": "execute", "started_at": "2022-12-19T20:30:19.118589Z", "completed_at": "2022-12-19T20:30:19.118595Z"}], "thread_id": "Thread-1", "execution_time": 0.026847124099731445, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.asana.not_null_int_asana__task_assignee_task_id.a9c81bd443"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-12-19T20:30:19.118869Z", "completed_at": "2022-12-19T20:30:19.132893Z"}, {"name": "execute", "started_at": "2022-12-19T20:30:19.133717Z", "completed_at": "2022-12-19T20:30:19.133723Z"}], "thread_id": "Thread-2", "execution_time": 0.021615266799926758, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.asana.not_null_int_asana__task_followers_task_id.6791bf2573"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-12-19T20:30:19.118774Z", "completed_at": "2022-12-19T20:30:19.133003Z"}, {"name": "execute", "started_at": "2022-12-19T20:30:19.133803Z", "completed_at": "2022-12-19T20:30:19.133805Z"}], "thread_id": "Thread-4", "execution_time": 0.022230863571166992, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.asana.unique_int_asana__task_assignee_task_id.b4e2ea04e1"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-12-19T20:30:19.119400Z", "completed_at": "2022-12-19T20:30:19.133289Z"}, {"name": "execute", "started_at": "2022-12-19T20:30:19.139128Z", "completed_at": "2022-12-19T20:30:19.139133Z"}], "thread_id": "Thread-3", "execution_time": 0.021937131881713867, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.asana.unique_int_asana__task_followers_task_id.eeb3667df9"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-12-19T20:30:19.142543Z", "completed_at": "2022-12-19T20:30:19.174968Z"}, {"name": "execute", "started_at": "2022-12-19T20:30:19.176253Z", "completed_at": "2022-12-19T20:30:19.176258Z"}], "thread_id": "Thread-3", "execution_time": 0.035479068756103516, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.asana.not_null_int_asana__task_story_story_id.1ffdb99927"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-12-19T20:30:19.169996Z", "completed_at": "2022-12-19T20:30:19.175730Z"}, {"name": "execute", "started_at": "2022-12-19T20:30:19.177060Z", "completed_at": "2022-12-19T20:30:19.177064Z"}], "thread_id": "Thread-1", "execution_time": 0.03528189659118652, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.asana.unique_int_asana__task_story_story_id.92d7adbcf6"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-12-19T20:30:19.177237Z", "completed_at": "2022-12-19T20:30:19.190188Z"}, {"name": "execute", "started_at": "2022-12-19T20:30:19.194740Z", "completed_at": "2022-12-19T20:30:19.194747Z"}], "thread_id": "Thread-2", "execution_time": 0.023612022399902344, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.asana.dbt_utils_unique_combination_of_columns_int_asana__project_user_project_id__user_id__role__currently_working_on.f9493098e0"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-12-19T20:30:19.177720Z", "completed_at": "2022-12-19T20:30:19.190384Z"}, {"name": "execute", "started_at": "2022-12-19T20:30:19.194897Z", "completed_at": "2022-12-19T20:30:19.194902Z"}], "thread_id": "Thread-4", "execution_time": 0.02353692054748535, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.asana.not_null_int_asana__subtask_parent_subtask_id.024565c768"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-12-19T20:30:19.190280Z", "completed_at": "2022-12-19T20:30:19.199719Z"}, {"name": "execute", "started_at": "2022-12-19T20:30:19.200860Z", "completed_at": "2022-12-19T20:30:19.200865Z"}], "thread_id": "Thread-3", "execution_time": 0.015592098236083984, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.asana.unique_int_asana__subtask_parent_subtask_id.641dfb3c8f"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-12-19T20:30:19.194654Z", "completed_at": "2022-12-19T20:30:19.200490Z"}, {"name": "execute", "started_at": "2022-12-19T20:30:19.201739Z", "completed_at": "2022-12-19T20:30:19.201743Z"}], "thread_id": "Thread-1", "execution_time": 0.012421846389770508, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.asana.not_null_int_asana__task_comments_task_id.6986f1d77f"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-12-19T20:30:19.201824Z", "completed_at": "2022-12-19T20:30:19.211202Z"}, {"name": "execute", "started_at": "2022-12-19T20:30:19.215847Z", "completed_at": "2022-12-19T20:30:19.215854Z"}], "thread_id": "Thread-2", "execution_time": 0.01574397087097168, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.asana.unique_int_asana__task_comments_task_id.f012fa6a04"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-12-19T20:30:19.202026Z", "completed_at": "2022-12-19T20:30:19.215362Z"}, {"name": "execute", "started_at": "2022-12-19T20:30:19.216083Z", "completed_at": "2022-12-19T20:30:19.216087Z"}], "thread_id": "Thread-4", "execution_time": 0.03254294395446777, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.asana.not_null_int_asana__task_first_modifier_task_id.495738ff52"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-12-19T20:30:19.211315Z", "completed_at": "2022-12-19T20:30:19.216011Z"}, {"name": "execute", "started_at": "2022-12-19T20:30:19.233884Z", "completed_at": "2022-12-19T20:30:19.233890Z"}], "thread_id": "Thread-3", "execution_time": 0.027935028076171875, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.asana.unique_int_asana__task_first_modifier_task_id.59583c6dc2"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-12-19T20:30:19.215947Z", "completed_at": "2022-12-19T20:30:19.234176Z"}, {"name": "execute", "started_at": "2022-12-19T20:30:19.235272Z", "completed_at": "2022-12-19T20:30:19.235275Z"}], "thread_id": "Thread-1", "execution_time": 0.024651050567626953, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.asana.asana__task"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-12-19T20:30:19.235409Z", "completed_at": "2022-12-19T20:30:19.244785Z"}, {"name": "execute", "started_at": "2022-12-19T20:30:19.250951Z", "completed_at": "2022-12-19T20:30:19.250961Z"}], "thread_id": "Thread-4", "execution_time": 0.019701004028320312, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.asana.unique_int_asana__task_open_length_task_id.f26c49b044"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-12-19T20:30:19.235341Z", "completed_at": "2022-12-19T20:30:19.244936Z"}, {"name": "execute", "started_at": "2022-12-19T20:30:19.254107Z", "completed_at": "2022-12-19T20:30:19.254112Z"}], "thread_id": "Thread-2", "execution_time": 0.02060389518737793, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.asana.not_null_int_asana__task_open_length_task_id.23bb23b2e9"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-12-19T20:30:19.245204Z", "completed_at": "2022-12-19T20:30:19.255102Z"}, {"name": "execute", "started_at": "2022-12-19T20:30:19.256134Z", "completed_at": "2022-12-19T20:30:19.256138Z"}], "thread_id": "Thread-1", "execution_time": 0.012163877487182617, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.asana.asana__tag"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-12-19T20:30:19.263676Z", "completed_at": "2022-12-19T20:30:19.267842Z"}, {"name": "execute", "started_at": "2022-12-19T20:30:19.268680Z", "completed_at": "2022-12-19T20:30:19.268685Z"}], "thread_id": "Thread-1", "execution_time": 0.006042003631591797, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.asana.not_null_asana__task_task_id.6d36eb2cd0"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-12-19T20:30:19.268770Z", "completed_at": "2022-12-19T20:30:19.275072Z"}, {"name": "execute", "started_at": "2022-12-19T20:30:19.277897Z", "completed_at": "2022-12-19T20:30:19.277904Z"}], "thread_id": "Thread-4", "execution_time": 0.010452032089233398, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.asana.unique_asana__task_task_id.ebfe331df1"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-12-19T20:30:19.268854Z", "completed_at": "2022-12-19T20:30:19.275150Z"}, {"name": "execute", "started_at": "2022-12-19T20:30:19.278019Z", "completed_at": "2022-12-19T20:30:19.278024Z"}], "thread_id": "Thread-2", "execution_time": 0.010528802871704102, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.asana.not_null_asana__tag_tag_id.593d626953"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-12-19T20:30:19.275004Z", "completed_at": "2022-12-19T20:30:19.278099Z"}, {"name": "execute", "started_at": "2022-12-19T20:30:19.279263Z", "completed_at": "2022-12-19T20:30:19.279267Z"}], "thread_id": "Thread-1", "execution_time": 0.005504131317138672, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.asana.unique_asana__tag_tag_id.46c0d2510f"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-12-19T20:30:19.280580Z", "completed_at": "2022-12-19T20:30:19.338902Z"}, {"name": "execute", "started_at": "2022-12-19T20:30:19.339239Z", "completed_at": "2022-12-19T20:30:19.339245Z"}], "thread_id": "Thread-2", "execution_time": 0.06021404266357422, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.asana.not_null_int_asana__project_task_metrics_project_id.804fd1daf3"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-12-19T20:30:19.280490Z", "completed_at": "2022-12-19T20:30:19.339178Z"}, {"name": "execute", "started_at": "2022-12-19T20:30:19.339983Z", "completed_at": "2022-12-19T20:30:19.339987Z"}], "thread_id": "Thread-4", "execution_time": 0.061228036880493164, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.asana.asana__project"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-12-19T20:30:19.334769Z", "completed_at": "2022-12-19T20:30:19.339529Z"}, {"name": "execute", "started_at": "2022-12-19T20:30:19.340790Z", "completed_at": "2022-12-19T20:30:19.340793Z"}], "thread_id": "Thread-1", "execution_time": 0.06091809272766113, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.asana.unique_int_asana__project_task_metrics_project_id.049cc9b8a6"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-12-19T20:30:19.342257Z", "completed_at": "2022-12-19T20:30:19.363391Z"}, {"name": "execute", "started_at": "2022-12-19T20:30:19.363769Z", "completed_at": "2022-12-19T20:30:19.363776Z"}], "thread_id": "Thread-2", "execution_time": 0.023368120193481445, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.asana.asana__user"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-12-19T20:30:19.355285Z", "completed_at": "2022-12-19T20:30:19.363651Z"}, {"name": "execute", "started_at": "2022-12-19T20:30:19.364447Z", "completed_at": "2022-12-19T20:30:19.364451Z"}], "thread_id": "Thread-4", "execution_time": 0.023162841796875, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.asana.not_null_int_asana__user_task_metrics_user_id.54eae7d721"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-12-19T20:30:19.359221Z", "completed_at": "2022-12-19T20:30:19.363968Z"}, {"name": "execute", "started_at": "2022-12-19T20:30:19.365123Z", "completed_at": "2022-12-19T20:30:19.365127Z"}], "thread_id": "Thread-1", "execution_time": 0.023219823837280273, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.asana.unique_int_asana__user_task_metrics_user_id.06a6a270b8"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-12-19T20:30:19.366175Z", "completed_at": "2022-12-19T20:30:19.375161Z"}, {"name": "execute", "started_at": "2022-12-19T20:30:19.375495Z", "completed_at": "2022-12-19T20:30:19.375501Z"}], "thread_id": "Thread-2", "execution_time": 0.010675907135009766, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.asana.asana__team"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-12-19T20:30:19.370259Z", "completed_at": "2022-12-19T20:30:19.375394Z"}, {"name": "execute", "started_at": "2022-12-19T20:30:19.376048Z", "completed_at": "2022-12-19T20:30:19.376053Z"}], "thread_id": "Thread-4", "execution_time": 0.010725736618041992, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.asana.not_null_asana__project_project_id.78420e1b45"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-12-19T20:30:19.372797Z", "completed_at": "2022-12-19T20:30:19.375634Z"}, {"name": "execute", "started_at": "2022-12-19T20:30:19.376729Z", "completed_at": "2022-12-19T20:30:19.376733Z"}], "thread_id": "Thread-1", "execution_time": 0.01095890998840332, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.asana.unique_asana__project_project_id.66a76364ef"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-12-19T20:30:19.377849Z", "completed_at": "2022-12-19T20:30:19.385890Z"}, {"name": "execute", "started_at": "2022-12-19T20:30:19.386218Z", "completed_at": "2022-12-19T20:30:19.386224Z"}], "thread_id": "Thread-2", "execution_time": 0.009798288345336914, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.asana.not_null_asana__user_user_id.eb9cd93a43"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-12-19T20:30:19.380806Z", "completed_at": "2022-12-19T20:30:19.386126Z"}, {"name": "execute", "started_at": "2022-12-19T20:30:19.386746Z", "completed_at": "2022-12-19T20:30:19.386749Z"}], "thread_id": "Thread-4", "execution_time": 0.009672880172729492, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.asana.unique_asana__user_user_id.3c4b63387e"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-12-19T20:30:19.383355Z", "completed_at": "2022-12-19T20:30:19.386369Z"}, {"name": "execute", "started_at": "2022-12-19T20:30:19.387257Z", "completed_at": "2022-12-19T20:30:19.387260Z"}], "thread_id": "Thread-1", "execution_time": 0.0097808837890625, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.asana.not_null_asana__team_team_id.cd6b6c88bf"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-12-19T20:30:19.388057Z", "completed_at": "2022-12-19T20:30:19.391633Z"}, {"name": "execute", "started_at": "2022-12-19T20:30:19.391806Z", "completed_at": "2022-12-19T20:30:19.391811Z"}], "thread_id": "Thread-2", "execution_time": 0.0046999454498291016, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.asana.unique_asana__team_team_id.ada6b5e093"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-12-19T20:30:19.245023Z", "completed_at": "2022-12-19T20:30:19.535417Z"}, {"name": "execute", "started_at": "2022-12-19T20:30:19.535597Z", "completed_at": "2022-12-19T20:30:19.535603Z"}], "thread_id": "Thread-3", "execution_time": 0.31718921661376953, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.asana.asana__daily_metrics"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-12-19T20:30:19.562868Z", "completed_at": "2022-12-19T20:30:19.568654Z"}, {"name": "execute", "started_at": "2022-12-19T20:30:19.568838Z", "completed_at": "2022-12-19T20:30:19.568843Z"}], "thread_id": "Thread-1", "execution_time": 0.006754875183105469, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.asana.unique_asana__daily_metrics_date_day.e8d67f545d"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-12-19T20:30:19.562775Z", "completed_at": "2022-12-19T20:30:19.569269Z"}, {"name": "execute", "started_at": "2022-12-19T20:30:19.569446Z", "completed_at": "2022-12-19T20:30:19.569450Z"}], "thread_id": "Thread-4", "execution_time": 0.007669925689697266, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.asana.not_null_asana__daily_metrics_date_day.363a2a09cf"}], "elapsed_time": 2.487039089202881, "args": {"write_json": true, "use_colors": true, "printer_width": 80, "version_check": true, "partial_parse": true, "static_parser": true, "profiles_dir": "/Users/joseph.markiewicz/.dbt", "send_anonymous_usage_stats": true, "event_buffer_size": 100000, "quiet": false, "no_print": false, "target": "postgres", "compile": true, "which": "generate", "rpc_method": "docs.generate", "indirect_selection": "eager"}} \ No newline at end of file diff --git a/integration_tests/ci/sample.profiles.yml b/integration_tests/ci/sample.profiles.yml index 39fd5a1..07777f0 100644 --- a/integration_tests/ci/sample.profiles.yml +++ b/integration_tests/ci/sample.profiles.yml @@ -1,5 +1,5 @@ -# HEY! This file is used in the asana integrations tests with CircleCI. +# HEY! This file is used in the dbt package integrations tests with Buildkite. # You should __NEVER__ check credentials into version control. Thanks for reading :) config: @@ -7,7 +7,7 @@ config: use_colors: True integration_tests: - target: snowflake + target: redshift outputs: redshift: type: redshift @@ -20,11 +20,11 @@ integration_tests: threads: 8 bigquery: type: bigquery - method: service-account - keyfile: "{{ env_var('GCLOUD_SERVICE_KEY_PATH') }}" + method: service-account-json project: 'dbt-package-testing' schema: asana_integrations_tests threads: 8 + keyfile_json: "{{ env_var('GCLOUD_SERVICE_KEY') | as_native }}" snowflake: type: snowflake account: "{{ env_var('CI_SNOWFLAKE_DBT_ACCOUNT') }}" @@ -39,10 +39,16 @@ integration_tests: type: postgres host: "{{ env_var('CI_POSTGRES_DBT_HOST') }}" user: "{{ env_var('CI_POSTGRES_DBT_USER') }}" - password: "{{ env_var('CI_POSTGRES_DBT_PASS') }}" + pass: "{{ env_var('CI_POSTGRES_DBT_PASS') }}" + dbname: "{{ env_var('CI_POSTGRES_DBT_DBNAME') }}" port: 5432 - dbname: "{{ env_var('CI_POSTGRES_DBT_DATABASE') }}" schema: asana_integrations_tests threads: 8 - keepalives_idle: 0 - sslmode: prefer \ No newline at end of file + databricks: + catalog: null + host: "{{ env_var('CI_DATABRICKS_DBT_HOST') }}" + http_path: "{{ env_var('CI_DATABRICKS_DBT_HTTP_PATH') }}" + schema: asana_integrations_tests + threads: 2 + token: "{{ env_var('CI_DATABRICKS_DBT_TOKEN') }}" + type: databricks \ No newline at end of file diff --git a/integration_tests/dbt_project.yml b/integration_tests/dbt_project.yml index 2de9234..dba2333 100644 --- a/integration_tests/dbt_project.yml +++ b/integration_tests/dbt_project.yml @@ -1,24 +1,21 @@ config-version: 2 - name: 'asana_integration_tests' -version: '0.6.0' -profile: 'integration_tests' - +version: '0.7.0' +profile: 'integration_tests' vars: asana_schema: asana_integrations_tests asana_source: - asana_user_identifier: "user_data" - asana_project_identifier: "project_data" - asana_task_identifier: "task_data" - asana_story_identifier: "story_data" - asana_team_identifier: "team_data" - asana_tag_identifier: "tag_data" - asana_project_task_identifier: "project_task_data" - asana_task_follower_identifier: "task_follower_data" - asana_task_tag_identifier: "task_tag_data" - asana_section_identifier: "section_data" - asana_task_section_identifier: "task_section_data" - + asana_user_identifier: "user_data" + asana_project_identifier: "project_data" + asana_task_identifier: "task_data" + asana_story_identifier: "story_data" + asana_team_identifier: "team_data" + asana_tag_identifier: "tag_data" + asana_project_task_identifier: "project_task_data" + asana_task_follower_identifier: "task_follower_data" + 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_integration_tests: @@ -51,7 +48,7 @@ seeds: +column_types: id: "{{ 'int64' if target.type == 'bigquery' else 'bigint' }}" created_by_id: "{{ 'int64' if target.type == 'bigquery' else 'bigint' }}" - target_id: "{{ 'int64' if target.type == 'bigquery' else 'bigint' }}" + target_id: "{{ 'int64' if target.type == 'bigquery' else 'bigint' }}" team_data: +column_types: id: "{{ 'int64' if target.type == 'bigquery' else 'bigint' }}" @@ -79,4 +76,4 @@ seeds: task_section_data: +column_types: section_id: "{{ 'int64' if target.type == 'bigquery' else 'bigint' }}" - task_id: "{{ 'int64' if target.type == 'bigquery' else 'bigint' }}" \ No newline at end of file + task_id: "{{ 'int64' if target.type == 'bigquery' else 'bigint' }}" diff --git a/integration_tests/requirements.txt b/integration_tests/requirements.txt index 89c6ccb..87ae0f9 100644 --- a/integration_tests/requirements.txt +++ b/integration_tests/requirements.txt @@ -1,6 +1,7 @@ -dbt-snowflake~=1.0.0 -dbt-bigquery~=1.0.0 -dbt-redshift~=1.0.0 -dbt-postgres~=1.0.0 -dbt-spark~=1.0.0 -dbt-spark[PyHive]~=1.0.0 +dbt-snowflake>=1.3.0,<2.0.0 +dbt-bigquery>=1.3.0,<2.0.0 +dbt-redshift>=1.3.0,<2.0.0 +dbt-postgres>=1.3.0,<2.0.0 +dbt-spark>=1.3.0,<2.0.0 +dbt-spark[PyHive]>=1.3.0,<2.0.0 +dbt-databricks>=1.3.0,<2.0.0 \ No newline at end of file diff --git a/models/asana__daily_metrics.sql b/models/asana__daily_metrics.sql index b797077..ebcd662 100644 --- a/models/asana__daily_metrics.sql +++ b/models/asana__daily_metrics.sql @@ -10,7 +10,7 @@ spine as ( {% if execute %} {% set first_date_query %} select - cast(min(created_at) as {{ dbt_utils.type_timestamp() }}) as min_date + cast(min(created_at) as {{ dbt.type_timestamp() }}) as min_date from {{ ref('asana__task') }} {% endset %} {% set first_date = run_query(first_date_query).columns[0][0]|string %} @@ -22,7 +22,7 @@ spine as ( {{ dbt_utils.date_spine( datepart = "day", start_date = "cast('" ~ first_date[0:10] ~ "'as date)", - end_date = dbt_utils.dateadd("week", 1, "current_date") ) + end_date = dbt.dateadd("week", 1, "current_date") ) }} ), @@ -31,18 +31,18 @@ spine_tasks as ( select spine.date_day, - sum( {{ dbt_utils.datediff('task.created_at', 'spine.date_day', 'day') }} ) as total_days_open, + sum( {{ dbt.datediff('task.created_at', 'spine.date_day', 'day') }} ) as total_days_open, count( task.task_id) as number_of_tasks_open, - sum( case when cast(spine.date_day as timestamp) >= {{ dbt_utils.date_trunc('day', 'task.first_assigned_at') }} then 1 else 0 end) as number_of_tasks_open_assigned, - sum( {{ dbt_utils.datediff('task.first_assigned_at', 'spine.date_day', 'day') }} ) as total_days_open_assigned, - sum( case when cast(spine.date_day as timestamp) = {{ dbt_utils.date_trunc('day', 'task.created_at') }} then 1 else 0 end) as number_of_tasks_created, - sum( case when cast(spine.date_day as timestamp) = {{ dbt_utils.date_trunc('day', 'task.completed_at') }} then 1 else 0 end) as number_of_tasks_completed + sum( case when cast(spine.date_day as timestamp) >= {{ dbt.date_trunc('day', 'task.first_assigned_at') }} then 1 else 0 end) as number_of_tasks_open_assigned, + sum( {{ dbt.datediff('task.first_assigned_at', 'spine.date_day', 'day') }} ) as total_days_open_assigned, + sum( case when cast(spine.date_day as timestamp) = {{ dbt.date_trunc('day', 'task.created_at') }} then 1 else 0 end) as number_of_tasks_created, + sum( case when cast(spine.date_day as timestamp) = {{ dbt.date_trunc('day', 'task.completed_at') }} then 1 else 0 end) as number_of_tasks_completed from spine join task -- can't do left join with no = - on cast(spine.date_day as timestamp) >= {{ dbt_utils.date_trunc('day', 'task.created_at') }} + on cast(spine.date_day as timestamp) >= {{ dbt.date_trunc('day', 'task.created_at') }} and case when task.is_completed then - cast(spine.date_day as timestamp) < {{ dbt_utils.date_trunc('day', 'task.completed_at') }} + cast(spine.date_day as timestamp) < {{ dbt.date_trunc('day', 'task.completed_at') }} else true end group by 1 diff --git a/models/intermediate/int_asana__task_open_length.sql b/models/intermediate/int_asana__task_open_length.sql index 799ebef..3efd813 100644 --- a/models/intermediate/int_asana__task_open_length.sql +++ b/models/intermediate/int_asana__task_open_length.sql @@ -29,7 +29,7 @@ assignments as ( open_assigned_length as ( - {% set open_until = 'task.completed_at' if 'task.is_completed' is true else dbt_utils.current_timestamp() %} + {% set open_until = 'task.completed_at' if 'task.is_completed' is true else dbt.current_timestamp_backcompat() %} select task.task_id, @@ -39,12 +39,12 @@ open_assigned_length as ( assignments.task_id is not null as has_been_assigned, assignments.last_assigned_at as last_assigned_at, assignments.first_assigned_at as first_assigned_at, - {{ dbt_utils.datediff('task.created_at', open_until, 'day') }} as days_open, + {{ dbt.datediff('task.created_at', open_until, 'day') }} as days_open, -- if the task is currently assigned, this is the time it has been assigned to this current user. - {{ dbt_utils.datediff('assignments.last_assigned_at', open_until, 'day') }} as days_since_last_assignment, + {{ dbt.datediff('assignments.last_assigned_at', open_until, 'day') }} as days_since_last_assignment, - {{ dbt_utils.datediff('assignments.first_assigned_at', open_until, 'day') }} as days_since_first_assignment + {{ dbt.datediff('assignments.first_assigned_at', open_until, 'day') }} as days_since_first_assignment from task diff --git a/packages.yml b/packages.yml index 8a95c71..70007e5 100644 --- a/packages.yml +++ b/packages.yml @@ -1,3 +1,3 @@ packages: - - package: fivetran/asana_source - version: [">=0.6.0", "<0.7.0"] \ No newline at end of file +- package: fivetran/asana_source + version: [">=0.7.0", "<0.8.0"] \ No newline at end of file