diff --git a/.circleci/config.yml b/.circleci/config.yml new file mode 100644 index 0000000..4a23fdb --- /dev/null +++ b/.circleci/config.yml @@ -0,0 +1,60 @@ +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: | + 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 - 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" \ No newline at end of file diff --git a/README.md b/README.md index eb07edf..f7ea861 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # Asana ([docs](https://fivetran-dbt-asana.netlify.app/#!/overview)) -This package models Asana data from [Fivetran's connector](https://fivetran.com/docs/applications/asana). It uses data in the format described by [this ERD](https://docs.google.com/presentation/d/14m2L2aYGmt0IXseExR80FlEO-7fxjBKfoALR2jVh0G8/edit). +This package models Asana data from [Fivetran's connector](https://fivetran.com/docs/applications/asana). It uses data in the format described by [this ERD](https://fivetran.com/docs/applications/asana#schemainformation). This package enables you to better understand tasks and how they're being worked on in Asana. Its primary focus is to enhance the task table and other core objects that relate to tasks: users, projects, teams, and tags. Each of these objects is enriched with metrics that reflect the volume and breadth of work being done now and the velocity of work that has been completed. Moreover, the daily metrics table lays out a timeline of task creations and completions for understanding the overall pace of deliverables at the organization. @@ -12,12 +12,12 @@ This package contains transformation models, designed to work simultaneously wit | **model** | **description** | | ------------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------- | -| asana_task | Each record represents an Asana task, enriched with data about its assignee, projects, sections, tasks, teams, tags, parent task, comments, followers, and activity. | -| asana_user | Each record represents an Asana user, enriched with metrics about their completed tasks, open tasks, and the projects they work on. Also includes data about the user's most recently completed task and their next due task. | -| asana_project | Each record represents an Asana project, enriched with metrics about their completed tasks, open tasks, and the users involved in the project. Also includes data about the project's most recently completed task and next due tasks. | -| asana_team | Each record represents an Asana team, enriched with data about their completed tasks, open tasks, their projects, and the users involved with the team. | -| asana_tag | Each record represents an Asana tag, enriched with metrics about open and completed tasks associated with the tag. | -| asana_daily_metrics | Each record represents a single day, enriched with metrics about tasks opened at created that day. | +| [asana__task](https://github.com/fivetran/dbt_asana/blob/master/models/asana__task.sql) | Each record represents an Asana task, enriched with data about its assignee, projects, sections, tasks, teams, tags, parent task, comments, followers, and activity. | +| [asana__user](https://github.com/fivetran/dbt_asana/blob/master/models/asana__user.sql) | Each record represents an Asana user, enriched with metrics about their completed tasks, open tasks, and the projects they work on. Also includes data about the user's most recently completed task and their next due task. | +| [asana_project](https://github.com/fivetran/dbt_asana/blob/master/models/asana__project.sql) | Each record represents an Asana project, enriched with metrics about their completed tasks, open tasks, and the users involved in the project. Also includes data about the project's most recently completed task and next due tasks. | +| [asana__team](https://github.com/fivetran/dbt_asana/blob/master/models/asana__team.sql) | Each record represents an Asana team, enriched with data about their completed tasks, open tasks, their projects, and the users involved with the team. | +| [asana__tag](https://github.com/fivetran/dbt_asana/blob/master/models/asana__tag.sql) | Each record represents an Asana tag, enriched with metrics about open and completed tasks associated with the tag. | +| [asana__daily_metrics](https://github.com/fivetran/dbt_asana/blob/master/models/asana__daily_metrics.sql) | Each record represents a single day, enriched with metrics about tasks opened at created that day. | ## Installation Instructions @@ -37,6 +37,22 @@ vars: asana_database: your_database_name asana_schema: your_schema_name ``` +### Changing the Build Schema +By default this package will build the Asana staging models within a schema titled ( + `_stg_asana`) and the Asana final models with a schema titled ( + `_asana`) in your target database. If this is not where you would like your modeled Asana data to be written to, add the following configuration to your `dbt_project.yml` file: + +```yml +# dbt_project.yml + +... +models: + asana: + +schema: my_new_schema_name # leave blank for just the target_schema + asana_source: + +schema: my_new_schema_name # leave blank for just the target_schema +``` + +## Database support +This package is compatible with BigQuery, Snowflake, and Redshift. ## Contributions diff --git a/dbt_project.yml b/dbt_project.yml index e8552e8..c49e1f8 100644 --- a/dbt_project.yml +++ b/dbt_project.yml @@ -1,26 +1,27 @@ config-version: 2 name: 'asana' -version: '0.2.0' +version: '0.3.0' -require-dbt-version: [">=0.18.0", "<0.19.0"] +require-dbt-version: [">=0.18.0", "<0.20.0"] models: asana: + +schema: asana materialized: table intermediate: materialized: ephemeral vars: asana: - project_task: "{{ ref('stg_asana_project_task') }}" - project: "{{ ref('stg_asana_project') }}" - section: "{{ ref('stg_asana_section') }}" - story: "{{ ref('stg_asana_story') }}" - tag: "{{ ref('stg_asana_tag') }}" - task_follower: "{{ ref('stg_asana_task_follower') }}" - task_section: "{{ ref('stg_asana_task_section') }}" - task_tag: "{{ ref('stg_asana_task_tag') }}" - task: "{{ ref('stg_asana_task') }}" - team: "{{ ref('stg_asana_team') }}" - user: "{{ ref('stg_asana_user') }}" + project_task: "{{ ref('stg_asana__project_task') }}" + project: "{{ ref('stg_asana__project') }}" + section: "{{ ref('stg_asana__section') }}" + story: "{{ ref('stg_asana__story') }}" + tag: "{{ ref('stg_asana__tag') }}" + task_follower: "{{ ref('stg_asana__task_follower') }}" + task_section: "{{ ref('stg_asana__task_section') }}" + task_tag: "{{ ref('stg_asana__task_tag') }}" + task: "{{ ref('stg_asana__task') }}" + team: "{{ ref('stg_asana__team') }}" + user: "{{ ref('stg_asana__user') }}" diff --git a/docs/catalog.json b/docs/catalog.json new file mode 100644 index 0000000..9c166e4 --- /dev/null +++ b/docs/catalog.json @@ -0,0 +1 @@ +{"metadata": {"dbt_schema_version": "https://schemas.getdbt.com/dbt/catalog/v1.json", "dbt_version": "0.19.0", "generated_at": "2021-03-22T23:02:06.962753Z", "invocation_id": "c669a45a-6fb5-4d1b-95ec-69df50a34cf9", "env": {}}, "nodes": {"model.asana.asana__tag": {"metadata": {"type": "table", "database": "dbt-package-testing", "schema": "asana_source_integration_tests_asana", "name": "asana__tag", "comment": null, "owner": null}, "columns": {"tag_id": {"type": "INT64", "comment": null, "index": 1, "name": "tag_id"}, "tag_name": {"type": "STRING", "comment": null, "index": 2, "name": "tag_name"}, "created_at": {"type": "DATETIME", "comment": null, "index": 3, "name": "created_at"}, "number_of_open_tasks": {"type": "INT64", "comment": null, "index": 4, "name": "number_of_open_tasks"}, "number_of_assigned_open_tasks": {"type": "INT64", "comment": null, "index": 5, "name": "number_of_assigned_open_tasks"}, "number_of_tasks_completed": {"type": "INT64", "comment": null, "index": 6, "name": "number_of_tasks_completed"}, "avg_days_open": {"type": "FLOAT64", "comment": null, "index": 7, "name": "avg_days_open"}, "avg_days_assigned": {"type": "FLOAT64", "comment": null, "index": 8, "name": "avg_days_assigned"}}, "stats": {"num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 1258.0, "description": "Approximate size of table as reported by BigQuery", "include": true}, "num_rows": {"id": "num_rows", "label": "# Rows", "value": 17.0, "description": "Approximate count of rows in this table", "include": true}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "description": "Indicates whether there are statistics for this table", "include": false}}, "unique_id": "model.asana.asana__tag"}, "model.asana.asana__task": {"metadata": {"type": "table", "database": "dbt-package-testing", "schema": "asana_source_integration_tests_asana", "name": "asana__task", "comment": null, "owner": null}, "columns": {"task_id": {"type": "INT64", "comment": null, "index": 1, "name": "task_id"}, "assignee_user_id": {"type": "INT64", "comment": null, "index": 2, "name": "assignee_user_id"}, "assignee_status": {"type": "STRING", "comment": null, "index": 3, "name": "assignee_status"}, "is_completed": {"type": "BOOL", "comment": null, "index": 4, "name": "is_completed"}, "completed_at": {"type": "TIMESTAMP", "comment": null, "index": 5, "name": "completed_at"}, "completed_by_user_id": {"type": "INT64", "comment": null, "index": 6, "name": "completed_by_user_id"}, "created_at": {"type": "TIMESTAMP", "comment": null, "index": 7, "name": "created_at"}, "due_date": {"type": "INT64", "comment": null, "index": 8, "name": "due_date"}, "modified_at": {"type": "DATETIME", "comment": null, "index": 9, "name": "modified_at"}, "task_name": {"type": "STRING", "comment": null, "index": 10, "name": "task_name"}, "parent_task_id": {"type": "INT64", "comment": null, "index": 11, "name": "parent_task_id"}, "start_date": {"type": "INT64", "comment": null, "index": 12, "name": "start_date"}, "task_description": {"type": "INT64", "comment": null, "index": 13, "name": "task_description"}, "workspace_id": {"type": "INT64", "comment": null, "index": 14, "name": "workspace_id"}, "task_link": {"type": "STRING", "comment": null, "index": 15, "name": "task_link"}, "assignee_name": {"type": "STRING", "comment": null, "index": 16, "name": "assignee_name"}, "assignee_email": {"type": "STRING", "comment": null, "index": 17, "name": "assignee_email"}, "days_open": {"type": "INT64", "comment": null, "index": 18, "name": "days_open"}, "is_currently_assigned": {"type": "BOOL", "comment": null, "index": 19, "name": "is_currently_assigned"}, "has_been_assigned": {"type": "BOOL", "comment": null, "index": 20, "name": "has_been_assigned"}, "days_since_last_assignment": {"type": "INT64", "comment": null, "index": 21, "name": "days_since_last_assignment"}, "days_since_first_assignment": {"type": "INT64", "comment": null, "index": 22, "name": "days_since_first_assignment"}, "last_assigned_at": {"type": "DATETIME", "comment": null, "index": 23, "name": "last_assigned_at"}, "first_assigned_at": {"type": "DATETIME", "comment": null, "index": 24, "name": "first_assigned_at"}, "first_modifier_user_id": {"type": "INT64", "comment": null, "index": 25, "name": "first_modifier_user_id"}, "first_modifier_name": {"type": "STRING", "comment": null, "index": 26, "name": "first_modifier_name"}, "conversation": {"type": "STRING", "comment": null, "index": 27, "name": "conversation"}, "number_of_comments": {"type": "INT64", "comment": null, "index": 28, "name": "number_of_comments"}, "followers": {"type": "STRING", "comment": null, "index": 29, "name": "followers"}, "number_of_followers": {"type": "INT64", "comment": null, "index": 30, "name": "number_of_followers"}, "tags": {"type": "STRING", "comment": null, "index": 31, "name": "tags"}, "number_of_tags": {"type": "INT64", "comment": null, "index": 32, "name": "number_of_tags"}, "projects_sections": {"type": "STRING", "comment": null, "index": 33, "name": "projects_sections"}, "is_subtask": {"type": "BOOL", "comment": null, "index": 34, "name": "is_subtask"}, "parent_task_name": {"type": "STRING", "comment": null, "index": 35, "name": "parent_task_name"}, "parent_assignee_user_id": {"type": "INT64", "comment": null, "index": 36, "name": "parent_assignee_user_id"}, "parent_assignee_name": {"type": "STRING", "comment": null, "index": 37, "name": "parent_assignee_name"}, "parent_due_date": {"type": "INT64", "comment": null, "index": 38, "name": "parent_due_date"}, "parent_created_at": {"type": "TIMESTAMP", "comment": null, "index": 39, "name": "parent_created_at"}}, "stats": {"num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 297.0, "description": "Approximate size of table as reported by BigQuery", "include": true}, "num_rows": {"id": "num_rows", "label": "# Rows", "value": 1.0, "description": "Approximate count of rows in this table", "include": true}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "description": "Indicates whether there are statistics for this table", "include": false}}, "unique_id": "model.asana.asana__task"}, "model.asana.asana__project": {"metadata": {"type": "table", "database": "dbt-package-testing", "schema": "asana_source_integration_tests_asana", "name": "asana__project", "comment": null, "owner": null}, "columns": {"project_id": {"type": "INT64", "comment": null, "index": 1, "name": "project_id"}, "project_name": {"type": "STRING", "comment": null, "index": 2, "name": "project_name"}, "number_of_open_tasks": {"type": "INT64", "comment": null, "index": 3, "name": "number_of_open_tasks"}, "number_of_assigned_open_tasks": {"type": "INT64", "comment": null, "index": 4, "name": "number_of_assigned_open_tasks"}, "number_of_tasks_completed": {"type": "INT64", "comment": null, "index": 5, "name": "number_of_tasks_completed"}, "avg_close_time_days": {"type": "FLOAT64", "comment": null, "index": 6, "name": "avg_close_time_days"}, "avg_close_time_assigned_days": {"type": "FLOAT64", "comment": null, "index": 7, "name": "avg_close_time_assigned_days"}, "project_link": {"type": "STRING", "comment": null, "index": 8, "name": "project_link"}, "team_id": {"type": "INT64", "comment": null, "index": 9, "name": "team_id"}, "team_name": {"type": "STRING", "comment": null, "index": 10, "name": "team_name"}, "is_archived": {"type": "BOOL", "comment": null, "index": 11, "name": "is_archived"}, "created_at": {"type": "DATETIME", "comment": null, "index": 12, "name": "created_at"}, "current_status": {"type": "STRING", "comment": null, "index": 13, "name": "current_status"}, "due_date": {"type": "DATETIME", "comment": null, "index": 14, "name": "due_date"}, "last_modified_at": {"type": "DATETIME", "comment": null, "index": 15, "name": "last_modified_at"}, "owner_user_id": {"type": "INT64", "comment": null, "index": 16, "name": "owner_user_id"}, "users_involved": {"type": "STRING", "comment": null, "index": 17, "name": "users_involved"}, "number_of_users_involved": {"type": "INT64", "comment": null, "index": 18, "name": "number_of_users_involved"}, "sections": {"type": "STRING", "comment": null, "index": 19, "name": "sections"}, "notes": {"type": "STRING", "comment": null, "index": 20, "name": "notes"}, "is_public": {"type": "INT64", "comment": null, "index": 21, "name": "is_public"}}, "stats": {"num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 3304.0, "description": "Approximate size of table as reported by BigQuery", "include": true}, "num_rows": {"id": "num_rows", "label": "# Rows", "value": 16.0, "description": "Approximate count of rows in this table", "include": true}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "description": "Indicates whether there are statistics for this table", "include": false}}, "unique_id": "model.asana.asana__project"}, "model.asana.asana__user": {"metadata": {"type": "table", "database": "dbt-package-testing", "schema": "asana_source_integration_tests_asana", "name": "asana__user", "comment": null, "owner": null}, "columns": {"user_id": {"type": "INT64", "comment": null, "index": 1, "name": "user_id"}, "email": {"type": "STRING", "comment": null, "index": 2, "name": "email"}, "user_name": {"type": "STRING", "comment": null, "index": 3, "name": "user_name"}, "number_of_open_tasks": {"type": "INT64", "comment": null, "index": 4, "name": "number_of_open_tasks"}, "number_of_tasks_completed": {"type": "INT64", "comment": null, "index": 5, "name": "number_of_tasks_completed"}, "avg_close_time_days": {"type": "FLOAT64", "comment": null, "index": 6, "name": "avg_close_time_days"}, "number_of_projects_owned": {"type": "INT64", "comment": null, "index": 7, "name": "number_of_projects_owned"}, "number_of_projects_currently_assigned_to": {"type": "INT64", "comment": null, "index": 8, "name": "number_of_projects_currently_assigned_to"}, "projects_working_on": {"type": "STRING", "comment": null, "index": 9, "name": "projects_working_on"}}, "stats": {"num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 2160.0, "description": "Approximate size of table as reported by BigQuery", "include": true}, "num_rows": {"id": "num_rows", "label": "# Rows", "value": 20.0, "description": "Approximate count of rows in this table", "include": true}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "description": "Indicates whether there are statistics for this table", "include": false}}, "unique_id": "model.asana.asana__user"}, "model.asana.asana__daily_metrics": {"metadata": {"type": "table", "database": "dbt-package-testing", "schema": "asana_source_integration_tests_asana", "name": "asana__daily_metrics", "comment": null, "owner": null}, "columns": {"date_day": {"type": "DATETIME", "comment": null, "index": 1, "name": "date_day"}, "number_of_tasks_open": {"type": "INT64", "comment": null, "index": 2, "name": "number_of_tasks_open"}, "number_of_tasks_open_assigned": {"type": "INT64", "comment": null, "index": 3, "name": "number_of_tasks_open_assigned"}, "number_of_tasks_created": {"type": "INT64", "comment": null, "index": 4, "name": "number_of_tasks_created"}, "number_of_tasks_completed": {"type": "INT64", "comment": null, "index": 5, "name": "number_of_tasks_completed"}, "avg_days_open": {"type": "FLOAT64", "comment": null, "index": 6, "name": "avg_days_open"}, "avg_days_open_assigned": {"type": "FLOAT64", "comment": null, "index": 7, "name": "avg_days_open_assigned"}}, "stats": {"num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 2536.0, "description": "Approximate size of table as reported by BigQuery", "include": true}, "num_rows": {"id": "num_rows", "label": "# Rows", "value": 53.0, "description": "Approximate count of rows in this table", "include": true}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "description": "Indicates whether there are statistics for this table", "include": false}}, "unique_id": "model.asana.asana__daily_metrics"}, "model.asana.asana__team": {"metadata": {"type": "table", "database": "dbt-package-testing", "schema": "asana_source_integration_tests_asana", "name": "asana__team", "comment": null, "owner": null}, "columns": {"team_id": {"type": "INT64", "comment": null, "index": 1, "name": "team_id"}, "team_name": {"type": "STRING", "comment": null, "index": 2, "name": "team_name"}, "number_of_open_tasks": {"type": "INT64", "comment": null, "index": 3, "name": "number_of_open_tasks"}, "number_of_assigned_open_tasks": {"type": "INT64", "comment": null, "index": 4, "name": "number_of_assigned_open_tasks"}, "number_of_tasks_completed": {"type": "INT64", "comment": null, "index": 5, "name": "number_of_tasks_completed"}, "avg_close_time_days": {"type": "FLOAT64", "comment": null, "index": 6, "name": "avg_close_time_days"}, "avg_close_time_assigned_days": {"type": "FLOAT64", "comment": null, "index": 7, "name": "avg_close_time_assigned_days"}, "number_of_active_projects": {"type": "INT64", "comment": null, "index": 8, "name": "number_of_active_projects"}, "active_projects": {"type": "STRING", "comment": null, "index": 9, "name": "active_projects"}, "number_of_archived_projects": {"type": "INT64", "comment": null, "index": 10, "name": "number_of_archived_projects"}}, "stats": {"num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 2594.0, "description": "Approximate size of table as reported by BigQuery", "include": true}, "num_rows": {"id": "num_rows", "label": "# Rows", "value": 25.0, "description": "Approximate count of rows in this table", "include": true}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "description": "Indicates whether there are statistics for this table", "include": false}}, "unique_id": "model.asana.asana__team"}, "model.asana_source.stg_asana__task_section_tmp": {"metadata": {"type": "table", "database": "dbt-package-testing", "schema": "asana_source_integration_tests_stg_asana", "name": "stg_asana__task_section_tmp", "comment": null, "owner": null}, "columns": {"section_id": {"type": "INT64", "comment": null, "index": 1, "name": "section_id"}, "task_id": {"type": "INT64", "comment": null, "index": 2, "name": "task_id"}, "_fivetran_synced": {"type": "TIMESTAMP", "comment": null, "index": 3, "name": "_fivetran_synced"}}, "stats": {"num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 48.0, "description": "Approximate size of table as reported by BigQuery", "include": true}, "num_rows": {"id": "num_rows", "label": "# Rows", "value": 2.0, "description": "Approximate count of rows in this table", "include": true}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "description": "Indicates whether there are statistics for this table", "include": false}}, "unique_id": "model.asana_source.stg_asana__task_section_tmp"}, "model.asana_source.stg_asana__project": {"metadata": {"type": "table", "database": "dbt-package-testing", "schema": "asana_source_integration_tests_stg_asana", "name": "stg_asana__project", "comment": null, "owner": null}, "columns": {"project_id": {"type": "INT64", "comment": null, "index": 1, "name": "project_id"}, "is_archived": {"type": "BOOL", "comment": null, "index": 2, "name": "is_archived"}, "created_at": {"type": "DATETIME", "comment": null, "index": 3, "name": "created_at"}, "current_status": {"type": "STRING", "comment": null, "index": 4, "name": "current_status"}, "due_date": {"type": "DATETIME", "comment": null, "index": 5, "name": "due_date"}, "modified_at": {"type": "DATETIME", "comment": null, "index": 6, "name": "modified_at"}, "project_name": {"type": "STRING", "comment": null, "index": 7, "name": "project_name"}, "owner_user_id": {"type": "INT64", "comment": null, "index": 8, "name": "owner_user_id"}, "is_public": {"type": "INT64", "comment": null, "index": 9, "name": "is_public"}, "team_id": {"type": "INT64", "comment": null, "index": 10, "name": "team_id"}, "workspace_id": {"type": "INT64", "comment": null, "index": 11, "name": "workspace_id"}, "notes": {"type": "STRING", "comment": null, "index": 12, "name": "notes"}}, "stats": {"num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 1448.0, "description": "Approximate size of table as reported by BigQuery", "include": true}, "num_rows": {"id": "num_rows", "label": "# Rows", "value": 16.0, "description": "Approximate count of rows in this table", "include": true}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "description": "Indicates whether there are statistics for this table", "include": false}}, "unique_id": "model.asana_source.stg_asana__project"}, "model.asana_source.stg_asana__story": {"metadata": {"type": "table", "database": "dbt-package-testing", "schema": "asana_source_integration_tests_stg_asana", "name": "stg_asana__story", "comment": null, "owner": null}, "columns": {"story_id": {"type": "INT64", "comment": null, "index": 1, "name": "story_id"}, "created_at": {"type": "DATETIME", "comment": null, "index": 2, "name": "created_at"}, "created_by_user_id": {"type": "INT64", "comment": null, "index": 3, "name": "created_by_user_id"}, "target_task_id": {"type": "INT64", "comment": null, "index": 4, "name": "target_task_id"}, "story_content": {"type": "STRING", "comment": null, "index": 5, "name": "story_content"}, "event_type": {"type": "STRING", "comment": null, "index": 6, "name": "event_type"}}, "stats": {"num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 222.0, "description": "Approximate size of table as reported by BigQuery", "include": true}, "num_rows": {"id": "num_rows", "label": "# Rows", "value": 3.0, "description": "Approximate count of rows in this table", "include": true}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "description": "Indicates whether there are statistics for this table", "include": false}}, "unique_id": "model.asana_source.stg_asana__story"}, "model.asana_source.stg_asana__team": {"metadata": {"type": "table", "database": "dbt-package-testing", "schema": "asana_source_integration_tests_stg_asana", "name": "stg_asana__team", "comment": null, "owner": null}, "columns": {"team_id": {"type": "INT64", "comment": null, "index": 1, "name": "team_id"}, "team_name": {"type": "STRING", "comment": null, "index": 2, "name": "team_name"}}, "stats": {"num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 1050.0, "description": "Approximate size of table as reported by BigQuery", "include": true}, "num_rows": {"id": "num_rows", "label": "# Rows", "value": 25.0, "description": "Approximate count of rows in this table", "include": true}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "description": "Indicates whether there are statistics for this table", "include": false}}, "unique_id": "model.asana_source.stg_asana__team"}, "model.asana_source.stg_asana__section": {"metadata": {"type": "table", "database": "dbt-package-testing", "schema": "asana_source_integration_tests_stg_asana", "name": "stg_asana__section", "comment": null, "owner": null}, "columns": {"section_id": {"type": "INT64", "comment": null, "index": 1, "name": "section_id"}, "created_at": {"type": "DATETIME", "comment": null, "index": 2, "name": "created_at"}, "section_name": {"type": "STRING", "comment": null, "index": 3, "name": "section_name"}, "project_id": {"type": "INT64", "comment": null, "index": 4, "name": "project_id"}}, "stats": {"num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 754.0, "description": "Approximate size of table as reported by BigQuery", "include": true}, "num_rows": {"id": "num_rows", "label": "# Rows", "value": 13.0, "description": "Approximate count of rows in this table", "include": true}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "description": "Indicates whether there are statistics for this table", "include": false}}, "unique_id": "model.asana_source.stg_asana__section"}, "model.asana_source.stg_asana__section_tmp": {"metadata": {"type": "table", "database": "dbt-package-testing", "schema": "asana_source_integration_tests_stg_asana", "name": "stg_asana__section_tmp", "comment": null, "owner": null}, "columns": {"id": {"type": "INT64", "comment": null, "index": 1, "name": "id"}, "_fivetran_synced": {"type": "TIMESTAMP", "comment": null, "index": 2, "name": "_fivetran_synced"}, "created_at": {"type": "DATETIME", "comment": null, "index": 3, "name": "created_at"}, "name": {"type": "STRING", "comment": null, "index": 4, "name": "name"}, "project_id": {"type": "INT64", "comment": null, "index": 5, "name": "project_id"}}, "stats": {"num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 858.0, "description": "Approximate size of table as reported by BigQuery", "include": true}, "num_rows": {"id": "num_rows", "label": "# Rows", "value": 13.0, "description": "Approximate count of rows in this table", "include": true}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "description": "Indicates whether there are statistics for this table", "include": false}}, "unique_id": "model.asana_source.stg_asana__section_tmp"}, "model.asana_source.stg_asana__task_tmp": {"metadata": {"type": "table", "database": "dbt-package-testing", "schema": "asana_source_integration_tests_stg_asana", "name": "stg_asana__task_tmp", "comment": null, "owner": null}, "columns": {"id": {"type": "INT64", "comment": null, "index": 1, "name": "id"}, "_fivetran_synced": {"type": "TIMESTAMP", "comment": null, "index": 2, "name": "_fivetran_synced"}, "assignee_id": {"type": "INT64", "comment": null, "index": 3, "name": "assignee_id"}, "assignee_status": {"type": "STRING", "comment": null, "index": 4, "name": "assignee_status"}, "completed": {"type": "BOOL", "comment": null, "index": 5, "name": "completed"}, "completed_at": {"type": "TIMESTAMP", "comment": null, "index": 6, "name": "completed_at"}, "completed_by_id": {"type": "INT64", "comment": null, "index": 7, "name": "completed_by_id"}, "created_at": {"type": "TIMESTAMP", "comment": null, "index": 8, "name": "created_at"}, "due_at": {"type": "INT64", "comment": null, "index": 9, "name": "due_at"}, "due_on": {"type": "INT64", "comment": null, "index": 10, "name": "due_on"}, "hearted": {"type": "BOOL", "comment": null, "index": 11, "name": "hearted"}, "modified_at": {"type": "DATETIME", "comment": null, "index": 12, "name": "modified_at"}, "name": {"type": "STRING", "comment": null, "index": 13, "name": "name"}, "notes": {"type": "INT64", "comment": null, "index": 14, "name": "notes"}, "num_hearts": {"type": "INT64", "comment": null, "index": 15, "name": "num_hearts"}, "parent_id": {"type": "INT64", "comment": null, "index": 16, "name": "parent_id"}, "start_on": {"type": "INT64", "comment": null, "index": 17, "name": "start_on"}, "workspace_id": {"type": "INT64", "comment": null, "index": 18, "name": "workspace_id"}}, "stats": {"num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 99.0, "description": "Approximate size of table as reported by BigQuery", "include": true}, "num_rows": {"id": "num_rows", "label": "# Rows", "value": 1.0, "description": "Approximate count of rows in this table", "include": true}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "description": "Indicates whether there are statistics for this table", "include": false}}, "unique_id": "model.asana_source.stg_asana__task_tmp"}, "model.asana_source.stg_asana__project_tmp": {"metadata": {"type": "table", "database": "dbt-package-testing", "schema": "asana_source_integration_tests_stg_asana", "name": "stg_asana__project_tmp", "comment": null, "owner": null}, "columns": {"id": {"type": "INT64", "comment": null, "index": 1, "name": "id"}, "_fivetran_deleted": {"type": "BOOL", "comment": null, "index": 2, "name": "_fivetran_deleted"}, "_fivetran_synced": {"type": "TIMESTAMP", "comment": null, "index": 3, "name": "_fivetran_synced"}, "archived": {"type": "BOOL", "comment": null, "index": 4, "name": "archived"}, "color": {"type": "STRING", "comment": null, "index": 5, "name": "color"}, "created_at": {"type": "DATETIME", "comment": null, "index": 6, "name": "created_at"}, "current_status": {"type": "STRING", "comment": null, "index": 7, "name": "current_status"}, "due_date": {"type": "DATETIME", "comment": null, "index": 8, "name": "due_date"}, "modified_at": {"type": "DATETIME", "comment": null, "index": 9, "name": "modified_at"}, "name": {"type": "STRING", "comment": null, "index": 10, "name": "name"}, "notes": {"type": "STRING", "comment": null, "index": 11, "name": "notes"}, "owner_id": {"type": "INT64", "comment": null, "index": 12, "name": "owner_id"}, "public": {"type": "INT64", "comment": null, "index": 13, "name": "public"}, "team_id": {"type": "INT64", "comment": null, "index": 14, "name": "team_id"}, "workspace_id": {"type": "INT64", "comment": null, "index": 15, "name": "workspace_id"}}, "stats": {"num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 1710.0, "description": "Approximate size of table as reported by BigQuery", "include": true}, "num_rows": {"id": "num_rows", "label": "# Rows", "value": 16.0, "description": "Approximate count of rows in this table", "include": true}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "description": "Indicates whether there are statistics for this table", "include": false}}, "unique_id": "model.asana_source.stg_asana__project_tmp"}, "model.asana_source.stg_asana__user_tmp": {"metadata": {"type": "table", "database": "dbt-package-testing", "schema": "asana_source_integration_tests_stg_asana", "name": "stg_asana__user_tmp", "comment": null, "owner": null}, "columns": {"id": {"type": "INT64", "comment": null, "index": 1, "name": "id"}, "_fivetran_deleted": {"type": "BOOL", "comment": null, "index": 2, "name": "_fivetran_deleted"}, "_fivetran_synced": {"type": "TIMESTAMP", "comment": null, "index": 3, "name": "_fivetran_synced"}, "email": {"type": "STRING", "comment": null, "index": 4, "name": "email"}, "name": {"type": "STRING", "comment": null, "index": 5, "name": "name"}}, "stats": {"num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 1700.0, "description": "Approximate size of table as reported by BigQuery", "include": true}, "num_rows": {"id": "num_rows", "label": "# Rows", "value": 20.0, "description": "Approximate count of rows in this table", "include": true}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "description": "Indicates whether there are statistics for this table", "include": false}}, "unique_id": "model.asana_source.stg_asana__user_tmp"}, "model.asana_source.stg_asana__team_tmp": {"metadata": {"type": "table", "database": "dbt-package-testing", "schema": "asana_source_integration_tests_stg_asana", "name": "stg_asana__team_tmp", "comment": null, "owner": null}, "columns": {"id": {"type": "INT64", "comment": null, "index": 1, "name": "id"}, "_fivetran_deleted": {"type": "BOOL", "comment": null, "index": 2, "name": "_fivetran_deleted"}, "_fivetran_synced": {"type": "TIMESTAMP", "comment": null, "index": 3, "name": "_fivetran_synced"}, "name": {"type": "STRING", "comment": null, "index": 4, "name": "name"}, "organization_id": {"type": "INT64", "comment": null, "index": 5, "name": "organization_id"}}, "stats": {"num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 1475.0, "description": "Approximate size of table as reported by BigQuery", "include": true}, "num_rows": {"id": "num_rows", "label": "# Rows", "value": 25.0, "description": "Approximate count of rows in this table", "include": true}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "description": "Indicates whether there are statistics for this table", "include": false}}, "unique_id": "model.asana_source.stg_asana__team_tmp"}, "model.asana_source.stg_asana__task": {"metadata": {"type": "table", "database": "dbt-package-testing", "schema": "asana_source_integration_tests_stg_asana", "name": "stg_asana__task", "comment": null, "owner": null}, "columns": {"task_id": {"type": "INT64", "comment": null, "index": 1, "name": "task_id"}, "assignee_user_id": {"type": "INT64", "comment": null, "index": 2, "name": "assignee_user_id"}, "assignee_status": {"type": "STRING", "comment": null, "index": 3, "name": "assignee_status"}, "is_completed": {"type": "BOOL", "comment": null, "index": 4, "name": "is_completed"}, "completed_at": {"type": "TIMESTAMP", "comment": null, "index": 5, "name": "completed_at"}, "completed_by_user_id": {"type": "INT64", "comment": null, "index": 6, "name": "completed_by_user_id"}, "created_at": {"type": "TIMESTAMP", "comment": null, "index": 7, "name": "created_at"}, "due_date": {"type": "INT64", "comment": null, "index": 8, "name": "due_date"}, "modified_at": {"type": "DATETIME", "comment": null, "index": 9, "name": "modified_at"}, "task_name": {"type": "STRING", "comment": null, "index": 10, "name": "task_name"}, "parent_task_id": {"type": "INT64", "comment": null, "index": 11, "name": "parent_task_id"}, "start_date": {"type": "INT64", "comment": null, "index": 12, "name": "start_date"}, "task_description": {"type": "INT64", "comment": null, "index": 13, "name": "task_description"}, "workspace_id": {"type": "INT64", "comment": null, "index": 14, "name": "workspace_id"}}, "stats": {"num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 82.0, "description": "Approximate size of table as reported by BigQuery", "include": true}, "num_rows": {"id": "num_rows", "label": "# Rows", "value": 1.0, "description": "Approximate count of rows in this table", "include": true}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "description": "Indicates whether there are statistics for this table", "include": false}}, "unique_id": "model.asana_source.stg_asana__task"}, "model.asana_source.stg_asana__task_follower_tmp": {"metadata": {"type": "table", "database": "dbt-package-testing", "schema": "asana_source_integration_tests_stg_asana", "name": "stg_asana__task_follower_tmp", "comment": null, "owner": null}, "columns": {"task_id": {"type": "INT64", "comment": null, "index": 1, "name": "task_id"}, "user_id": {"type": "INT64", "comment": null, "index": 2, "name": "user_id"}, "_fivetran_synced": {"type": "TIMESTAMP", "comment": null, "index": 3, "name": "_fivetran_synced"}}, "stats": {"num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 24.0, "description": "Approximate size of table as reported by BigQuery", "include": true}, "num_rows": {"id": "num_rows", "label": "# Rows", "value": 1.0, "description": "Approximate count of rows in this table", "include": true}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "description": "Indicates whether there are statistics for this table", "include": false}}, "unique_id": "model.asana_source.stg_asana__task_follower_tmp"}, "model.asana_source.stg_asana__story_tmp": {"metadata": {"type": "table", "database": "dbt-package-testing", "schema": "asana_source_integration_tests_stg_asana", "name": "stg_asana__story_tmp", "comment": null, "owner": null}, "columns": {"id": {"type": "INT64", "comment": null, "index": 1, "name": "id"}, "_fivetran_synced": {"type": "TIMESTAMP", "comment": null, "index": 2, "name": "_fivetran_synced"}, "created_at": {"type": "DATETIME", "comment": null, "index": 3, "name": "created_at"}, "created_by_id": {"type": "INT64", "comment": null, "index": 4, "name": "created_by_id"}, "hearted": {"type": "INT64", "comment": null, "index": 5, "name": "hearted"}, "num_hearts": {"type": "INT64", "comment": null, "index": 6, "name": "num_hearts"}, "source": {"type": "STRING", "comment": null, "index": 7, "name": "source"}, "target_id": {"type": "INT64", "comment": null, "index": 8, "name": "target_id"}, "text": {"type": "STRING", "comment": null, "index": 9, "name": "text"}, "type": {"type": "STRING", "comment": null, "index": 10, "name": "type"}}, "stats": {"num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 285.0, "description": "Approximate size of table as reported by BigQuery", "include": true}, "num_rows": {"id": "num_rows", "label": "# Rows", "value": 3.0, "description": "Approximate count of rows in this table", "include": true}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "description": "Indicates whether there are statistics for this table", "include": false}}, "unique_id": "model.asana_source.stg_asana__story_tmp"}, "model.asana_source.stg_asana__task_tag": {"metadata": {"type": "table", "database": "dbt-package-testing", "schema": "asana_source_integration_tests_stg_asana", "name": "stg_asana__task_tag", "comment": null, "owner": null}, "columns": {"tag_id": {"type": "INT64", "comment": null, "index": 1, "name": "tag_id"}, "task_id": {"type": "INT64", "comment": null, "index": 2, "name": "task_id"}}, "stats": {"num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 64.0, "description": "Approximate size of table as reported by BigQuery", "include": true}, "num_rows": {"id": "num_rows", "label": "# Rows", "value": 4.0, "description": "Approximate count of rows in this table", "include": true}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "description": "Indicates whether there are statistics for this table", "include": false}}, "unique_id": "model.asana_source.stg_asana__task_tag"}, "model.asana_source.stg_asana__project_task": {"metadata": {"type": "table", "database": "dbt-package-testing", "schema": "asana_source_integration_tests_stg_asana", "name": "stg_asana__project_task", "comment": null, "owner": null}, "columns": {"project_id": {"type": "INT64", "comment": null, "index": 1, "name": "project_id"}, "task_id": {"type": "INT64", "comment": null, "index": 2, "name": "task_id"}}, "stats": {"num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 32.0, "description": "Approximate size of table as reported by BigQuery", "include": true}, "num_rows": {"id": "num_rows", "label": "# Rows", "value": 2.0, "description": "Approximate count of rows in this table", "include": true}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "description": "Indicates whether there are statistics for this table", "include": false}}, "unique_id": "model.asana_source.stg_asana__project_task"}, "model.asana_source.stg_asana__task_follower": {"metadata": {"type": "table", "database": "dbt-package-testing", "schema": "asana_source_integration_tests_stg_asana", "name": "stg_asana__task_follower", "comment": null, "owner": null}, "columns": {"task_id": {"type": "INT64", "comment": null, "index": 1, "name": "task_id"}, "user_id": {"type": "INT64", "comment": null, "index": 2, "name": "user_id"}}, "stats": {"num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 16.0, "description": "Approximate size of table as reported by BigQuery", "include": true}, "num_rows": {"id": "num_rows", "label": "# Rows", "value": 1.0, "description": "Approximate count of rows in this table", "include": true}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "description": "Indicates whether there are statistics for this table", "include": false}}, "unique_id": "model.asana_source.stg_asana__task_follower"}, "model.asana_source.stg_asana__task_tag_tmp": {"metadata": {"type": "table", "database": "dbt-package-testing", "schema": "asana_source_integration_tests_stg_asana", "name": "stg_asana__task_tag_tmp", "comment": null, "owner": null}, "columns": {"tag_id": {"type": "INT64", "comment": null, "index": 1, "name": "tag_id"}, "task_id": {"type": "INT64", "comment": null, "index": 2, "name": "task_id"}, "_fivetran_synced": {"type": "TIMESTAMP", "comment": null, "index": 3, "name": "_fivetran_synced"}}, "stats": {"num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 96.0, "description": "Approximate size of table as reported by BigQuery", "include": true}, "num_rows": {"id": "num_rows", "label": "# Rows", "value": 4.0, "description": "Approximate count of rows in this table", "include": true}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "description": "Indicates whether there are statistics for this table", "include": false}}, "unique_id": "model.asana_source.stg_asana__task_tag_tmp"}, "model.asana_source.stg_asana__tag_tmp": {"metadata": {"type": "table", "database": "dbt-package-testing", "schema": "asana_source_integration_tests_stg_asana", "name": "stg_asana__tag_tmp", "comment": null, "owner": null}, "columns": {"id": {"type": "INT64", "comment": null, "index": 1, "name": "id"}, "_fivetran_deleted": {"type": "BOOL", "comment": null, "index": 2, "name": "_fivetran_deleted"}, "_fivetran_synced": {"type": "TIMESTAMP", "comment": null, "index": 3, "name": "_fivetran_synced"}, "color": {"type": "INT64", "comment": null, "index": 4, "name": "color"}, "created_at": {"type": "DATETIME", "comment": null, "index": 5, "name": "created_at"}, "message": {"type": "INT64", "comment": null, "index": 6, "name": "message"}, "name": {"type": "STRING", "comment": null, "index": 7, "name": "name"}, "notes": {"type": "INT64", "comment": null, "index": 8, "name": "notes"}, "workspace_id": {"type": "INT64", "comment": null, "index": 9, "name": "workspace_id"}}, "stats": {"num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 1139.0, "description": "Approximate size of table as reported by BigQuery", "include": true}, "num_rows": {"id": "num_rows", "label": "# Rows", "value": 17.0, "description": "Approximate count of rows in this table", "include": true}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "description": "Indicates whether there are statistics for this table", "include": false}}, "unique_id": "model.asana_source.stg_asana__tag_tmp"}, "model.asana_source.stg_asana__project_task_tmp": {"metadata": {"type": "table", "database": "dbt-package-testing", "schema": "asana_source_integration_tests_stg_asana", "name": "stg_asana__project_task_tmp", "comment": null, "owner": null}, "columns": {"project_id": {"type": "INT64", "comment": null, "index": 1, "name": "project_id"}, "task_id": {"type": "INT64", "comment": null, "index": 2, "name": "task_id"}, "_fivetran_synced": {"type": "TIMESTAMP", "comment": null, "index": 3, "name": "_fivetran_synced"}}, "stats": {"num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 48.0, "description": "Approximate size of table as reported by BigQuery", "include": true}, "num_rows": {"id": "num_rows", "label": "# Rows", "value": 2.0, "description": "Approximate count of rows in this table", "include": true}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "description": "Indicates whether there are statistics for this table", "include": false}}, "unique_id": "model.asana_source.stg_asana__project_task_tmp"}, "model.asana_source.stg_asana__user": {"metadata": {"type": "table", "database": "dbt-package-testing", "schema": "asana_source_integration_tests_stg_asana", "name": "stg_asana__user", "comment": null, "owner": null}, "columns": {"user_id": {"type": "INT64", "comment": null, "index": 1, "name": "user_id"}, "email": {"type": "STRING", "comment": null, "index": 2, "name": "email"}, "user_name": {"type": "STRING", "comment": null, "index": 3, "name": "user_name"}}, "stats": {"num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 1520.0, "description": "Approximate size of table as reported by BigQuery", "include": true}, "num_rows": {"id": "num_rows", "label": "# Rows", "value": 20.0, "description": "Approximate count of rows in this table", "include": true}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "description": "Indicates whether there are statistics for this table", "include": false}}, "unique_id": "model.asana_source.stg_asana__user"}, "model.asana_source.stg_asana__tag": {"metadata": {"type": "table", "database": "dbt-package-testing", "schema": "asana_source_integration_tests_stg_asana", "name": "stg_asana__tag", "comment": null, "owner": null}, "columns": {"tag_id": {"type": "INT64", "comment": null, "index": 1, "name": "tag_id"}, "tag_name": {"type": "STRING", "comment": null, "index": 2, "name": "tag_name"}, "created_at": {"type": "DATETIME", "comment": null, "index": 3, "name": "created_at"}}, "stats": {"num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 850.0, "description": "Approximate size of table as reported by BigQuery", "include": true}, "num_rows": {"id": "num_rows", "label": "# Rows", "value": 17.0, "description": "Approximate count of rows in this table", "include": true}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "description": "Indicates whether there are statistics for this table", "include": false}}, "unique_id": "model.asana_source.stg_asana__tag"}, "model.asana_source.stg_asana__task_section": {"metadata": {"type": "table", "database": "dbt-package-testing", "schema": "asana_source_integration_tests_stg_asana", "name": "stg_asana__task_section", "comment": null, "owner": null}, "columns": {"section_id": {"type": "INT64", "comment": null, "index": 1, "name": "section_id"}, "task_id": {"type": "INT64", "comment": null, "index": 2, "name": "task_id"}}, "stats": {"num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 32.0, "description": "Approximate size of table as reported by BigQuery", "include": true}, "num_rows": {"id": "num_rows", "label": "# Rows", "value": 2.0, "description": "Approximate count of rows in this table", "include": true}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "description": "Indicates whether there are statistics for this table", "include": false}}, "unique_id": "model.asana_source.stg_asana__task_section"}, "seed.asana_integration_tests.task_data": {"metadata": {"type": "table", "database": "dbt-package-testing", "schema": "asana_source_integration_tests", "name": "task_data", "comment": null, "owner": null}, "columns": {"id": {"type": "INT64", "comment": null, "index": 1, "name": "id"}, "_fivetran_synced": {"type": "TIMESTAMP", "comment": null, "index": 2, "name": "_fivetran_synced"}, "assignee_id": {"type": "INT64", "comment": null, "index": 3, "name": "assignee_id"}, "assignee_status": {"type": "STRING", "comment": null, "index": 4, "name": "assignee_status"}, "completed": {"type": "BOOL", "comment": null, "index": 5, "name": "completed"}, "completed_at": {"type": "TIMESTAMP", "comment": null, "index": 6, "name": "completed_at"}, "completed_by_id": {"type": "INT64", "comment": null, "index": 7, "name": "completed_by_id"}, "created_at": {"type": "TIMESTAMP", "comment": null, "index": 8, "name": "created_at"}, "due_at": {"type": "INT64", "comment": null, "index": 9, "name": "due_at"}, "due_on": {"type": "INT64", "comment": null, "index": 10, "name": "due_on"}, "hearted": {"type": "BOOL", "comment": null, "index": 11, "name": "hearted"}, "modified_at": {"type": "DATETIME", "comment": null, "index": 12, "name": "modified_at"}, "name": {"type": "STRING", "comment": null, "index": 13, "name": "name"}, "notes": {"type": "INT64", "comment": null, "index": 14, "name": "notes"}, "num_hearts": {"type": "INT64", "comment": null, "index": 15, "name": "num_hearts"}, "parent_id": {"type": "INT64", "comment": null, "index": 16, "name": "parent_id"}, "start_on": {"type": "INT64", "comment": null, "index": 17, "name": "start_on"}, "workspace_id": {"type": "INT64", "comment": null, "index": 18, "name": "workspace_id"}}, "stats": {"num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 99.0, "description": "Approximate size of table as reported by BigQuery", "include": true}, "num_rows": {"id": "num_rows", "label": "# Rows", "value": 1.0, "description": "Approximate count of rows in this table", "include": true}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "description": "Indicates whether there are statistics for this table", "include": false}}, "unique_id": "seed.asana_integration_tests.task_data"}, "seed.asana_integration_tests.story_data": {"metadata": {"type": "table", "database": "dbt-package-testing", "schema": "asana_source_integration_tests", "name": "story_data", "comment": null, "owner": null}, "columns": {"id": {"type": "INT64", "comment": null, "index": 1, "name": "id"}, "_fivetran_synced": {"type": "TIMESTAMP", "comment": null, "index": 2, "name": "_fivetran_synced"}, "created_at": {"type": "DATETIME", "comment": null, "index": 3, "name": "created_at"}, "created_by_id": {"type": "INT64", "comment": null, "index": 4, "name": "created_by_id"}, "hearted": {"type": "INT64", "comment": null, "index": 5, "name": "hearted"}, "num_hearts": {"type": "INT64", "comment": null, "index": 6, "name": "num_hearts"}, "source": {"type": "STRING", "comment": null, "index": 7, "name": "source"}, "target_id": {"type": "INT64", "comment": null, "index": 8, "name": "target_id"}, "text": {"type": "STRING", "comment": null, "index": 9, "name": "text"}, "type": {"type": "STRING", "comment": null, "index": 10, "name": "type"}}, "stats": {"num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 285.0, "description": "Approximate size of table as reported by BigQuery", "include": true}, "num_rows": {"id": "num_rows", "label": "# Rows", "value": 3.0, "description": "Approximate count of rows in this table", "include": true}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "description": "Indicates whether there are statistics for this table", "include": false}}, "unique_id": "seed.asana_integration_tests.story_data"}, "seed.asana_integration_tests.project_task_data": {"metadata": {"type": "table", "database": "dbt-package-testing", "schema": "asana_source_integration_tests", "name": "project_task_data", "comment": null, "owner": null}, "columns": {"project_id": {"type": "INT64", "comment": null, "index": 1, "name": "project_id"}, "task_id": {"type": "INT64", "comment": null, "index": 2, "name": "task_id"}, "_fivetran_synced": {"type": "TIMESTAMP", "comment": null, "index": 3, "name": "_fivetran_synced"}}, "stats": {"num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 48.0, "description": "Approximate size of table as reported by BigQuery", "include": true}, "num_rows": {"id": "num_rows", "label": "# Rows", "value": 2.0, "description": "Approximate count of rows in this table", "include": true}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "description": "Indicates whether there are statistics for this table", "include": false}}, "unique_id": "seed.asana_integration_tests.project_task_data"}, "seed.asana_integration_tests.team_data": {"metadata": {"type": "table", "database": "dbt-package-testing", "schema": "asana_source_integration_tests", "name": "team_data", "comment": null, "owner": null}, "columns": {"id": {"type": "INT64", "comment": null, "index": 1, "name": "id"}, "_fivetran_deleted": {"type": "BOOL", "comment": null, "index": 2, "name": "_fivetran_deleted"}, "_fivetran_synced": {"type": "TIMESTAMP", "comment": null, "index": 3, "name": "_fivetran_synced"}, "name": {"type": "STRING", "comment": null, "index": 4, "name": "name"}, "organization_id": {"type": "INT64", "comment": null, "index": 5, "name": "organization_id"}}, "stats": {"num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 1475.0, "description": "Approximate size of table as reported by BigQuery", "include": true}, "num_rows": {"id": "num_rows", "label": "# Rows", "value": 25.0, "description": "Approximate count of rows in this table", "include": true}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "description": "Indicates whether there are statistics for this table", "include": false}}, "unique_id": "seed.asana_integration_tests.team_data"}, "seed.asana_integration_tests.project_data": {"metadata": {"type": "table", "database": "dbt-package-testing", "schema": "asana_source_integration_tests", "name": "project_data", "comment": null, "owner": null}, "columns": {"id": {"type": "INT64", "comment": null, "index": 1, "name": "id"}, "_fivetran_deleted": {"type": "BOOL", "comment": null, "index": 2, "name": "_fivetran_deleted"}, "_fivetran_synced": {"type": "TIMESTAMP", "comment": null, "index": 3, "name": "_fivetran_synced"}, "archived": {"type": "BOOL", "comment": null, "index": 4, "name": "archived"}, "color": {"type": "STRING", "comment": null, "index": 5, "name": "color"}, "created_at": {"type": "DATETIME", "comment": null, "index": 6, "name": "created_at"}, "current_status": {"type": "STRING", "comment": null, "index": 7, "name": "current_status"}, "due_date": {"type": "DATETIME", "comment": null, "index": 8, "name": "due_date"}, "modified_at": {"type": "DATETIME", "comment": null, "index": 9, "name": "modified_at"}, "name": {"type": "STRING", "comment": null, "index": 10, "name": "name"}, "notes": {"type": "STRING", "comment": null, "index": 11, "name": "notes"}, "owner_id": {"type": "INT64", "comment": null, "index": 12, "name": "owner_id"}, "public": {"type": "INT64", "comment": null, "index": 13, "name": "public"}, "team_id": {"type": "INT64", "comment": null, "index": 14, "name": "team_id"}, "workspace_id": {"type": "INT64", "comment": null, "index": 15, "name": "workspace_id"}}, "stats": {"num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 1710.0, "description": "Approximate size of table as reported by BigQuery", "include": true}, "num_rows": {"id": "num_rows", "label": "# Rows", "value": 16.0, "description": "Approximate count of rows in this table", "include": true}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "description": "Indicates whether there are statistics for this table", "include": false}}, "unique_id": "seed.asana_integration_tests.project_data"}, "seed.asana_integration_tests.task_section_data": {"metadata": {"type": "table", "database": "dbt-package-testing", "schema": "asana_source_integration_tests", "name": "task_section_data", "comment": null, "owner": null}, "columns": {"section_id": {"type": "INT64", "comment": null, "index": 1, "name": "section_id"}, "task_id": {"type": "INT64", "comment": null, "index": 2, "name": "task_id"}, "_fivetran_synced": {"type": "TIMESTAMP", "comment": null, "index": 3, "name": "_fivetran_synced"}}, "stats": {"num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 48.0, "description": "Approximate size of table as reported by BigQuery", "include": true}, "num_rows": {"id": "num_rows", "label": "# Rows", "value": 2.0, "description": "Approximate count of rows in this table", "include": true}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "description": "Indicates whether there are statistics for this table", "include": false}}, "unique_id": "seed.asana_integration_tests.task_section_data"}, "seed.asana_integration_tests.user_data": {"metadata": {"type": "table", "database": "dbt-package-testing", "schema": "asana_source_integration_tests", "name": "user_data", "comment": null, "owner": null}, "columns": {"id": {"type": "INT64", "comment": null, "index": 1, "name": "id"}, "_fivetran_deleted": {"type": "BOOL", "comment": null, "index": 2, "name": "_fivetran_deleted"}, "_fivetran_synced": {"type": "TIMESTAMP", "comment": null, "index": 3, "name": "_fivetran_synced"}, "email": {"type": "STRING", "comment": null, "index": 4, "name": "email"}, "name": {"type": "STRING", "comment": null, "index": 5, "name": "name"}}, "stats": {"num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 1700.0, "description": "Approximate size of table as reported by BigQuery", "include": true}, "num_rows": {"id": "num_rows", "label": "# Rows", "value": 20.0, "description": "Approximate count of rows in this table", "include": true}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "description": "Indicates whether there are statistics for this table", "include": false}}, "unique_id": "seed.asana_integration_tests.user_data"}, "seed.asana_integration_tests.task_follower_data": {"metadata": {"type": "table", "database": "dbt-package-testing", "schema": "asana_source_integration_tests", "name": "task_follower_data", "comment": null, "owner": null}, "columns": {"task_id": {"type": "INT64", "comment": null, "index": 1, "name": "task_id"}, "user_id": {"type": "INT64", "comment": null, "index": 2, "name": "user_id"}, "_fivetran_synced": {"type": "TIMESTAMP", "comment": null, "index": 3, "name": "_fivetran_synced"}}, "stats": {"num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 24.0, "description": "Approximate size of table as reported by BigQuery", "include": true}, "num_rows": {"id": "num_rows", "label": "# Rows", "value": 1.0, "description": "Approximate count of rows in this table", "include": true}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "description": "Indicates whether there are statistics for this table", "include": false}}, "unique_id": "seed.asana_integration_tests.task_follower_data"}, "seed.asana_integration_tests.section_data": {"metadata": {"type": "table", "database": "dbt-package-testing", "schema": "asana_source_integration_tests", "name": "section_data", "comment": null, "owner": null}, "columns": {"id": {"type": "INT64", "comment": null, "index": 1, "name": "id"}, "_fivetran_synced": {"type": "TIMESTAMP", "comment": null, "index": 2, "name": "_fivetran_synced"}, "created_at": {"type": "DATETIME", "comment": null, "index": 3, "name": "created_at"}, "name": {"type": "STRING", "comment": null, "index": 4, "name": "name"}, "project_id": {"type": "INT64", "comment": null, "index": 5, "name": "project_id"}}, "stats": {"num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 858.0, "description": "Approximate size of table as reported by BigQuery", "include": true}, "num_rows": {"id": "num_rows", "label": "# Rows", "value": 13.0, "description": "Approximate count of rows in this table", "include": true}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "description": "Indicates whether there are statistics for this table", "include": false}}, "unique_id": "seed.asana_integration_tests.section_data"}, "seed.asana_integration_tests.task_tag_data": {"metadata": {"type": "table", "database": "dbt-package-testing", "schema": "asana_source_integration_tests", "name": "task_tag_data", "comment": null, "owner": null}, "columns": {"tag_id": {"type": "INT64", "comment": null, "index": 1, "name": "tag_id"}, "task_id": {"type": "INT64", "comment": null, "index": 2, "name": "task_id"}, "_fivetran_synced": {"type": "TIMESTAMP", "comment": null, "index": 3, "name": "_fivetran_synced"}}, "stats": {"num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 96.0, "description": "Approximate size of table as reported by BigQuery", "include": true}, "num_rows": {"id": "num_rows", "label": "# Rows", "value": 4.0, "description": "Approximate count of rows in this table", "include": true}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "description": "Indicates whether there are statistics for this table", "include": false}}, "unique_id": "seed.asana_integration_tests.task_tag_data"}, "seed.asana_integration_tests.tag_data": {"metadata": {"type": "table", "database": "dbt-package-testing", "schema": "asana_source_integration_tests", "name": "tag_data", "comment": null, "owner": null}, "columns": {"id": {"type": "INT64", "comment": null, "index": 1, "name": "id"}, "_fivetran_deleted": {"type": "BOOL", "comment": null, "index": 2, "name": "_fivetran_deleted"}, "_fivetran_synced": {"type": "TIMESTAMP", "comment": null, "index": 3, "name": "_fivetran_synced"}, "color": {"type": "INT64", "comment": null, "index": 4, "name": "color"}, "created_at": {"type": "DATETIME", "comment": null, "index": 5, "name": "created_at"}, "message": {"type": "INT64", "comment": null, "index": 6, "name": "message"}, "name": {"type": "STRING", "comment": null, "index": 7, "name": "name"}, "notes": {"type": "INT64", "comment": null, "index": 8, "name": "notes"}, "workspace_id": {"type": "INT64", "comment": null, "index": 9, "name": "workspace_id"}}, "stats": {"num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 1139.0, "description": "Approximate size of table as reported by BigQuery", "include": true}, "num_rows": {"id": "num_rows", "label": "# Rows", "value": 17.0, "description": "Approximate count of rows in this table", "include": true}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "description": "Indicates whether there are statistics for this table", "include": false}}, "unique_id": "seed.asana_integration_tests.tag_data"}}, "sources": {}, "errors": null} \ No newline at end of file diff --git a/docs/index.html b/docs/index.html new file mode 100644 index 0000000..360349a --- /dev/null +++ b/docs/index.html @@ -0,0 +1,102 @@ + + + + + + + dbt Docs + + + + + + + + + + + + + + + + + +
icons
+
+ + diff --git a/docs/manifest.json b/docs/manifest.json new file mode 100644 index 0000000..62c0233 --- /dev/null +++ b/docs/manifest.json @@ -0,0 +1 @@ +{"metadata": {"dbt_schema_version": "https://schemas.getdbt.com/dbt/manifest/v1.json", "dbt_version": "0.19.0", "generated_at": "2021-03-22T23:01:56.512371Z", "invocation_id": "c669a45a-6fb5-4d1b-95ec-69df50a34cf9", "env": {}, "project_id": "eb4f71033fe45cc065e80cddb4b06583", "user_id": "57178664-37b2-4047-9572-68ec8b488cd7", "send_anonymous_usage_stats": true, "adapter_type": "bigquery"}, "nodes": {"seed.asana_integration_tests.project_task_data": {"raw_sql": "", "compiled": true, "database": "dbt-package-testing", "schema": "asana_source_integration_tests", "fqn": ["asana_integration_tests", "project_task_data"], "unique_id": "seed.asana_integration_tests.project_task_data", "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": "data/project_task_data.csv", "name": "project_task_data", "resource_type": "seed", "alias": "project_task_data", "checksum": {"name": "sha256", "checksum": "b8ae363c3ab40609f8b5b0eee30e198bd124d781198ecda72e5409178aab17cd"}, "config": {"enabled": true, "materialized": "seed", "persist_docs": {}, "post-hook": [], "pre-hook": [], "vars": {}, "quoting": {}, "column_types": {"_fivetran_synced": "timestamp", "project_id": "int64", "task_id": "int64"}, "alias": null, "schema": null, "database": null, "tags": [], "full_refresh": null, "quote_columns": false}, "tags": [], "refs": [], "sources": [], "depends_on": {"macros": [], "nodes": []}, "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_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' }}"}}, "compiled_sql": "", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`asana_source_integration_tests`.`project_task_data`"}, "seed.asana_integration_tests.story_data": {"raw_sql": "", "compiled": true, "database": "dbt-package-testing", "schema": "asana_source_integration_tests", "fqn": ["asana_integration_tests", "story_data"], "unique_id": "seed.asana_integration_tests.story_data", "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": "data/story_data.csv", "name": "story_data", "resource_type": "seed", "alias": "story_data", "checksum": {"name": "sha256", "checksum": "207847a91c60ba0de1269fd0aef2a0e1f9d2c3e2b0fbae231ce69fce909dd15a"}, "config": {"enabled": true, "materialized": "seed", "persist_docs": {}, "post-hook": [], "pre-hook": [], "vars": {}, "quoting": {}, "column_types": {"_fivetran_synced": "timestamp", "id": "int64", "created_by_id": "int64", "target_id": "int64"}, "alias": null, "schema": null, "database": null, "tags": [], "full_refresh": null, "quote_columns": false}, "tags": [], "refs": [], "sources": [], "depends_on": {"macros": [], "nodes": []}, "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_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' }}"}}, "compiled_sql": "", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`asana_source_integration_tests`.`story_data`"}, "seed.asana_integration_tests.task_tag_data": {"raw_sql": "", "compiled": true, "database": "dbt-package-testing", "schema": "asana_source_integration_tests", "fqn": ["asana_integration_tests", "task_tag_data"], "unique_id": "seed.asana_integration_tests.task_tag_data", "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": "data/task_tag_data.csv", "name": "task_tag_data", "resource_type": "seed", "alias": "task_tag_data", "checksum": {"name": "sha256", "checksum": "0209673eda201e499fc6c588fbc799e08b44a60168cabaa4dc3cee39bb250cbd"}, "config": {"enabled": true, "materialized": "seed", "persist_docs": {}, "post-hook": [], "pre-hook": [], "vars": {}, "quoting": {}, "column_types": {"_fivetran_synced": "timestamp", "tag_id": "int64", "task_id": "int64"}, "alias": null, "schema": null, "database": null, "tags": [], "full_refresh": null, "quote_columns": false}, "tags": [], "refs": [], "sources": [], "depends_on": {"macros": [], "nodes": []}, "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_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' }}"}}, "compiled_sql": "", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`asana_source_integration_tests`.`task_tag_data`"}, "seed.asana_integration_tests.task_section_data": {"raw_sql": "", "compiled": true, "database": "dbt-package-testing", "schema": "asana_source_integration_tests", "fqn": ["asana_integration_tests", "task_section_data"], "unique_id": "seed.asana_integration_tests.task_section_data", "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": "data/task_section_data.csv", "name": "task_section_data", "resource_type": "seed", "alias": "task_section_data", "checksum": {"name": "sha256", "checksum": "d0aab9b6565fdb541b9ed5122d66cc9fad61287d3374d8af41c25eaf9bcd5805"}, "config": {"enabled": true, "materialized": "seed", "persist_docs": {}, "post-hook": [], "pre-hook": [], "vars": {}, "quoting": {}, "column_types": {"_fivetran_synced": "timestamp", "section_id": "int64", "task_id": "int64"}, "alias": null, "schema": null, "database": null, "tags": [], "full_refresh": null, "quote_columns": false}, "tags": [], "refs": [], "sources": [], "depends_on": {"macros": [], "nodes": []}, "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_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' }}"}}, "compiled_sql": "", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`asana_source_integration_tests`.`task_section_data`"}, "seed.asana_integration_tests.task_data": {"raw_sql": "", "compiled": true, "database": "dbt-package-testing", "schema": "asana_source_integration_tests", "fqn": ["asana_integration_tests", "task_data"], "unique_id": "seed.asana_integration_tests.task_data", "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": "data/task_data.csv", "name": "task_data", "resource_type": "seed", "alias": "task_data", "checksum": {"name": "sha256", "checksum": "4eb44503e07b5c712bfdcead83ab4f20827e296d0457abde15155d979c5bae7a"}, "config": {"enabled": true, "materialized": "seed", "persist_docs": {}, "post-hook": [], "pre-hook": [], "vars": {}, "quoting": {}, "column_types": {"_fivetran_synced": "timestamp", "created_at": "timestamp", "completed_at": "timestamp", "id": "int64", "assignee_id": "int64", "completed_by_id": "int64", "parent_id": "int64", "workspace_id": "int64"}, "alias": null, "schema": null, "database": null, "tags": [], "full_refresh": null, "quote_columns": false}, "tags": [], "refs": [], "sources": [], "depends_on": {"macros": [], "nodes": []}, "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {"quote_columns": "{{ true if target.type == 'redshift' else false }}", "column_types": {"created_at": "timestamp", "completed_at": "timestamp", "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' }}"}}, "compiled_sql": "", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`asana_source_integration_tests`.`task_data`"}, "seed.asana_integration_tests.task_follower_data": {"raw_sql": "", "compiled": true, "database": "dbt-package-testing", "schema": "asana_source_integration_tests", "fqn": ["asana_integration_tests", "task_follower_data"], "unique_id": "seed.asana_integration_tests.task_follower_data", "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": "data/task_follower_data.csv", "name": "task_follower_data", "resource_type": "seed", "alias": "task_follower_data", "checksum": {"name": "sha256", "checksum": "6171210df6abad2ffba8ff8d10c1feb73c13c41c8e86b32e59f5aa29a4571678"}, "config": {"enabled": true, "materialized": "seed", "persist_docs": {}, "post-hook": [], "pre-hook": [], "vars": {}, "quoting": {}, "column_types": {"_fivetran_synced": "timestamp", "user_id": "int64", "task_id": "int64"}, "alias": null, "schema": null, "database": null, "tags": [], "full_refresh": null, "quote_columns": false}, "tags": [], "refs": [], "sources": [], "depends_on": {"macros": [], "nodes": []}, "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_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' }}"}}, "compiled_sql": "", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`asana_source_integration_tests`.`task_follower_data`"}, "seed.asana_integration_tests.tag_data": {"raw_sql": "", "compiled": true, "database": "dbt-package-testing", "schema": "asana_source_integration_tests", "fqn": ["asana_integration_tests", "tag_data"], "unique_id": "seed.asana_integration_tests.tag_data", "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": "data/tag_data.csv", "name": "tag_data", "resource_type": "seed", "alias": "tag_data", "checksum": {"name": "sha256", "checksum": "e74c86b7fda7a484687ac7e16fd759233a2066632e6dd27acb481b0afa852548"}, "config": {"enabled": true, "materialized": "seed", "persist_docs": {}, "post-hook": [], "pre-hook": [], "vars": {}, "quoting": {}, "column_types": {"_fivetran_synced": "timestamp", "id": "int64", "workspace_id": "int64"}, "alias": null, "schema": null, "database": null, "tags": [], "full_refresh": null, "quote_columns": false}, "tags": [], "refs": [], "sources": [], "depends_on": {"macros": [], "nodes": []}, "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_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' }}"}}, "compiled_sql": "", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`asana_source_integration_tests`.`tag_data`"}, "seed.asana_integration_tests.project_data": {"raw_sql": "", "compiled": true, "database": "dbt-package-testing", "schema": "asana_source_integration_tests", "fqn": ["asana_integration_tests", "project_data"], "unique_id": "seed.asana_integration_tests.project_data", "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": "data/project_data.csv", "name": "project_data", "resource_type": "seed", "alias": "project_data", "checksum": {"name": "sha256", "checksum": "cf12cd38b9bdb3ec36cac1757ae4a17e7a8dc4182cb65995ec3fc9b7c2668378"}, "config": {"enabled": true, "materialized": "seed", "persist_docs": {}, "post-hook": [], "pre-hook": [], "vars": {}, "quoting": {}, "column_types": {"_fivetran_synced": "timestamp", "id": "int64", "owner_id": "int64", "team_id": "int64", "workspace_id": "int64"}, "alias": null, "schema": null, "database": null, "tags": [], "full_refresh": null, "quote_columns": false}, "tags": [], "refs": [], "sources": [], "depends_on": {"macros": [], "nodes": []}, "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_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' }}"}}, "compiled_sql": "", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`asana_source_integration_tests`.`project_data`"}, "seed.asana_integration_tests.user_data": {"raw_sql": "", "compiled": true, "database": "dbt-package-testing", "schema": "asana_source_integration_tests", "fqn": ["asana_integration_tests", "user_data"], "unique_id": "seed.asana_integration_tests.user_data", "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": "data/user_data.csv", "name": "user_data", "resource_type": "seed", "alias": "user_data", "checksum": {"name": "sha256", "checksum": "237db906018d65bbeeb08bd57c3cd23a91428412a882a0b59994658d564a9ad3"}, "config": {"enabled": true, "materialized": "seed", "persist_docs": {}, "post-hook": [], "pre-hook": [], "vars": {}, "quoting": {}, "column_types": {"_fivetran_synced": "timestamp", "id": "int64"}, "alias": null, "schema": null, "database": null, "tags": [], "full_refresh": null, "quote_columns": false}, "tags": [], "refs": [], "sources": [], "depends_on": {"macros": [], "nodes": []}, "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_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' }}"}}, "compiled_sql": "", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`asana_source_integration_tests`.`user_data`"}, "seed.asana_integration_tests.team_data": {"raw_sql": "", "compiled": true, "database": "dbt-package-testing", "schema": "asana_source_integration_tests", "fqn": ["asana_integration_tests", "team_data"], "unique_id": "seed.asana_integration_tests.team_data", "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": "data/team_data.csv", "name": "team_data", "resource_type": "seed", "alias": "team_data", "checksum": {"name": "sha256", "checksum": "96c14731f1382783fd83b114321e23b5c2813b94f96a6e5422a5aca66157a1cd"}, "config": {"enabled": true, "materialized": "seed", "persist_docs": {}, "post-hook": [], "pre-hook": [], "vars": {}, "quoting": {}, "column_types": {"_fivetran_synced": "timestamp", "id": "int64", "organization_id": "int64"}, "alias": null, "schema": null, "database": null, "tags": [], "full_refresh": null, "quote_columns": false}, "tags": [], "refs": [], "sources": [], "depends_on": {"macros": [], "nodes": []}, "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_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' }}"}}, "compiled_sql": "", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`asana_source_integration_tests`.`team_data`"}, "seed.asana_integration_tests.section_data": {"raw_sql": "", "compiled": true, "database": "dbt-package-testing", "schema": "asana_source_integration_tests", "fqn": ["asana_integration_tests", "section_data"], "unique_id": "seed.asana_integration_tests.section_data", "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": "data/section_data.csv", "name": "section_data", "resource_type": "seed", "alias": "section_data", "checksum": {"name": "sha256", "checksum": "ca6f6bf502e9d65fcbe59590756a42979e31af8bf1db841a9292b56512252bde"}, "config": {"enabled": true, "materialized": "seed", "persist_docs": {}, "post-hook": [], "pre-hook": [], "vars": {}, "quoting": {}, "column_types": {"_fivetran_synced": "timestamp", "id": "int64", "project_id": "int64"}, "alias": null, "schema": null, "database": null, "tags": [], "full_refresh": null, "quote_columns": false}, "tags": [], "refs": [], "sources": [], "depends_on": {"macros": [], "nodes": []}, "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_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' }}"}}, "compiled_sql": "", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`asana_source_integration_tests`.`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, "database": "dbt-package-testing", "schema": "asana_source_integration_tests_stg_asana", "fqn": ["asana_source", "stg_asana__user"], "unique_id": "model.asana_source.stg_asana__user", "package_name": "asana_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Asana/dbt_asana/integration_tests/dbt_modules/asana_source", "path": "stg_asana__user.sql", "original_file_path": "models/stg_asana__user.sql", "name": "stg_asana__user", "resource_type": "model", "alias": "stg_asana__user", "checksum": {"name": "sha256", "checksum": "4e7279a7f3d7b9754c574de24021781c98bbbc1c0a99e0c7b3495c57a6d33e18"}, "config": {"enabled": true, "materialized": "table", "persist_docs": {}, "post-hook": [], "pre-hook": [], "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "stg_asana", "database": null, "tags": [], "full_refresh": null}, "tags": [], "refs": [["stg_asana__user_tmp"], ["stg_asana__user_tmp"]], "sources": [], "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"]}, "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": "models/stg_asana.yml", "build_path": "target/compiled/asana_source/models/stg_asana__user.sql", "deferred": false, "unrendered_config": {"schema": "stg_asana", "materialized": "table"}, "compiled_sql": "with base as (\n\n select * \n from `dbt-package-testing`.`asana_source_integration_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": "`dbt-package-testing`.`asana_source_integration_tests_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 from base\n),\n\nfinal as (\n \n select \n id as task_id,\n assignee_id as assignee_user_id,\n assignee_status,\n completed as is_completed,\n completed_at,\n completed_by_id as completed_by_user_id,\n created_at,\n coalesce(due_on, due_at) as due_date,\n modified_at,\n name as task_name,\n parent_id as parent_task_id,\n start_on as start_date,\n notes as task_description,\n workspace_id\n from fields\n)\n\nselect * \nfrom final", "compiled": true, "database": "dbt-package-testing", "schema": "asana_source_integration_tests_stg_asana", "fqn": ["asana_source", "stg_asana__task"], "unique_id": "model.asana_source.stg_asana__task", "package_name": "asana_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Asana/dbt_asana/integration_tests/dbt_modules/asana_source", "path": "stg_asana__task.sql", "original_file_path": "models/stg_asana__task.sql", "name": "stg_asana__task", "resource_type": "model", "alias": "stg_asana__task", "checksum": {"name": "sha256", "checksum": "8901ca68cf2c93ea518cd99bcdba25d1916a79cdd685fb57f0f719aacaa59c07"}, "config": {"enabled": true, "materialized": "table", "persist_docs": {}, "post-hook": [], "pre-hook": [], "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "stg_asana", "database": null, "tags": [], "full_refresh": null}, "tags": [], "refs": [["stg_asana__task_tmp"], ["stg_asana__task_tmp"]], "sources": [], "depends_on": {"macros": ["macro.asana_source.get_task_columns", "macro.fivetran_utils.fill_staging_columns"], "nodes": ["model.asana_source.stg_asana__task_tmp", "model.asana_source.stg_asana__task_tmp"]}, "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": []}, "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": "models/stg_asana.yml", "build_path": "target/compiled/asana_source/models/stg_asana__task.sql", "deferred": false, "unrendered_config": {"schema": "stg_asana", "materialized": "table"}, "compiled_sql": "with base as (\n\n select * \n from `dbt-package-testing`.`asana_source_integration_tests_stg_asana`.`stg_asana__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 assignee_id\n \n as \n \n assignee_id\n \n, \n \n \n assignee_status\n \n as \n \n assignee_status\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 hearted\n \n as \n \n hearted\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 num_hearts\n \n as \n \n num_hearts\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 from base\n),\n\nfinal as (\n \n select \n id as task_id,\n assignee_id as assignee_user_id,\n assignee_status,\n completed as is_completed,\n completed_at,\n completed_by_id as completed_by_user_id,\n created_at,\n coalesce(due_on, due_at) as due_date,\n modified_at,\n name as task_name,\n parent_id as parent_task_id,\n start_on as start_date,\n notes as task_description,\n workspace_id\n from fields\n)\n\nselect * \nfrom final", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`asana_source_integration_tests_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, "database": "dbt-package-testing", "schema": "asana_source_integration_tests_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/joseph.markiewicz/Documents/dbt_packages/Asana/dbt_asana/integration_tests/dbt_modules/asana_source", "path": "stg_asana__task_section.sql", "original_file_path": "models/stg_asana__task_section.sql", "name": "stg_asana__task_section", "resource_type": "model", "alias": "stg_asana__task_section", "checksum": {"name": "sha256", "checksum": "4ead107e3627f57920f45d190c273a0fe706c9f911998f67769818fcd1bb4797"}, "config": {"enabled": true, "materialized": "table", "persist_docs": {}, "post-hook": [], "pre-hook": [], "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "stg_asana", "database": null, "tags": [], "full_refresh": null}, "tags": [], "refs": [["stg_asana__task_section_tmp"], ["stg_asana__task_section_tmp"]], "sources": [], "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"]}, "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": "models/stg_asana.yml", "build_path": "target/compiled/asana_source/models/stg_asana__task_section.sql", "deferred": false, "unrendered_config": {"schema": "stg_asana", "materialized": "table"}, "compiled_sql": "with base as (\n\n select * \n from `dbt-package-testing`.`asana_source_integration_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": "`dbt-package-testing`.`asana_source_integration_tests_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 created_at,\n name as section_name,\n project_id\n from fields\n)\n\nselect * \nfrom final", "compiled": true, "database": "dbt-package-testing", "schema": "asana_source_integration_tests_stg_asana", "fqn": ["asana_source", "stg_asana__section"], "unique_id": "model.asana_source.stg_asana__section", "package_name": "asana_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Asana/dbt_asana/integration_tests/dbt_modules/asana_source", "path": "stg_asana__section.sql", "original_file_path": "models/stg_asana__section.sql", "name": "stg_asana__section", "resource_type": "model", "alias": "stg_asana__section", "checksum": {"name": "sha256", "checksum": "5f8a6028a603573e3af824f27df530730117cb3e1e054c3f95e2bdd829d4d91b"}, "config": {"enabled": true, "materialized": "table", "persist_docs": {}, "post-hook": [], "pre-hook": [], "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "stg_asana", "database": null, "tags": [], "full_refresh": null}, "tags": [], "refs": [["stg_asana__section_tmp"], ["stg_asana__section_tmp"]], "sources": [], "depends_on": {"macros": ["macro.asana_source.get_section_columns", "macro.fivetran_utils.fill_staging_columns"], "nodes": ["model.asana_source.stg_asana__section_tmp", "model.asana_source.stg_asana__section_tmp"]}, "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": "models/stg_asana.yml", "build_path": "target/compiled/asana_source/models/stg_asana__section.sql", "deferred": false, "unrendered_config": {"schema": "stg_asana", "materialized": "table"}, "compiled_sql": "with base as (\n\n select * \n from `dbt-package-testing`.`asana_source_integration_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 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_tests_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, "database": "dbt-package-testing", "schema": "asana_source_integration_tests_stg_asana", "fqn": ["asana_source", "stg_asana__team"], "unique_id": "model.asana_source.stg_asana__team", "package_name": "asana_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Asana/dbt_asana/integration_tests/dbt_modules/asana_source", "path": "stg_asana__team.sql", "original_file_path": "models/stg_asana__team.sql", "name": "stg_asana__team", "resource_type": "model", "alias": "stg_asana__team", "checksum": {"name": "sha256", "checksum": "d2a65dca096a0320f59cc16346eb1854a1bc78135e11eb6b010fcc41fc49e4a0"}, "config": {"enabled": true, "materialized": "table", "persist_docs": {}, "post-hook": [], "pre-hook": [], "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "stg_asana", "database": null, "tags": [], "full_refresh": null}, "tags": [], "refs": [["stg_asana__team_tmp"], ["stg_asana__team_tmp"]], "sources": [], "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"]}, "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": "models/stg_asana.yml", "build_path": "target/compiled/asana_source/models/stg_asana__team.sql", "deferred": false, "unrendered_config": {"schema": "stg_asana", "materialized": "table"}, "compiled_sql": "with base as (\n\n select * \n from `dbt-package-testing`.`asana_source_integration_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": "`dbt-package-testing`.`asana_source_integration_tests_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, "database": "dbt-package-testing", "schema": "asana_source_integration_tests_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/joseph.markiewicz/Documents/dbt_packages/Asana/dbt_asana/integration_tests/dbt_modules/asana_source", "path": "stg_asana__task_tag.sql", "original_file_path": "models/stg_asana__task_tag.sql", "name": "stg_asana__task_tag", "resource_type": "model", "alias": "stg_asana__task_tag", "checksum": {"name": "sha256", "checksum": "7eba4b0f2dabd68e0a77d515c8406bb57bd6263b9ef551de3f06eded4c085de8"}, "config": {"enabled": true, "materialized": "table", "persist_docs": {}, "post-hook": [], "pre-hook": [], "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "stg_asana", "database": null, "tags": [], "full_refresh": null}, "tags": [], "refs": [["stg_asana__task_tag_tmp"], ["stg_asana__task_tag_tmp"]], "sources": [], "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"]}, "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": "models/stg_asana.yml", "build_path": "target/compiled/asana_source/models/stg_asana__task_tag.sql", "deferred": false, "unrendered_config": {"schema": "stg_asana", "materialized": "table"}, "compiled_sql": "with base as (\n\n select * \n from `dbt-package-testing`.`asana_source_integration_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": "`dbt-package-testing`.`asana_source_integration_tests_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 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, "database": "dbt-package-testing", "schema": "asana_source_integration_tests_stg_asana", "fqn": ["asana_source", "stg_asana__story"], "unique_id": "model.asana_source.stg_asana__story", "package_name": "asana_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Asana/dbt_asana/integration_tests/dbt_modules/asana_source", "path": "stg_asana__story.sql", "original_file_path": "models/stg_asana__story.sql", "name": "stg_asana__story", "resource_type": "model", "alias": "stg_asana__story", "checksum": {"name": "sha256", "checksum": "7b45ffeac2ef2e6af6d13771836eeb8e17c147a999906fd5e35f462ca49a054d"}, "config": {"enabled": true, "materialized": "table", "persist_docs": {}, "post-hook": [], "pre-hook": [], "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "stg_asana", "database": null, "tags": [], "full_refresh": null}, "tags": [], "refs": [["stg_asana__story_tmp"], ["stg_asana__story_tmp"]], "sources": [], "depends_on": {"macros": ["macro.asana_source.get_story_columns", "macro.fivetran_utils.fill_staging_columns"], "nodes": ["model.asana_source.stg_asana__story_tmp", "model.asana_source.stg_asana__story_tmp"]}, "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": "models/stg_asana.yml", "build_path": "target/compiled/asana_source/models/stg_asana__story.sql", "deferred": false, "unrendered_config": {"schema": "stg_asana", "materialized": "table"}, "compiled_sql": "with base as (\n\n select * \n from `dbt-package-testing`.`asana_source_integration_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 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_tests_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 created_at\n from fields\n where not _fivetran_deleted\n)\n\nselect * \nfrom final", "compiled": true, "database": "dbt-package-testing", "schema": "asana_source_integration_tests_stg_asana", "fqn": ["asana_source", "stg_asana__tag"], "unique_id": "model.asana_source.stg_asana__tag", "package_name": "asana_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Asana/dbt_asana/integration_tests/dbt_modules/asana_source", "path": "stg_asana__tag.sql", "original_file_path": "models/stg_asana__tag.sql", "name": "stg_asana__tag", "resource_type": "model", "alias": "stg_asana__tag", "checksum": {"name": "sha256", "checksum": "227d8cf45301f38a44c6b4e2611fe7261c972a98970394007e6cc769c5ea6b6f"}, "config": {"enabled": true, "materialized": "table", "persist_docs": {}, "post-hook": [], "pre-hook": [], "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "stg_asana", "database": null, "tags": [], "full_refresh": null}, "tags": [], "refs": [["stg_asana__tag_tmp"], ["stg_asana__tag_tmp"]], "sources": [], "depends_on": {"macros": ["macro.asana_source.get_tag_columns", "macro.fivetran_utils.fill_staging_columns"], "nodes": ["model.asana_source.stg_asana__tag_tmp", "model.asana_source.stg_asana__tag_tmp"]}, "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": "models/stg_asana.yml", "build_path": "target/compiled/asana_source/models/stg_asana__tag.sql", "deferred": false, "unrendered_config": {"schema": "stg_asana", "materialized": "table"}, "compiled_sql": "with base as (\n\n select * \n from `dbt-package-testing`.`asana_source_integration_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 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_tests_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, "database": "dbt-package-testing", "schema": "asana_source_integration_tests_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/joseph.markiewicz/Documents/dbt_packages/Asana/dbt_asana/integration_tests/dbt_modules/asana_source", "path": "stg_asana__project_task.sql", "original_file_path": "models/stg_asana__project_task.sql", "name": "stg_asana__project_task", "resource_type": "model", "alias": "stg_asana__project_task", "checksum": {"name": "sha256", "checksum": "95153bcb4c7e9ccc7302710d14cf8d8120817eece7378f1f7c26f27b48129469"}, "config": {"enabled": true, "materialized": "table", "persist_docs": {}, "post-hook": [], "pre-hook": [], "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "stg_asana", "database": null, "tags": [], "full_refresh": null}, "tags": [], "refs": [["stg_asana__project_task_tmp"], ["stg_asana__project_task_tmp"]], "sources": [], "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"]}, "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": "models/stg_asana.yml", "build_path": "target/compiled/asana_source/models/stg_asana__project_task.sql", "deferred": false, "unrendered_config": {"schema": "stg_asana", "materialized": "table"}, "compiled_sql": "with base as (\n\n select * \n from `dbt-package-testing`.`asana_source_integration_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": "`dbt-package-testing`.`asana_source_integration_tests_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 created_at,\n current_status, \n due_date,\n 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, "database": "dbt-package-testing", "schema": "asana_source_integration_tests_stg_asana", "fqn": ["asana_source", "stg_asana__project"], "unique_id": "model.asana_source.stg_asana__project", "package_name": "asana_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Asana/dbt_asana/integration_tests/dbt_modules/asana_source", "path": "stg_asana__project.sql", "original_file_path": "models/stg_asana__project.sql", "name": "stg_asana__project", "resource_type": "model", "alias": "stg_asana__project", "checksum": {"name": "sha256", "checksum": "b3cdc9318adcbfc79950ce68ed4172a8bcd49439ec7fa10704a677a3c6970f26"}, "config": {"enabled": true, "materialized": "table", "persist_docs": {}, "post-hook": [], "pre-hook": [], "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "stg_asana", "database": null, "tags": [], "full_refresh": null}, "tags": [], "refs": [["stg_asana__project_tmp"], ["stg_asana__project_tmp"]], "sources": [], "depends_on": {"macros": ["macro.asana_source.get_project_columns", "macro.fivetran_utils.fill_staging_columns"], "nodes": ["model.asana_source.stg_asana__project_tmp", "model.asana_source.stg_asana__project_tmp"]}, "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": "models/stg_asana.yml", "build_path": "target/compiled/asana_source/models/stg_asana__project.sql", "deferred": false, "unrendered_config": {"schema": "stg_asana", "materialized": "table"}, "compiled_sql": "with base as (\n\n select * \n from `dbt-package-testing`.`asana_source_integration_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 created_at,\n current_status, \n due_date,\n 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_tests_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, "database": "dbt-package-testing", "schema": "asana_source_integration_tests_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/joseph.markiewicz/Documents/dbt_packages/Asana/dbt_asana/integration_tests/dbt_modules/asana_source", "path": "stg_asana__task_follower.sql", "original_file_path": "models/stg_asana__task_follower.sql", "name": "stg_asana__task_follower", "resource_type": "model", "alias": "stg_asana__task_follower", "checksum": {"name": "sha256", "checksum": "8eb6b3969960cac92d44612ecb9f7486545bb7e92bcf1c96064a4f384ffed3e4"}, "config": {"enabled": true, "materialized": "table", "persist_docs": {}, "post-hook": [], "pre-hook": [], "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "stg_asana", "database": null, "tags": [], "full_refresh": null}, "tags": [], "refs": [["stg_asana__task_follower_tmp"], ["stg_asana__task_follower_tmp"]], "sources": [], "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"]}, "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": "models/stg_asana.yml", "build_path": "target/compiled/asana_source/models/stg_asana__task_follower.sql", "deferred": false, "unrendered_config": {"schema": "stg_asana", "materialized": "table"}, "compiled_sql": "with base as (\n\n select * \n from `dbt-package-testing`.`asana_source_integration_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": "`dbt-package-testing`.`asana_source_integration_tests_stg_asana`.`stg_asana__task_follower`"}, "model.asana_source.stg_asana__story_tmp": {"raw_sql": "select * \nfrom {{ var('story') }}", "compiled": true, "database": "dbt-package-testing", "schema": "asana_source_integration_tests_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/joseph.markiewicz/Documents/dbt_packages/Asana/dbt_asana/integration_tests/dbt_modules/asana_source", "path": "tmp/stg_asana__story_tmp.sql", "original_file_path": "models/tmp/stg_asana__story_tmp.sql", "name": "stg_asana__story_tmp", "resource_type": "model", "alias": "stg_asana__story_tmp", "checksum": {"name": "sha256", "checksum": "699a08f0282626b405f0b4e5216cdbaa879e399314594a61b63ff4a7b042f677"}, "config": {"enabled": true, "materialized": "table", "persist_docs": {}, "post-hook": [], "pre-hook": [], "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "stg_asana", "database": null, "tags": [], "full_refresh": null}, "tags": [], "refs": [["story_data"]], "sources": [], "depends_on": {"macros": [], "nodes": ["seed.asana_integration_tests.story_data"]}, "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "build_path": "target/compiled/asana_source/models/tmp/stg_asana__story_tmp.sql", "deferred": false, "unrendered_config": {"schema": "stg_asana", "materialized": "table"}, "compiled_sql": "select * \nfrom `dbt-package-testing`.`asana_source_integration_tests`.`story_data`", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`asana_source_integration_tests_stg_asana`.`stg_asana__story_tmp`"}, "model.asana_source.stg_asana__team_tmp": {"raw_sql": "select * \nfrom {{ var('team') }}", "compiled": true, "database": "dbt-package-testing", "schema": "asana_source_integration_tests_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/joseph.markiewicz/Documents/dbt_packages/Asana/dbt_asana/integration_tests/dbt_modules/asana_source", "path": "tmp/stg_asana__team_tmp.sql", "original_file_path": "models/tmp/stg_asana__team_tmp.sql", "name": "stg_asana__team_tmp", "resource_type": "model", "alias": "stg_asana__team_tmp", "checksum": {"name": "sha256", "checksum": "8c107692c9394962da82e0c2460045e6686d962c1eefe0cff564c618aed7a17d"}, "config": {"enabled": true, "materialized": "table", "persist_docs": {}, "post-hook": [], "pre-hook": [], "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "stg_asana", "database": null, "tags": [], "full_refresh": null}, "tags": [], "refs": [["team_data"]], "sources": [], "depends_on": {"macros": [], "nodes": ["seed.asana_integration_tests.team_data"]}, "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "build_path": "target/compiled/asana_source/models/tmp/stg_asana__team_tmp.sql", "deferred": false, "unrendered_config": {"schema": "stg_asana", "materialized": "table"}, "compiled_sql": "select * \nfrom `dbt-package-testing`.`asana_source_integration_tests`.`team_data`", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`asana_source_integration_tests_stg_asana`.`stg_asana__team_tmp`"}, "model.asana_source.stg_asana__task_tmp": {"raw_sql": "select * \nfrom {{ var('task') }}", "compiled": true, "database": "dbt-package-testing", "schema": "asana_source_integration_tests_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/joseph.markiewicz/Documents/dbt_packages/Asana/dbt_asana/integration_tests/dbt_modules/asana_source", "path": "tmp/stg_asana__task_tmp.sql", "original_file_path": "models/tmp/stg_asana__task_tmp.sql", "name": "stg_asana__task_tmp", "resource_type": "model", "alias": "stg_asana__task_tmp", "checksum": {"name": "sha256", "checksum": "ffb26301a2c952951441cf068b916101fb5cbb9841242e3511499262ffabd879"}, "config": {"enabled": true, "materialized": "table", "persist_docs": {}, "post-hook": [], "pre-hook": [], "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "stg_asana", "database": null, "tags": [], "full_refresh": null}, "tags": [], "refs": [["task_data"]], "sources": [], "depends_on": {"macros": [], "nodes": ["seed.asana_integration_tests.task_data"]}, "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "build_path": "target/compiled/asana_source/models/tmp/stg_asana__task_tmp.sql", "deferred": false, "unrendered_config": {"schema": "stg_asana", "materialized": "table"}, "compiled_sql": "select * \nfrom `dbt-package-testing`.`asana_source_integration_tests`.`task_data`", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`asana_source_integration_tests_stg_asana`.`stg_asana__task_tmp`"}, "model.asana_source.stg_asana__task_follower_tmp": {"raw_sql": "select * \nfrom {{ var('task_follower') }}", "compiled": true, "database": "dbt-package-testing", "schema": "asana_source_integration_tests_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/joseph.markiewicz/Documents/dbt_packages/Asana/dbt_asana/integration_tests/dbt_modules/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", "resource_type": "model", "alias": "stg_asana__task_follower_tmp", "checksum": {"name": "sha256", "checksum": "d03af085dd9a99b6a0d491b3729504de132fe2a3c8b930f72cb6d6774f714896"}, "config": {"enabled": true, "materialized": "table", "persist_docs": {}, "post-hook": [], "pre-hook": [], "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "stg_asana", "database": null, "tags": [], "full_refresh": null}, "tags": [], "refs": [["task_follower_data"]], "sources": [], "depends_on": {"macros": [], "nodes": ["seed.asana_integration_tests.task_follower_data"]}, "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "build_path": "target/compiled/asana_source/models/tmp/stg_asana__task_follower_tmp.sql", "deferred": false, "unrendered_config": {"schema": "stg_asana", "materialized": "table"}, "compiled_sql": "select * \nfrom `dbt-package-testing`.`asana_source_integration_tests`.`task_follower_data`", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`asana_source_integration_tests_stg_asana`.`stg_asana__task_follower_tmp`"}, "model.asana_source.stg_asana__tag_tmp": {"raw_sql": "select * \nfrom {{ var('tag') }}", "compiled": true, "database": "dbt-package-testing", "schema": "asana_source_integration_tests_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/joseph.markiewicz/Documents/dbt_packages/Asana/dbt_asana/integration_tests/dbt_modules/asana_source", "path": "tmp/stg_asana__tag_tmp.sql", "original_file_path": "models/tmp/stg_asana__tag_tmp.sql", "name": "stg_asana__tag_tmp", "resource_type": "model", "alias": "stg_asana__tag_tmp", "checksum": {"name": "sha256", "checksum": "c394a64eb436d4592c23e4c1876d4e001907bdf6de6fa1267f9bd47c83678711"}, "config": {"enabled": true, "materialized": "table", "persist_docs": {}, "post-hook": [], "pre-hook": [], "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "stg_asana", "database": null, "tags": [], "full_refresh": null}, "tags": [], "refs": [["tag_data"]], "sources": [], "depends_on": {"macros": [], "nodes": ["seed.asana_integration_tests.tag_data"]}, "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "build_path": "target/compiled/asana_source/models/tmp/stg_asana__tag_tmp.sql", "deferred": false, "unrendered_config": {"schema": "stg_asana", "materialized": "table"}, "compiled_sql": "select * \nfrom `dbt-package-testing`.`asana_source_integration_tests`.`tag_data`", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`asana_source_integration_tests_stg_asana`.`stg_asana__tag_tmp`"}, "model.asana_source.stg_asana__task_section_tmp": {"raw_sql": "select * \nfrom {{ var('task_section') }}", "compiled": true, "database": "dbt-package-testing", "schema": "asana_source_integration_tests_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/joseph.markiewicz/Documents/dbt_packages/Asana/dbt_asana/integration_tests/dbt_modules/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", "resource_type": "model", "alias": "stg_asana__task_section_tmp", "checksum": {"name": "sha256", "checksum": "453db03084996d17e88a0f1ffda90ee349df4f262db7a3523578f5d4c6a4e5e6"}, "config": {"enabled": true, "materialized": "table", "persist_docs": {}, "post-hook": [], "pre-hook": [], "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "stg_asana", "database": null, "tags": [], "full_refresh": null}, "tags": [], "refs": [["task_section_data"]], "sources": [], "depends_on": {"macros": [], "nodes": ["seed.asana_integration_tests.task_section_data"]}, "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "build_path": "target/compiled/asana_source/models/tmp/stg_asana__task_section_tmp.sql", "deferred": false, "unrendered_config": {"schema": "stg_asana", "materialized": "table"}, "compiled_sql": "select * \nfrom `dbt-package-testing`.`asana_source_integration_tests`.`task_section_data`", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`asana_source_integration_tests_stg_asana`.`stg_asana__task_section_tmp`"}, "model.asana_source.stg_asana__task_tag_tmp": {"raw_sql": "select * \nfrom {{ var('task_tag') }}", "compiled": true, "database": "dbt-package-testing", "schema": "asana_source_integration_tests_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/joseph.markiewicz/Documents/dbt_packages/Asana/dbt_asana/integration_tests/dbt_modules/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", "resource_type": "model", "alias": "stg_asana__task_tag_tmp", "checksum": {"name": "sha256", "checksum": "00c6fa0be01310e2a827ce46dbadeb2cf3cc24dda4dc22142ed81b7bb0f85a4d"}, "config": {"enabled": true, "materialized": "table", "persist_docs": {}, "post-hook": [], "pre-hook": [], "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "stg_asana", "database": null, "tags": [], "full_refresh": null}, "tags": [], "refs": [["task_tag_data"]], "sources": [], "depends_on": {"macros": [], "nodes": ["seed.asana_integration_tests.task_tag_data"]}, "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "build_path": "target/compiled/asana_source/models/tmp/stg_asana__task_tag_tmp.sql", "deferred": false, "unrendered_config": {"schema": "stg_asana", "materialized": "table"}, "compiled_sql": "select * \nfrom `dbt-package-testing`.`asana_source_integration_tests`.`task_tag_data`", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`asana_source_integration_tests_stg_asana`.`stg_asana__task_tag_tmp`"}, "model.asana_source.stg_asana__user_tmp": {"raw_sql": "select * \nfrom {{ var('user') }}", "compiled": true, "database": "dbt-package-testing", "schema": "asana_source_integration_tests_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/joseph.markiewicz/Documents/dbt_packages/Asana/dbt_asana/integration_tests/dbt_modules/asana_source", "path": "tmp/stg_asana__user_tmp.sql", "original_file_path": "models/tmp/stg_asana__user_tmp.sql", "name": "stg_asana__user_tmp", "resource_type": "model", "alias": "stg_asana__user_tmp", "checksum": {"name": "sha256", "checksum": "6a45d1112d3ae79f22784f5fd5723a27b7894d57aea5795a37921842affc0085"}, "config": {"enabled": true, "materialized": "table", "persist_docs": {}, "post-hook": [], "pre-hook": [], "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "stg_asana", "database": null, "tags": [], "full_refresh": null}, "tags": [], "refs": [["user_data"]], "sources": [], "depends_on": {"macros": [], "nodes": ["seed.asana_integration_tests.user_data"]}, "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "build_path": "target/compiled/asana_source/models/tmp/stg_asana__user_tmp.sql", "deferred": false, "unrendered_config": {"schema": "stg_asana", "materialized": "table"}, "compiled_sql": "select * \nfrom `dbt-package-testing`.`asana_source_integration_tests`.`user_data`", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`asana_source_integration_tests_stg_asana`.`stg_asana__user_tmp`"}, "model.asana_source.stg_asana__section_tmp": {"raw_sql": "select * \nfrom {{ var('section') }}", "compiled": true, "database": "dbt-package-testing", "schema": "asana_source_integration_tests_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/joseph.markiewicz/Documents/dbt_packages/Asana/dbt_asana/integration_tests/dbt_modules/asana_source", "path": "tmp/stg_asana__section_tmp.sql", "original_file_path": "models/tmp/stg_asana__section_tmp.sql", "name": "stg_asana__section_tmp", "resource_type": "model", "alias": "stg_asana__section_tmp", "checksum": {"name": "sha256", "checksum": "83155348ae27cce121000df7d3d07cd4f734098dca2747df7dd5affde1c84188"}, "config": {"enabled": true, "materialized": "table", "persist_docs": {}, "post-hook": [], "pre-hook": [], "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "stg_asana", "database": null, "tags": [], "full_refresh": null}, "tags": [], "refs": [["section_data"]], "sources": [], "depends_on": {"macros": [], "nodes": ["seed.asana_integration_tests.section_data"]}, "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "build_path": "target/compiled/asana_source/models/tmp/stg_asana__section_tmp.sql", "deferred": false, "unrendered_config": {"schema": "stg_asana", "materialized": "table"}, "compiled_sql": "select * \nfrom `dbt-package-testing`.`asana_source_integration_tests`.`section_data`", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`asana_source_integration_tests_stg_asana`.`stg_asana__section_tmp`"}, "model.asana_source.stg_asana__project_tmp": {"raw_sql": "select * \nfrom {{ var('project') }}", "compiled": true, "database": "dbt-package-testing", "schema": "asana_source_integration_tests_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/joseph.markiewicz/Documents/dbt_packages/Asana/dbt_asana/integration_tests/dbt_modules/asana_source", "path": "tmp/stg_asana__project_tmp.sql", "original_file_path": "models/tmp/stg_asana__project_tmp.sql", "name": "stg_asana__project_tmp", "resource_type": "model", "alias": "stg_asana__project_tmp", "checksum": {"name": "sha256", "checksum": "2c1320ac7d1c876b9aa540a4aa0a07bcacfa92e35d74a60cb09a5948ac6869ad"}, "config": {"enabled": true, "materialized": "table", "persist_docs": {}, "post-hook": [], "pre-hook": [], "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "stg_asana", "database": null, "tags": [], "full_refresh": null}, "tags": [], "refs": [["project_data"]], "sources": [], "depends_on": {"macros": [], "nodes": ["seed.asana_integration_tests.project_data"]}, "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "build_path": "target/compiled/asana_source/models/tmp/stg_asana__project_tmp.sql", "deferred": false, "unrendered_config": {"schema": "stg_asana", "materialized": "table"}, "compiled_sql": "select * \nfrom `dbt-package-testing`.`asana_source_integration_tests`.`project_data`", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`asana_source_integration_tests_stg_asana`.`stg_asana__project_tmp`"}, "model.asana_source.stg_asana__project_task_tmp": {"raw_sql": "select * \nfrom {{ var('project_task') }}", "compiled": true, "database": "dbt-package-testing", "schema": "asana_source_integration_tests_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/joseph.markiewicz/Documents/dbt_packages/Asana/dbt_asana/integration_tests/dbt_modules/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", "resource_type": "model", "alias": "stg_asana__project_task_tmp", "checksum": {"name": "sha256", "checksum": "2ad5271ec001d7cb80698feb2fcc08b189f360d756f86feb074bbd904002b10e"}, "config": {"enabled": true, "materialized": "table", "persist_docs": {}, "post-hook": [], "pre-hook": [], "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "stg_asana", "database": null, "tags": [], "full_refresh": null}, "tags": [], "refs": [["project_task_data"]], "sources": [], "depends_on": {"macros": [], "nodes": ["seed.asana_integration_tests.project_task_data"]}, "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "build_path": "target/compiled/asana_source/models/tmp/stg_asana__project_task_tmp.sql", "deferred": false, "unrendered_config": {"schema": "stg_asana", "materialized": "table"}, "compiled_sql": "select * \nfrom `dbt-package-testing`.`asana_source_integration_tests`.`project_task_data`", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`asana_source_integration_tests_stg_asana`.`stg_asana__project_task_tmp`"}, "test.asana_source.unique_stg_asana__project_project_id": {"raw_sql": "{{ config(severity='ERROR') }}{{ test_unique(**_dbt_schema_test_kwargs) }}", "test_metadata": {"namespace": null, "name": "unique", "kwargs": {"column_name": "project_id", "model": "{{ ref('stg_asana__project') }}"}}, "compiled": true, "database": "dbt-package-testing", "schema": "asana_source_integration_tests_stg_asana", "fqn": ["asana_source", "schema_test", "unique_stg_asana__project_project_id"], "unique_id": "test.asana_source.unique_stg_asana__project_project_id", "package_name": "asana_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Asana/dbt_asana/integration_tests/dbt_modules/asana_source", "path": "schema_test/unique_stg_asana__project_project_id.sql", "original_file_path": "models/stg_asana.yml", "name": "unique_stg_asana__project_project_id", "resource_type": "test", "alias": "unique_stg_asana__project_project_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "materialized": "table", "persist_docs": {}, "post-hook": [], "pre-hook": [], "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "stg_asana", "database": null, "tags": [], "full_refresh": null, "severity": "ERROR"}, "tags": ["schema"], "refs": [["stg_asana__project"]], "sources": [], "depends_on": {"macros": ["macro.dbt.test_unique"], "nodes": ["model.asana_source.stg_asana__project"]}, "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "build_path": "target/compiled/asana_source/models/stg_asana.yml/schema_test/unique_stg_asana__project_project_id.sql", "deferred": false, "unrendered_config": {"schema": "stg_asana", "materialized": "table", "severity": "ERROR"}, "compiled_sql": "\n \n \n\n\n\nselect count(*) as validation_errors\nfrom (\n\n select\n project_id\n\n from `dbt-package-testing`.`asana_source_integration_tests_stg_asana`.`stg_asana__project`\n where project_id is not null\n group by project_id\n having count(*) > 1\n\n) validation_errors\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "project_id"}, "test.asana_source.not_null_stg_asana__project_project_id": {"raw_sql": "{{ config(severity='ERROR') }}{{ test_not_null(**_dbt_schema_test_kwargs) }}", "test_metadata": {"namespace": null, "name": "not_null", "kwargs": {"column_name": "project_id", "model": "{{ ref('stg_asana__project') }}"}}, "compiled": true, "database": "dbt-package-testing", "schema": "asana_source_integration_tests_stg_asana", "fqn": ["asana_source", "schema_test", "not_null_stg_asana__project_project_id"], "unique_id": "test.asana_source.not_null_stg_asana__project_project_id", "package_name": "asana_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Asana/dbt_asana/integration_tests/dbt_modules/asana_source", "path": "schema_test/not_null_stg_asana__project_project_id.sql", "original_file_path": "models/stg_asana.yml", "name": "not_null_stg_asana__project_project_id", "resource_type": "test", "alias": "not_null_stg_asana__project_project_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "materialized": "table", "persist_docs": {}, "post-hook": [], "pre-hook": [], "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "stg_asana", "database": null, "tags": [], "full_refresh": null, "severity": "ERROR"}, "tags": ["schema"], "refs": [["stg_asana__project"]], "sources": [], "depends_on": {"macros": ["macro.dbt.test_not_null"], "nodes": ["model.asana_source.stg_asana__project"]}, "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "build_path": "target/compiled/asana_source/models/stg_asana.yml/schema_test/not_null_stg_asana__project_project_id.sql", "deferred": false, "unrendered_config": {"schema": "stg_asana", "materialized": "table", "severity": "ERROR"}, "compiled_sql": "\n \n \n\n\n\nselect count(*) as validation_errors\nfrom `dbt-package-testing`.`asana_source_integration_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"}, "test.asana_source.not_null_stg_asana__project_task_project_id": {"raw_sql": "{{ config(severity='ERROR') }}{{ test_not_null(**_dbt_schema_test_kwargs) }}", "test_metadata": {"namespace": null, "name": "not_null", "kwargs": {"column_name": "project_id", "model": "{{ ref('stg_asana__project_task') }}"}}, "compiled": true, "database": "dbt-package-testing", "schema": "asana_source_integration_tests_stg_asana", "fqn": ["asana_source", "schema_test", "not_null_stg_asana__project_task_project_id"], "unique_id": "test.asana_source.not_null_stg_asana__project_task_project_id", "package_name": "asana_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Asana/dbt_asana/integration_tests/dbt_modules/asana_source", "path": "schema_test/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", "resource_type": "test", "alias": "not_null_stg_asana__project_task_project_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "materialized": "table", "persist_docs": {}, "post-hook": [], "pre-hook": [], "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "stg_asana", "database": null, "tags": [], "full_refresh": null, "severity": "ERROR"}, "tags": ["schema"], "refs": [["stg_asana__project_task"]], "sources": [], "depends_on": {"macros": ["macro.dbt.test_not_null"], "nodes": ["model.asana_source.stg_asana__project_task"]}, "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "build_path": "target/compiled/asana_source/models/stg_asana.yml/schema_test/not_null_stg_asana__project_task_project_id.sql", "deferred": false, "unrendered_config": {"schema": "stg_asana", "materialized": "table", "severity": "ERROR"}, "compiled_sql": "\n \n \n\n\n\nselect count(*) as validation_errors\nfrom `dbt-package-testing`.`asana_source_integration_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"}, "test.asana_source.not_null_stg_asana__project_task_task_id": {"raw_sql": "{{ config(severity='ERROR') }}{{ test_not_null(**_dbt_schema_test_kwargs) }}", "test_metadata": {"namespace": null, "name": "not_null", "kwargs": {"column_name": "task_id", "model": "{{ ref('stg_asana__project_task') }}"}}, "compiled": true, "database": "dbt-package-testing", "schema": "asana_source_integration_tests_stg_asana", "fqn": ["asana_source", "schema_test", "not_null_stg_asana__project_task_task_id"], "unique_id": "test.asana_source.not_null_stg_asana__project_task_task_id", "package_name": "asana_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Asana/dbt_asana/integration_tests/dbt_modules/asana_source", "path": "schema_test/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", "resource_type": "test", "alias": "not_null_stg_asana__project_task_task_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "materialized": "table", "persist_docs": {}, "post-hook": [], "pre-hook": [], "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "stg_asana", "database": null, "tags": [], "full_refresh": null, "severity": "ERROR"}, "tags": ["schema"], "refs": [["stg_asana__project_task"]], "sources": [], "depends_on": {"macros": ["macro.dbt.test_not_null"], "nodes": ["model.asana_source.stg_asana__project_task"]}, "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "build_path": "target/compiled/asana_source/models/stg_asana.yml/schema_test/not_null_stg_asana__project_task_task_id.sql", "deferred": false, "unrendered_config": {"schema": "stg_asana", "materialized": "table", "severity": "ERROR"}, "compiled_sql": "\n \n \n\n\n\nselect count(*) as validation_errors\nfrom `dbt-package-testing`.`asana_source_integration_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"}, "test.asana_source.unique_stg_asana__section_section_id": {"raw_sql": "{{ config(severity='ERROR') }}{{ test_unique(**_dbt_schema_test_kwargs) }}", "test_metadata": {"namespace": null, "name": "unique", "kwargs": {"column_name": "section_id", "model": "{{ ref('stg_asana__section') }}"}}, "compiled": true, "database": "dbt-package-testing", "schema": "asana_source_integration_tests_stg_asana", "fqn": ["asana_source", "schema_test", "unique_stg_asana__section_section_id"], "unique_id": "test.asana_source.unique_stg_asana__section_section_id", "package_name": "asana_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Asana/dbt_asana/integration_tests/dbt_modules/asana_source", "path": "schema_test/unique_stg_asana__section_section_id.sql", "original_file_path": "models/stg_asana.yml", "name": "unique_stg_asana__section_section_id", "resource_type": "test", "alias": "unique_stg_asana__section_section_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "materialized": "table", "persist_docs": {}, "post-hook": [], "pre-hook": [], "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "stg_asana", "database": null, "tags": [], "full_refresh": null, "severity": "ERROR"}, "tags": ["schema"], "refs": [["stg_asana__section"]], "sources": [], "depends_on": {"macros": ["macro.dbt.test_unique"], "nodes": ["model.asana_source.stg_asana__section"]}, "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "build_path": "target/compiled/asana_source/models/stg_asana.yml/schema_test/unique_stg_asana__section_section_id.sql", "deferred": false, "unrendered_config": {"schema": "stg_asana", "materialized": "table", "severity": "ERROR"}, "compiled_sql": "\n \n \n\n\n\nselect count(*) as validation_errors\nfrom (\n\n select\n section_id\n\n from `dbt-package-testing`.`asana_source_integration_tests_stg_asana`.`stg_asana__section`\n where section_id is not null\n group by section_id\n having count(*) > 1\n\n) validation_errors\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "section_id"}, "test.asana_source.not_null_stg_asana__section_section_id": {"raw_sql": "{{ config(severity='ERROR') }}{{ test_not_null(**_dbt_schema_test_kwargs) }}", "test_metadata": {"namespace": null, "name": "not_null", "kwargs": {"column_name": "section_id", "model": "{{ ref('stg_asana__section') }}"}}, "compiled": true, "database": "dbt-package-testing", "schema": "asana_source_integration_tests_stg_asana", "fqn": ["asana_source", "schema_test", "not_null_stg_asana__section_section_id"], "unique_id": "test.asana_source.not_null_stg_asana__section_section_id", "package_name": "asana_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Asana/dbt_asana/integration_tests/dbt_modules/asana_source", "path": "schema_test/not_null_stg_asana__section_section_id.sql", "original_file_path": "models/stg_asana.yml", "name": "not_null_stg_asana__section_section_id", "resource_type": "test", "alias": "not_null_stg_asana__section_section_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "materialized": "table", "persist_docs": {}, "post-hook": [], "pre-hook": [], "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "stg_asana", "database": null, "tags": [], "full_refresh": null, "severity": "ERROR"}, "tags": ["schema"], "refs": [["stg_asana__section"]], "sources": [], "depends_on": {"macros": ["macro.dbt.test_not_null"], "nodes": ["model.asana_source.stg_asana__section"]}, "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "build_path": "target/compiled/asana_source/models/stg_asana.yml/schema_test/not_null_stg_asana__section_section_id.sql", "deferred": false, "unrendered_config": {"schema": "stg_asana", "materialized": "table", "severity": "ERROR"}, "compiled_sql": "\n \n \n\n\n\nselect count(*) as validation_errors\nfrom `dbt-package-testing`.`asana_source_integration_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"}, "test.asana_source.unique_stg_asana__story_story_id": {"raw_sql": "{{ config(severity='ERROR') }}{{ test_unique(**_dbt_schema_test_kwargs) }}", "test_metadata": {"namespace": null, "name": "unique", "kwargs": {"column_name": "story_id", "model": "{{ ref('stg_asana__story') }}"}}, "compiled": true, "database": "dbt-package-testing", "schema": "asana_source_integration_tests_stg_asana", "fqn": ["asana_source", "schema_test", "unique_stg_asana__story_story_id"], "unique_id": "test.asana_source.unique_stg_asana__story_story_id", "package_name": "asana_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Asana/dbt_asana/integration_tests/dbt_modules/asana_source", "path": "schema_test/unique_stg_asana__story_story_id.sql", "original_file_path": "models/stg_asana.yml", "name": "unique_stg_asana__story_story_id", "resource_type": "test", "alias": "unique_stg_asana__story_story_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "materialized": "table", "persist_docs": {}, "post-hook": [], "pre-hook": [], "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "stg_asana", "database": null, "tags": [], "full_refresh": null, "severity": "ERROR"}, "tags": ["schema"], "refs": [["stg_asana__story"]], "sources": [], "depends_on": {"macros": ["macro.dbt.test_unique"], "nodes": ["model.asana_source.stg_asana__story"]}, "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "build_path": "target/compiled/asana_source/models/stg_asana.yml/schema_test/unique_stg_asana__story_story_id.sql", "deferred": false, "unrendered_config": {"schema": "stg_asana", "materialized": "table", "severity": "ERROR"}, "compiled_sql": "\n \n \n\n\n\nselect count(*) as validation_errors\nfrom (\n\n select\n story_id\n\n from `dbt-package-testing`.`asana_source_integration_tests_stg_asana`.`stg_asana__story`\n where story_id is not null\n group by story_id\n having count(*) > 1\n\n) validation_errors\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "story_id"}, "test.asana_source.not_null_stg_asana__story_story_id": {"raw_sql": "{{ config(severity='ERROR') }}{{ test_not_null(**_dbt_schema_test_kwargs) }}", "test_metadata": {"namespace": null, "name": "not_null", "kwargs": {"column_name": "story_id", "model": "{{ ref('stg_asana__story') }}"}}, "compiled": true, "database": "dbt-package-testing", "schema": "asana_source_integration_tests_stg_asana", "fqn": ["asana_source", "schema_test", "not_null_stg_asana__story_story_id"], "unique_id": "test.asana_source.not_null_stg_asana__story_story_id", "package_name": "asana_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Asana/dbt_asana/integration_tests/dbt_modules/asana_source", "path": "schema_test/not_null_stg_asana__story_story_id.sql", "original_file_path": "models/stg_asana.yml", "name": "not_null_stg_asana__story_story_id", "resource_type": "test", "alias": "not_null_stg_asana__story_story_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "materialized": "table", "persist_docs": {}, "post-hook": [], "pre-hook": [], "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "stg_asana", "database": null, "tags": [], "full_refresh": null, "severity": "ERROR"}, "tags": ["schema"], "refs": [["stg_asana__story"]], "sources": [], "depends_on": {"macros": ["macro.dbt.test_not_null"], "nodes": ["model.asana_source.stg_asana__story"]}, "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "build_path": "target/compiled/asana_source/models/stg_asana.yml/schema_test/not_null_stg_asana__story_story_id.sql", "deferred": false, "unrendered_config": {"schema": "stg_asana", "materialized": "table", "severity": "ERROR"}, "compiled_sql": "\n \n \n\n\n\nselect count(*) as validation_errors\nfrom `dbt-package-testing`.`asana_source_integration_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"}, "test.asana_source.not_null_stg_asana__story_target_task_id": {"raw_sql": "{{ config(severity='ERROR') }}{{ test_not_null(**_dbt_schema_test_kwargs) }}", "test_metadata": {"namespace": null, "name": "not_null", "kwargs": {"column_name": "target_task_id", "model": "{{ ref('stg_asana__story') }}"}}, "compiled": true, "database": "dbt-package-testing", "schema": "asana_source_integration_tests_stg_asana", "fqn": ["asana_source", "schema_test", "not_null_stg_asana__story_target_task_id"], "unique_id": "test.asana_source.not_null_stg_asana__story_target_task_id", "package_name": "asana_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Asana/dbt_asana/integration_tests/dbt_modules/asana_source", "path": "schema_test/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", "resource_type": "test", "alias": "not_null_stg_asana__story_target_task_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "materialized": "table", "persist_docs": {}, "post-hook": [], "pre-hook": [], "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "stg_asana", "database": null, "tags": [], "full_refresh": null, "severity": "ERROR"}, "tags": ["schema"], "refs": [["stg_asana__story"]], "sources": [], "depends_on": {"macros": ["macro.dbt.test_not_null"], "nodes": ["model.asana_source.stg_asana__story"]}, "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "build_path": "target/compiled/asana_source/models/stg_asana.yml/schema_test/not_null_stg_asana__story_target_task_id.sql", "deferred": false, "unrendered_config": {"schema": "stg_asana", "materialized": "table", "severity": "ERROR"}, "compiled_sql": "\n \n \n\n\n\nselect count(*) as validation_errors\nfrom `dbt-package-testing`.`asana_source_integration_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"}, "test.asana_source.unique_stg_asana__tag_tag_id": {"raw_sql": "{{ config(severity='ERROR') }}{{ test_unique(**_dbt_schema_test_kwargs) }}", "test_metadata": {"namespace": null, "name": "unique", "kwargs": {"column_name": "tag_id", "model": "{{ ref('stg_asana__tag') }}"}}, "compiled": true, "database": "dbt-package-testing", "schema": "asana_source_integration_tests_stg_asana", "fqn": ["asana_source", "schema_test", "unique_stg_asana__tag_tag_id"], "unique_id": "test.asana_source.unique_stg_asana__tag_tag_id", "package_name": "asana_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Asana/dbt_asana/integration_tests/dbt_modules/asana_source", "path": "schema_test/unique_stg_asana__tag_tag_id.sql", "original_file_path": "models/stg_asana.yml", "name": "unique_stg_asana__tag_tag_id", "resource_type": "test", "alias": "unique_stg_asana__tag_tag_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "materialized": "table", "persist_docs": {}, "post-hook": [], "pre-hook": [], "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "stg_asana", "database": null, "tags": [], "full_refresh": null, "severity": "ERROR"}, "tags": ["schema"], "refs": [["stg_asana__tag"]], "sources": [], "depends_on": {"macros": ["macro.dbt.test_unique"], "nodes": ["model.asana_source.stg_asana__tag"]}, "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "build_path": "target/compiled/asana_source/models/stg_asana.yml/schema_test/unique_stg_asana__tag_tag_id.sql", "deferred": false, "unrendered_config": {"schema": "stg_asana", "materialized": "table", "severity": "ERROR"}, "compiled_sql": "\n \n \n\n\n\nselect count(*) as validation_errors\nfrom (\n\n select\n tag_id\n\n from `dbt-package-testing`.`asana_source_integration_tests_stg_asana`.`stg_asana__tag`\n where tag_id is not null\n group by tag_id\n having count(*) > 1\n\n) validation_errors\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "tag_id"}, "test.asana_source.not_null_stg_asana__tag_tag_id": {"raw_sql": "{{ config(severity='ERROR') }}{{ test_not_null(**_dbt_schema_test_kwargs) }}", "test_metadata": {"namespace": null, "name": "not_null", "kwargs": {"column_name": "tag_id", "model": "{{ ref('stg_asana__tag') }}"}}, "compiled": true, "database": "dbt-package-testing", "schema": "asana_source_integration_tests_stg_asana", "fqn": ["asana_source", "schema_test", "not_null_stg_asana__tag_tag_id"], "unique_id": "test.asana_source.not_null_stg_asana__tag_tag_id", "package_name": "asana_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Asana/dbt_asana/integration_tests/dbt_modules/asana_source", "path": "schema_test/not_null_stg_asana__tag_tag_id.sql", "original_file_path": "models/stg_asana.yml", "name": "not_null_stg_asana__tag_tag_id", "resource_type": "test", "alias": "not_null_stg_asana__tag_tag_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "materialized": "table", "persist_docs": {}, "post-hook": [], "pre-hook": [], "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "stg_asana", "database": null, "tags": [], "full_refresh": null, "severity": "ERROR"}, "tags": ["schema"], "refs": [["stg_asana__tag"]], "sources": [], "depends_on": {"macros": ["macro.dbt.test_not_null"], "nodes": ["model.asana_source.stg_asana__tag"]}, "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "build_path": "target/compiled/asana_source/models/stg_asana.yml/schema_test/not_null_stg_asana__tag_tag_id.sql", "deferred": false, "unrendered_config": {"schema": "stg_asana", "materialized": "table", "severity": "ERROR"}, "compiled_sql": "\n \n \n\n\n\nselect count(*) as validation_errors\nfrom `dbt-package-testing`.`asana_source_integration_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"}, "test.asana_source.unique_stg_asana__task_task_id": {"raw_sql": "{{ config(severity='ERROR') }}{{ test_unique(**_dbt_schema_test_kwargs) }}", "test_metadata": {"namespace": null, "name": "unique", "kwargs": {"column_name": "task_id", "model": "{{ ref('stg_asana__task') }}"}}, "compiled": true, "database": "dbt-package-testing", "schema": "asana_source_integration_tests_stg_asana", "fqn": ["asana_source", "schema_test", "unique_stg_asana__task_task_id"], "unique_id": "test.asana_source.unique_stg_asana__task_task_id", "package_name": "asana_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Asana/dbt_asana/integration_tests/dbt_modules/asana_source", "path": "schema_test/unique_stg_asana__task_task_id.sql", "original_file_path": "models/stg_asana.yml", "name": "unique_stg_asana__task_task_id", "resource_type": "test", "alias": "unique_stg_asana__task_task_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "materialized": "table", "persist_docs": {}, "post-hook": [], "pre-hook": [], "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "stg_asana", "database": null, "tags": [], "full_refresh": null, "severity": "ERROR"}, "tags": ["schema"], "refs": [["stg_asana__task"]], "sources": [], "depends_on": {"macros": ["macro.dbt.test_unique"], "nodes": ["model.asana_source.stg_asana__task"]}, "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "build_path": "target/compiled/asana_source/models/stg_asana.yml/schema_test/unique_stg_asana__task_task_id.sql", "deferred": false, "unrendered_config": {"schema": "stg_asana", "materialized": "table", "severity": "ERROR"}, "compiled_sql": "\n \n \n\n\n\nselect count(*) as validation_errors\nfrom (\n\n select\n task_id\n\n from `dbt-package-testing`.`asana_source_integration_tests_stg_asana`.`stg_asana__task`\n where task_id is not null\n group by task_id\n having count(*) > 1\n\n) validation_errors\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "task_id"}, "test.asana_source.not_null_stg_asana__task_task_id": {"raw_sql": "{{ config(severity='ERROR') }}{{ test_not_null(**_dbt_schema_test_kwargs) }}", "test_metadata": {"namespace": null, "name": "not_null", "kwargs": {"column_name": "task_id", "model": "{{ ref('stg_asana__task') }}"}}, "compiled": true, "database": "dbt-package-testing", "schema": "asana_source_integration_tests_stg_asana", "fqn": ["asana_source", "schema_test", "not_null_stg_asana__task_task_id"], "unique_id": "test.asana_source.not_null_stg_asana__task_task_id", "package_name": "asana_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Asana/dbt_asana/integration_tests/dbt_modules/asana_source", "path": "schema_test/not_null_stg_asana__task_task_id.sql", "original_file_path": "models/stg_asana.yml", "name": "not_null_stg_asana__task_task_id", "resource_type": "test", "alias": "not_null_stg_asana__task_task_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "materialized": "table", "persist_docs": {}, "post-hook": [], "pre-hook": [], "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "stg_asana", "database": null, "tags": [], "full_refresh": null, "severity": "ERROR"}, "tags": ["schema"], "refs": [["stg_asana__task"]], "sources": [], "depends_on": {"macros": ["macro.dbt.test_not_null"], "nodes": ["model.asana_source.stg_asana__task"]}, "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "build_path": "target/compiled/asana_source/models/stg_asana.yml/schema_test/not_null_stg_asana__task_task_id.sql", "deferred": false, "unrendered_config": {"schema": "stg_asana", "materialized": "table", "severity": "ERROR"}, "compiled_sql": "\n \n \n\n\n\nselect count(*) as validation_errors\nfrom `dbt-package-testing`.`asana_source_integration_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"}, "test.asana_source.not_null_stg_asana__task_follower_task_id": {"raw_sql": "{{ config(severity='ERROR') }}{{ test_not_null(**_dbt_schema_test_kwargs) }}", "test_metadata": {"namespace": null, "name": "not_null", "kwargs": {"column_name": "task_id", "model": "{{ ref('stg_asana__task_follower') }}"}}, "compiled": true, "database": "dbt-package-testing", "schema": "asana_source_integration_tests_stg_asana", "fqn": ["asana_source", "schema_test", "not_null_stg_asana__task_follower_task_id"], "unique_id": "test.asana_source.not_null_stg_asana__task_follower_task_id", "package_name": "asana_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Asana/dbt_asana/integration_tests/dbt_modules/asana_source", "path": "schema_test/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", "resource_type": "test", "alias": "not_null_stg_asana__task_follower_task_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "materialized": "table", "persist_docs": {}, "post-hook": [], "pre-hook": [], "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "stg_asana", "database": null, "tags": [], "full_refresh": null, "severity": "ERROR"}, "tags": ["schema"], "refs": [["stg_asana__task_follower"]], "sources": [], "depends_on": {"macros": ["macro.dbt.test_not_null"], "nodes": ["model.asana_source.stg_asana__task_follower"]}, "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "build_path": "target/compiled/asana_source/models/stg_asana.yml/schema_test/not_null_stg_asana__task_follower_task_id.sql", "deferred": false, "unrendered_config": {"schema": "stg_asana", "materialized": "table", "severity": "ERROR"}, "compiled_sql": "\n \n \n\n\n\nselect count(*) as validation_errors\nfrom `dbt-package-testing`.`asana_source_integration_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"}, "test.asana_source.not_null_stg_asana__task_follower_user_id": {"raw_sql": "{{ config(severity='ERROR') }}{{ test_not_null(**_dbt_schema_test_kwargs) }}", "test_metadata": {"namespace": null, "name": "not_null", "kwargs": {"column_name": "user_id", "model": "{{ ref('stg_asana__task_follower') }}"}}, "compiled": true, "database": "dbt-package-testing", "schema": "asana_source_integration_tests_stg_asana", "fqn": ["asana_source", "schema_test", "not_null_stg_asana__task_follower_user_id"], "unique_id": "test.asana_source.not_null_stg_asana__task_follower_user_id", "package_name": "asana_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Asana/dbt_asana/integration_tests/dbt_modules/asana_source", "path": "schema_test/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", "resource_type": "test", "alias": "not_null_stg_asana__task_follower_user_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "materialized": "table", "persist_docs": {}, "post-hook": [], "pre-hook": [], "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "stg_asana", "database": null, "tags": [], "full_refresh": null, "severity": "ERROR"}, "tags": ["schema"], "refs": [["stg_asana__task_follower"]], "sources": [], "depends_on": {"macros": ["macro.dbt.test_not_null"], "nodes": ["model.asana_source.stg_asana__task_follower"]}, "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "build_path": "target/compiled/asana_source/models/stg_asana.yml/schema_test/not_null_stg_asana__task_follower_user_id.sql", "deferred": false, "unrendered_config": {"schema": "stg_asana", "materialized": "table", "severity": "ERROR"}, "compiled_sql": "\n \n \n\n\n\nselect count(*) as validation_errors\nfrom `dbt-package-testing`.`asana_source_integration_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"}, "test.asana_source.not_null_stg_asana__task_section_task_id": {"raw_sql": "{{ config(severity='ERROR') }}{{ test_not_null(**_dbt_schema_test_kwargs) }}", "test_metadata": {"namespace": null, "name": "not_null", "kwargs": {"column_name": "task_id", "model": "{{ ref('stg_asana__task_section') }}"}}, "compiled": true, "database": "dbt-package-testing", "schema": "asana_source_integration_tests_stg_asana", "fqn": ["asana_source", "schema_test", "not_null_stg_asana__task_section_task_id"], "unique_id": "test.asana_source.not_null_stg_asana__task_section_task_id", "package_name": "asana_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Asana/dbt_asana/integration_tests/dbt_modules/asana_source", "path": "schema_test/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", "resource_type": "test", "alias": "not_null_stg_asana__task_section_task_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "materialized": "table", "persist_docs": {}, "post-hook": [], "pre-hook": [], "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "stg_asana", "database": null, "tags": [], "full_refresh": null, "severity": "ERROR"}, "tags": ["schema"], "refs": [["stg_asana__task_section"]], "sources": [], "depends_on": {"macros": ["macro.dbt.test_not_null"], "nodes": ["model.asana_source.stg_asana__task_section"]}, "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "build_path": "target/compiled/asana_source/models/stg_asana.yml/schema_test/not_null_stg_asana__task_section_task_id.sql", "deferred": false, "unrendered_config": {"schema": "stg_asana", "materialized": "table", "severity": "ERROR"}, "compiled_sql": "\n \n \n\n\n\nselect count(*) as validation_errors\nfrom `dbt-package-testing`.`asana_source_integration_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"}, "test.asana_source.not_null_stg_asana__task_section_section_id": {"raw_sql": "{{ config(severity='ERROR') }}{{ test_not_null(**_dbt_schema_test_kwargs) }}", "test_metadata": {"namespace": null, "name": "not_null", "kwargs": {"column_name": "section_id", "model": "{{ ref('stg_asana__task_section') }}"}}, "compiled": true, "database": "dbt-package-testing", "schema": "asana_source_integration_tests_stg_asana", "fqn": ["asana_source", "schema_test", "not_null_stg_asana__task_section_section_id"], "unique_id": "test.asana_source.not_null_stg_asana__task_section_section_id", "package_name": "asana_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Asana/dbt_asana/integration_tests/dbt_modules/asana_source", "path": "schema_test/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", "resource_type": "test", "alias": "not_null_stg_asana__task_section_section_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "materialized": "table", "persist_docs": {}, "post-hook": [], "pre-hook": [], "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "stg_asana", "database": null, "tags": [], "full_refresh": null, "severity": "ERROR"}, "tags": ["schema"], "refs": [["stg_asana__task_section"]], "sources": [], "depends_on": {"macros": ["macro.dbt.test_not_null"], "nodes": ["model.asana_source.stg_asana__task_section"]}, "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "build_path": "target/compiled/asana_source/models/stg_asana.yml/schema_test/not_null_stg_asana__task_section_section_id.sql", "deferred": false, "unrendered_config": {"schema": "stg_asana", "materialized": "table", "severity": "ERROR"}, "compiled_sql": "\n \n \n\n\n\nselect count(*) as validation_errors\nfrom `dbt-package-testing`.`asana_source_integration_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"}, "test.asana_source.not_null_stg_asana__task_tag_tag_id": {"raw_sql": "{{ config(severity='ERROR') }}{{ test_not_null(**_dbt_schema_test_kwargs) }}", "test_metadata": {"namespace": null, "name": "not_null", "kwargs": {"column_name": "tag_id", "model": "{{ ref('stg_asana__task_tag') }}"}}, "compiled": true, "database": "dbt-package-testing", "schema": "asana_source_integration_tests_stg_asana", "fqn": ["asana_source", "schema_test", "not_null_stg_asana__task_tag_tag_id"], "unique_id": "test.asana_source.not_null_stg_asana__task_tag_tag_id", "package_name": "asana_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Asana/dbt_asana/integration_tests/dbt_modules/asana_source", "path": "schema_test/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", "resource_type": "test", "alias": "not_null_stg_asana__task_tag_tag_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "materialized": "table", "persist_docs": {}, "post-hook": [], "pre-hook": [], "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "stg_asana", "database": null, "tags": [], "full_refresh": null, "severity": "ERROR"}, "tags": ["schema"], "refs": [["stg_asana__task_tag"]], "sources": [], "depends_on": {"macros": ["macro.dbt.test_not_null"], "nodes": ["model.asana_source.stg_asana__task_tag"]}, "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "build_path": "target/compiled/asana_source/models/stg_asana.yml/schema_test/not_null_stg_asana__task_tag_tag_id.sql", "deferred": false, "unrendered_config": {"schema": "stg_asana", "materialized": "table", "severity": "ERROR"}, "compiled_sql": "\n \n \n\n\n\nselect count(*) as validation_errors\nfrom `dbt-package-testing`.`asana_source_integration_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"}, "test.asana_source.not_null_stg_asana__task_tag_task_id": {"raw_sql": "{{ config(severity='ERROR') }}{{ test_not_null(**_dbt_schema_test_kwargs) }}", "test_metadata": {"namespace": null, "name": "not_null", "kwargs": {"column_name": "task_id", "model": "{{ ref('stg_asana__task_tag') }}"}}, "compiled": true, "database": "dbt-package-testing", "schema": "asana_source_integration_tests_stg_asana", "fqn": ["asana_source", "schema_test", "not_null_stg_asana__task_tag_task_id"], "unique_id": "test.asana_source.not_null_stg_asana__task_tag_task_id", "package_name": "asana_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Asana/dbt_asana/integration_tests/dbt_modules/asana_source", "path": "schema_test/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", "resource_type": "test", "alias": "not_null_stg_asana__task_tag_task_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "materialized": "table", "persist_docs": {}, "post-hook": [], "pre-hook": [], "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "stg_asana", "database": null, "tags": [], "full_refresh": null, "severity": "ERROR"}, "tags": ["schema"], "refs": [["stg_asana__task_tag"]], "sources": [], "depends_on": {"macros": ["macro.dbt.test_not_null"], "nodes": ["model.asana_source.stg_asana__task_tag"]}, "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "build_path": "target/compiled/asana_source/models/stg_asana.yml/schema_test/not_null_stg_asana__task_tag_task_id.sql", "deferred": false, "unrendered_config": {"schema": "stg_asana", "materialized": "table", "severity": "ERROR"}, "compiled_sql": "\n \n \n\n\n\nselect count(*) as validation_errors\nfrom `dbt-package-testing`.`asana_source_integration_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"}, "test.asana_source.unique_stg_asana__team_team_id": {"raw_sql": "{{ config(severity='ERROR') }}{{ test_unique(**_dbt_schema_test_kwargs) }}", "test_metadata": {"namespace": null, "name": "unique", "kwargs": {"column_name": "team_id", "model": "{{ ref('stg_asana__team') }}"}}, "compiled": true, "database": "dbt-package-testing", "schema": "asana_source_integration_tests_stg_asana", "fqn": ["asana_source", "schema_test", "unique_stg_asana__team_team_id"], "unique_id": "test.asana_source.unique_stg_asana__team_team_id", "package_name": "asana_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Asana/dbt_asana/integration_tests/dbt_modules/asana_source", "path": "schema_test/unique_stg_asana__team_team_id.sql", "original_file_path": "models/stg_asana.yml", "name": "unique_stg_asana__team_team_id", "resource_type": "test", "alias": "unique_stg_asana__team_team_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "materialized": "table", "persist_docs": {}, "post-hook": [], "pre-hook": [], "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "stg_asana", "database": null, "tags": [], "full_refresh": null, "severity": "ERROR"}, "tags": ["schema"], "refs": [["stg_asana__team"]], "sources": [], "depends_on": {"macros": ["macro.dbt.test_unique"], "nodes": ["model.asana_source.stg_asana__team"]}, "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "build_path": "target/compiled/asana_source/models/stg_asana.yml/schema_test/unique_stg_asana__team_team_id.sql", "deferred": false, "unrendered_config": {"schema": "stg_asana", "materialized": "table", "severity": "ERROR"}, "compiled_sql": "\n \n \n\n\n\nselect count(*) as validation_errors\nfrom (\n\n select\n team_id\n\n from `dbt-package-testing`.`asana_source_integration_tests_stg_asana`.`stg_asana__team`\n where team_id is not null\n group by team_id\n having count(*) > 1\n\n) validation_errors\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "team_id"}, "test.asana_source.not_null_stg_asana__team_team_id": {"raw_sql": "{{ config(severity='ERROR') }}{{ test_not_null(**_dbt_schema_test_kwargs) }}", "test_metadata": {"namespace": null, "name": "not_null", "kwargs": {"column_name": "team_id", "model": "{{ ref('stg_asana__team') }}"}}, "compiled": true, "database": "dbt-package-testing", "schema": "asana_source_integration_tests_stg_asana", "fqn": ["asana_source", "schema_test", "not_null_stg_asana__team_team_id"], "unique_id": "test.asana_source.not_null_stg_asana__team_team_id", "package_name": "asana_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Asana/dbt_asana/integration_tests/dbt_modules/asana_source", "path": "schema_test/not_null_stg_asana__team_team_id.sql", "original_file_path": "models/stg_asana.yml", "name": "not_null_stg_asana__team_team_id", "resource_type": "test", "alias": "not_null_stg_asana__team_team_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "materialized": "table", "persist_docs": {}, "post-hook": [], "pre-hook": [], "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "stg_asana", "database": null, "tags": [], "full_refresh": null, "severity": "ERROR"}, "tags": ["schema"], "refs": [["stg_asana__team"]], "sources": [], "depends_on": {"macros": ["macro.dbt.test_not_null"], "nodes": ["model.asana_source.stg_asana__team"]}, "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "build_path": "target/compiled/asana_source/models/stg_asana.yml/schema_test/not_null_stg_asana__team_team_id.sql", "deferred": false, "unrendered_config": {"schema": "stg_asana", "materialized": "table", "severity": "ERROR"}, "compiled_sql": "\n \n \n\n\n\nselect count(*) as validation_errors\nfrom `dbt-package-testing`.`asana_source_integration_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"}, "test.asana_source.unique_stg_asana__user_user_id": {"raw_sql": "{{ config(severity='ERROR') }}{{ test_unique(**_dbt_schema_test_kwargs) }}", "test_metadata": {"namespace": null, "name": "unique", "kwargs": {"column_name": "user_id", "model": "{{ ref('stg_asana__user') }}"}}, "compiled": true, "database": "dbt-package-testing", "schema": "asana_source_integration_tests_stg_asana", "fqn": ["asana_source", "schema_test", "unique_stg_asana__user_user_id"], "unique_id": "test.asana_source.unique_stg_asana__user_user_id", "package_name": "asana_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Asana/dbt_asana/integration_tests/dbt_modules/asana_source", "path": "schema_test/unique_stg_asana__user_user_id.sql", "original_file_path": "models/stg_asana.yml", "name": "unique_stg_asana__user_user_id", "resource_type": "test", "alias": "unique_stg_asana__user_user_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "materialized": "table", "persist_docs": {}, "post-hook": [], "pre-hook": [], "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "stg_asana", "database": null, "tags": [], "full_refresh": null, "severity": "ERROR"}, "tags": ["schema"], "refs": [["stg_asana__user"]], "sources": [], "depends_on": {"macros": ["macro.dbt.test_unique"], "nodes": ["model.asana_source.stg_asana__user"]}, "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "build_path": "target/compiled/asana_source/models/stg_asana.yml/schema_test/unique_stg_asana__user_user_id.sql", "deferred": false, "unrendered_config": {"schema": "stg_asana", "materialized": "table", "severity": "ERROR"}, "compiled_sql": "\n \n \n\n\n\nselect count(*) as validation_errors\nfrom (\n\n select\n user_id\n\n from `dbt-package-testing`.`asana_source_integration_tests_stg_asana`.`stg_asana__user`\n where user_id is not null\n group by user_id\n having count(*) > 1\n\n) validation_errors\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "user_id"}, "test.asana_source.not_null_stg_asana__user_user_id": {"raw_sql": "{{ config(severity='ERROR') }}{{ test_not_null(**_dbt_schema_test_kwargs) }}", "test_metadata": {"namespace": null, "name": "not_null", "kwargs": {"column_name": "user_id", "model": "{{ ref('stg_asana__user') }}"}}, "compiled": true, "database": "dbt-package-testing", "schema": "asana_source_integration_tests_stg_asana", "fqn": ["asana_source", "schema_test", "not_null_stg_asana__user_user_id"], "unique_id": "test.asana_source.not_null_stg_asana__user_user_id", "package_name": "asana_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Asana/dbt_asana/integration_tests/dbt_modules/asana_source", "path": "schema_test/not_null_stg_asana__user_user_id.sql", "original_file_path": "models/stg_asana.yml", "name": "not_null_stg_asana__user_user_id", "resource_type": "test", "alias": "not_null_stg_asana__user_user_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "materialized": "table", "persist_docs": {}, "post-hook": [], "pre-hook": [], "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "stg_asana", "database": null, "tags": [], "full_refresh": null, "severity": "ERROR"}, "tags": ["schema"], "refs": [["stg_asana__user"]], "sources": [], "depends_on": {"macros": ["macro.dbt.test_not_null"], "nodes": ["model.asana_source.stg_asana__user"]}, "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "build_path": "target/compiled/asana_source/models/stg_asana.yml/schema_test/not_null_stg_asana__user_user_id.sql", "deferred": false, "unrendered_config": {"schema": "stg_asana", "materialized": "table", "severity": "ERROR"}, "compiled_sql": "\n \n \n\n\n\nselect count(*) as validation_errors\nfrom `dbt-package-testing`.`asana_source_integration_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"}, "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 min( created_at ) as min_date 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 = \"'\" ~ first_date[0:10] ~ \"'\", \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, "database": "dbt-package-testing", "schema": "asana_source_integration_tests_asana", "fqn": ["asana", "asana__daily_metrics"], "unique_id": "model.asana.asana__daily_metrics", "package_name": "asana", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Asana/dbt_asana/integration_tests/dbt_modules/asana", "path": "asana__daily_metrics.sql", "original_file_path": "models/asana__daily_metrics.sql", "name": "asana__daily_metrics", "resource_type": "model", "alias": "asana__daily_metrics", "checksum": {"name": "sha256", "checksum": "a3fc15ccdabb511f6a813f7d68c3bdab353166ff687b38f191b2164c9d569340"}, "config": {"enabled": true, "materialized": "table", "persist_docs": {}, "post-hook": [], "pre-hook": [], "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "asana", "database": null, "tags": [], "full_refresh": null}, "tags": [], "refs": [["asana__task"]], "sources": [], "depends_on": {"macros": ["macro.dbt_utils.dateadd", "macro.dbt_utils.date_spine", "macro.dbt_utils.datediff", "macro.dbt_utils.date_trunc", "macro.dbt.run_query"], "nodes": ["model.asana.asana__task"]}, "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": "models/asana.yml", "build_path": "target/compiled/asana/models/asana__daily_metrics.sql", "deferred": false, "unrendered_config": {"schema": "asana", "materialized": "table"}, "compiled_sql": "with task as (\n\n select *\n from `dbt-package-testing`.`asana_source_integration_tests_asana`.`asana__task`\n),\n\n\nspine as (\n\n \n \n \n \n \n\n\n \n\n/*\ncall 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*/\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 * pow(2, 0)\n + \n \n p1.generated_number * pow(2, 1)\n + \n \n p2.generated_number * pow(2, 2)\n + \n \n p3.generated_number * pow(2, 3)\n + \n \n p4.generated_number * pow(2, 4)\n + \n \n p5.generated_number * pow(2, 5)\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 \n \n\n )\n\n select *\n from unioned\n where generated_number <= 53\n order by generated_number\n\n\n\n),\n\nall_periods as (\n\n select (\n \n\n datetime_add(\n cast( '2021-02-04' 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( \n\n datetime_diff(\n cast(spine.date_day as datetime),\n cast(task.created_at as datetime),\n day\n )\n\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) >= \n timestamp_trunc(\n cast(task.first_assigned_at as timestamp),\n day\n )\n\n then 1 else 0 end) as number_of_tasks_open_assigned,\n sum( \n\n datetime_diff(\n cast(spine.date_day as datetime),\n cast(task.first_assigned_at as datetime),\n day\n )\n\n ) as total_days_open_assigned,\n sum( case when cast(spine.date_day as timestamp) = \n timestamp_trunc(\n cast(task.created_at as timestamp),\n day\n )\n\n then 1 else 0 end) as number_of_tasks_created,\n sum( case when cast(spine.date_day as timestamp) = \n timestamp_trunc(\n cast(task.completed_at as timestamp),\n day\n )\n\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) >= \n timestamp_trunc(\n cast(task.created_at as timestamp),\n day\n )\n\n\n and case when task.is_completed then \n cast(spine.date_day as timestamp) < \n timestamp_trunc(\n cast(task.completed_at as timestamp),\n day\n )\n\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_tests_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, "database": "dbt-package-testing", "schema": "asana_source_integration_tests_asana", "fqn": ["asana", "asana__user"], "unique_id": "model.asana.asana__user", "package_name": "asana", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Asana/dbt_asana/integration_tests/dbt_modules/asana", "path": "asana__user.sql", "original_file_path": "models/asana__user.sql", "name": "asana__user", "resource_type": "model", "alias": "asana__user", "checksum": {"name": "sha256", "checksum": "88ccd963cf4ee613643a10749d93ce8c912a38c2672f70c54bd88397607c7a47"}, "config": {"enabled": true, "materialized": "table", "persist_docs": {}, "post-hook": [], "pre-hook": [], "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "asana", "database": null, "tags": [], "full_refresh": null}, "tags": [], "refs": [["int_asana__user_task_metrics"], ["stg_asana__user"], ["int_asana__project_user"]], "sources": [], "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"]}, "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": "models/asana.yml", "build_path": "target/compiled/asana/models/asana__user.sql", "deferred": false, "unrendered_config": {"schema": "asana", "materialized": "table"}, "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_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 `dbt-package-testing`.`asana_source_integration_tests_stg_asana`.`stg_asana__task`\n\n),\n\nasana_user as (\n\n select *\n from `dbt-package-testing`.`asana_source_integration_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 `dbt-package-testing`.`asana_source_integration_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 `dbt-package-testing`.`asana_source_integration_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 `dbt-package-testing`.`asana_source_integration_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 `dbt-package-testing`.`asana_source_integration_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 `dbt-package-testing`.`asana_source_integration_tests_stg_asana`.`stg_asana__task`\n\n),\n\nasana_user as (\n\n select *\n from `dbt-package-testing`.`asana_source_integration_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 `dbt-package-testing`.`asana_source_integration_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 `dbt-package-testing`.`asana_source_integration_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": "`dbt-package-testing`.`asana_source_integration_tests_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, "database": "dbt-package-testing", "schema": "asana_source_integration_tests_asana", "fqn": ["asana", "asana__task"], "unique_id": "model.asana.asana__task", "package_name": "asana", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Asana/dbt_asana/integration_tests/dbt_modules/asana", "path": "asana__task.sql", "original_file_path": "models/asana__task.sql", "name": "asana__task", "resource_type": "model", "alias": "asana__task", "checksum": {"name": "sha256", "checksum": "9595b73e29bce0539fc8b3c27eeffdb1ffcba0a3f4f1946b9d36d2a495f59e79"}, "config": {"enabled": true, "materialized": "table", "persist_docs": {}, "post-hook": [], "pre-hook": [], "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "asana", "database": null, "tags": [], "full_refresh": null}, "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": [], "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"]}, "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": []}, "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. 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": []}}, "meta": {}, "docs": {"show": true}, "patch_path": "models/asana.yml", "build_path": "target/compiled/asana/models/asana__task.sql", "deferred": false, "unrendered_config": {"schema": "asana", "materialized": "table"}, "compiled_sql": "with __dbt__CTE__int_asana__task_story as (\nwith story as (\n \n select * \n from `dbt-package-testing`.`asana_source_integration_tests_stg_asana`.`stg_asana__story`\n\n),\n\nasana_user as (\n\n select * \n from `dbt-package-testing`.`asana_source_integration_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 `dbt-package-testing`.`asana_source_integration_tests_stg_asana`.`stg_asana__task_follower`\n\n),\n\nasana_user as (\n\n select * \n from `dbt-package-testing`.`asana_source_integration_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 `dbt-package-testing`.`asana_source_integration_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 datetime_diff(\n cast(\n current_timestamp\n as datetime),\n cast(task.created_at as datetime),\n day\n )\n\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 datetime_diff(\n cast(\n current_timestamp\n as datetime),\n cast(assignments.last_assigned_at as datetime),\n day\n )\n\n as days_since_last_assignment,\n\n \n\n datetime_diff(\n cast(\n current_timestamp\n as datetime),\n cast(assignments.first_assigned_at as datetime),\n day\n )\n\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_tests_stg_asana`.`stg_asana__task_tag`\n\n),\n\nasana_tag as (\n\n select * \n from `dbt-package-testing`.`asana_source_integration_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 `dbt-package-testing`.`asana_source_integration_tests_stg_asana`.`stg_asana__task`\n\n),\n\nasana_user as (\n\n select *\n from `dbt-package-testing`.`asana_source_integration_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 `dbt-package-testing`.`asana_source_integration_tests_stg_asana`.`stg_asana__project_task`\n\n),\n\nproject as (\n \n select * \n from `dbt-package-testing`.`asana_source_integration_tests_stg_asana`.`stg_asana__project`\n),\n\ntask_section as (\n\n select * \n from `dbt-package-testing`.`asana_source_integration_tests_stg_asana`.`stg_asana__task_section`\n\n),\n\nsection as (\n \n select * \n from `dbt-package-testing`.`asana_source_integration_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 `dbt-package-testing`.`asana_source_integration_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 `dbt-package-testing`.`asana_source_integration_tests_stg_asana`.`stg_asana__story`\n\n),\n\nasana_user as (\n\n select * \n from `dbt-package-testing`.`asana_source_integration_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 `dbt-package-testing`.`asana_source_integration_tests_stg_asana`.`stg_asana__task_follower`\n\n),\n\nasana_user as (\n\n select * \n from `dbt-package-testing`.`asana_source_integration_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 `dbt-package-testing`.`asana_source_integration_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 datetime_diff(\n cast(\n current_timestamp\n as datetime),\n cast(task.created_at as datetime),\n day\n )\n\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 datetime_diff(\n cast(\n current_timestamp\n as datetime),\n cast(assignments.last_assigned_at as datetime),\n day\n )\n\n as days_since_last_assignment,\n\n \n\n datetime_diff(\n cast(\n current_timestamp\n as datetime),\n cast(assignments.first_assigned_at as datetime),\n day\n )\n\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_tests_stg_asana`.`stg_asana__task_tag`\n\n),\n\nasana_tag as (\n\n select * \n from `dbt-package-testing`.`asana_source_integration_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 `dbt-package-testing`.`asana_source_integration_tests_stg_asana`.`stg_asana__task`\n\n),\n\nasana_user as (\n\n select *\n from `dbt-package-testing`.`asana_source_integration_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 `dbt-package-testing`.`asana_source_integration_tests_stg_asana`.`stg_asana__project_task`\n\n),\n\nproject as (\n \n select * \n from `dbt-package-testing`.`asana_source_integration_tests_stg_asana`.`stg_asana__project`\n),\n\ntask_section as (\n\n select * \n from `dbt-package-testing`.`asana_source_integration_tests_stg_asana`.`stg_asana__task_section`\n\n),\n\nsection as (\n \n select * \n from `dbt-package-testing`.`asana_source_integration_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": "`dbt-package-testing`.`asana_source_integration_tests_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, "database": "dbt-package-testing", "schema": "asana_source_integration_tests_asana", "fqn": ["asana", "asana__team"], "unique_id": "model.asana.asana__team", "package_name": "asana", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Asana/dbt_asana/integration_tests/dbt_modules/asana", "path": "asana__team.sql", "original_file_path": "models/asana__team.sql", "name": "asana__team", "resource_type": "model", "alias": "asana__team", "checksum": {"name": "sha256", "checksum": "848787a32e0c75060c960f1d73bd6c6652da47bfeafb7e6e74949ec183a5da63"}, "config": {"enabled": true, "materialized": "table", "persist_docs": {}, "post-hook": [], "pre-hook": [], "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "asana", "database": null, "tags": [], "full_refresh": null}, "tags": [], "refs": [["stg_asana__team"], ["asana__project"]], "sources": [], "depends_on": {"macros": ["macro.fivetran_utils.string_agg"], "nodes": ["model.asana_source.stg_asana__team", "model.asana.asana__project"]}, "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": "models/asana.yml", "build_path": "target/compiled/asana/models/asana__team.sql", "deferred": false, "unrendered_config": {"schema": "asana", "materialized": "table"}, "compiled_sql": "with team as (\n\n select * from `dbt-package-testing`.`asana_source_integration_tests_stg_asana`.`stg_asana__team`\n),\n\nproject as (\n\n select * \n from `dbt-package-testing`.`asana_source_integration_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": "`dbt-package-testing`.`asana_source_integration_tests_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, "database": "dbt-package-testing", "schema": "asana_source_integration_tests_asana", "fqn": ["asana", "asana__project"], "unique_id": "model.asana.asana__project", "package_name": "asana", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Asana/dbt_asana/integration_tests/dbt_modules/asana", "path": "asana__project.sql", "original_file_path": "models/asana__project.sql", "name": "asana__project", "resource_type": "model", "alias": "asana__project", "checksum": {"name": "sha256", "checksum": "91f218d2cb1e3f59adce898263d14060794892986bce92fda2825d39ed99e170"}, "config": {"enabled": true, "materialized": "table", "persist_docs": {}, "post-hook": [], "pre-hook": [], "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "asana", "database": null, "tags": [], "full_refresh": null}, "tags": [], "refs": [["int_asana__project_task_metrics"], ["stg_asana__project"], ["int_asana__project_user"], ["stg_asana__user"], ["stg_asana__team"], ["stg_asana__section"]], "sources": [], "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"]}, "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": "models/asana.yml", "build_path": "target/compiled/asana/models/asana__project.sql", "deferred": false, "unrendered_config": {"schema": "asana", "materialized": "table"}, "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_tests_asana`.`asana__task`\n\n),\n\nproject as (\n\n select * \n from `dbt-package-testing`.`asana_source_integration_tests_stg_asana`.`stg_asana__project`\n\n),\n\nproject_task as (\n\n select * \n from `dbt-package-testing`.`asana_source_integration_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 `dbt-package-testing`.`asana_source_integration_tests_stg_asana`.`stg_asana__task`\n\n),\n\nasana_user as (\n\n select *\n from `dbt-package-testing`.`asana_source_integration_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 `dbt-package-testing`.`asana_source_integration_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 `dbt-package-testing`.`asana_source_integration_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 `dbt-package-testing`.`asana_source_integration_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 `dbt-package-testing`.`asana_source_integration_tests_stg_asana`.`stg_asana__user`\n),\n\nteam as (\n select *\n from `dbt-package-testing`.`asana_source_integration_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 `dbt-package-testing`.`asana_source_integration_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 `dbt-package-testing`.`asana_source_integration_tests_asana`.`asana__task`\n\n),\n\nproject as (\n\n select * \n from `dbt-package-testing`.`asana_source_integration_tests_stg_asana`.`stg_asana__project`\n\n),\n\nproject_task as (\n\n select * \n from `dbt-package-testing`.`asana_source_integration_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 `dbt-package-testing`.`asana_source_integration_tests_stg_asana`.`stg_asana__task`\n\n),\n\nasana_user as (\n\n select *\n from `dbt-package-testing`.`asana_source_integration_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 `dbt-package-testing`.`asana_source_integration_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 `dbt-package-testing`.`asana_source_integration_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": "`dbt-package-testing`.`asana_source_integration_tests_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, "database": "dbt-package-testing", "schema": "asana_source_integration_tests_asana", "fqn": ["asana", "asana__tag"], "unique_id": "model.asana.asana__tag", "package_name": "asana", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Asana/dbt_asana/integration_tests/dbt_modules/asana", "path": "asana__tag.sql", "original_file_path": "models/asana__tag.sql", "name": "asana__tag", "resource_type": "model", "alias": "asana__tag", "checksum": {"name": "sha256", "checksum": "e8783d268c5d3f46a7e11e597a0090254f15aa92b89122dcf6ee2481e77eb433"}, "config": {"enabled": true, "materialized": "table", "persist_docs": {}, "post-hook": [], "pre-hook": [], "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "asana", "database": null, "tags": [], "full_refresh": null}, "tags": [], "refs": [["stg_asana__tag"], ["stg_asana__task_tag"], ["asana__task"]], "sources": [], "depends_on": {"macros": [], "nodes": ["model.asana_source.stg_asana__tag", "model.asana_source.stg_asana__task_tag", "model.asana.asana__task"]}, "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": "models/asana.yml", "build_path": "target/compiled/asana/models/asana__tag.sql", "deferred": false, "unrendered_config": {"schema": "asana", "materialized": "table"}, "compiled_sql": "with asana_tag as (\n\n select * \n from `dbt-package-testing`.`asana_source_integration_tests_stg_asana`.`stg_asana__tag`\n),\n\ntask_tag as (\n\n select * \n from `dbt-package-testing`.`asana_source_integration_tests_stg_asana`.`stg_asana__task_tag`\n),\n\ntask as (\n\n select *\n from `dbt-package-testing`.`asana_source_integration_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": "`dbt-package-testing`.`asana_source_integration_tests_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, "database": "dbt-package-testing", "schema": "asana_source_integration_tests_asana", "fqn": ["asana", "intermediate", "int_asana__task_comments"], "unique_id": "model.asana.int_asana__task_comments", "package_name": "asana", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Asana/dbt_asana/integration_tests/dbt_modules/asana", "path": "intermediate/int_asana__task_comments.sql", "original_file_path": "models/intermediate/int_asana__task_comments.sql", "name": "int_asana__task_comments", "resource_type": "model", "alias": "int_asana__task_comments", "checksum": {"name": "sha256", "checksum": "b50c377464e548b3cd44e3535fd4fa56541851bfa7029f6081f1b3f6b62b380d"}, "config": {"enabled": true, "materialized": "ephemeral", "persist_docs": {}, "post-hook": [], "pre-hook": [], "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "asana", "database": null, "tags": [], "full_refresh": null}, "tags": [], "refs": [["int_asana__task_story"]], "sources": [], "depends_on": {"macros": ["macro.fivetran_utils.string_agg"], "nodes": ["model.asana.int_asana__task_story"]}, "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": "models/intermediate/intermediate_asana.yml", "build_path": "target/compiled/asana/models/intermediate/int_asana__task_comments.sql", "deferred": false, "unrendered_config": {"schema": "asana", "materialized": "ephemeral"}, "compiled_sql": "with 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_tests_stg_asana`.`stg_asana__story`\n\n),\n\nasana_user as (\n\n select * \n from `dbt-package-testing`.`asana_source_integration_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": {"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, "database": "dbt-package-testing", "schema": "asana_source_integration_tests_asana", "fqn": ["asana", "intermediate", "int_asana__project_task_metrics"], "unique_id": "model.asana.int_asana__project_task_metrics", "package_name": "asana", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Asana/dbt_asana/integration_tests/dbt_modules/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", "resource_type": "model", "alias": "int_asana__project_task_metrics", "checksum": {"name": "sha256", "checksum": "59d3c639d66f84f786b75ff772ccc57cff3037a5d43fd3699a05da0459b2da7a"}, "config": {"enabled": true, "materialized": "ephemeral", "persist_docs": {}, "post-hook": [], "pre-hook": [], "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "asana", "database": null, "tags": [], "full_refresh": null}, "tags": [], "refs": [["asana__task"], ["stg_asana__project"], ["stg_asana__project_task"]], "sources": [], "depends_on": {"macros": [], "nodes": ["model.asana.asana__task", "model.asana_source.stg_asana__project", "model.asana_source.stg_asana__project_task"]}, "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": "models/intermediate/intermediate_asana.yml", "build_path": "target/compiled/asana/models/intermediate/int_asana__project_task_metrics.sql", "deferred": false, "unrendered_config": {"schema": "asana", "materialized": "ephemeral"}, "compiled_sql": "with task as (\n\n select *\n from `dbt-package-testing`.`asana_source_integration_tests_asana`.`asana__task`\n\n),\n\nproject as (\n\n select * \n from `dbt-package-testing`.`asana_source_integration_tests_stg_asana`.`stg_asana__project`\n\n),\n\nproject_task as (\n\n select * \n from `dbt-package-testing`.`asana_source_integration_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": {"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, "database": "dbt-package-testing", "schema": "asana_source_integration_tests_asana", "fqn": ["asana", "intermediate", "int_asana__user_task_metrics"], "unique_id": "model.asana.int_asana__user_task_metrics", "package_name": "asana", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Asana/dbt_asana/integration_tests/dbt_modules/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", "resource_type": "model", "alias": "int_asana__user_task_metrics", "checksum": {"name": "sha256", "checksum": "22283e2744be59600dfcd8f89912736207b817d43c8ed00b1a49a7e4926237bd"}, "config": {"enabled": true, "materialized": "ephemeral", "persist_docs": {}, "post-hook": [], "pre-hook": [], "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "asana", "database": null, "tags": [], "full_refresh": null}, "tags": [], "refs": [["asana__task"]], "sources": [], "depends_on": {"macros": [], "nodes": ["model.asana.asana__task"]}, "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": "models/intermediate/intermediate_asana.yml", "build_path": "target/compiled/asana/models/intermediate/int_asana__user_task_metrics.sql", "deferred": false, "unrendered_config": {"schema": "asana", "materialized": "ephemeral"}, "compiled_sql": "with tasks as (\n\n select * \n from `dbt-package-testing`.`asana_source_integration_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": {"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, "database": "dbt-package-testing", "schema": "asana_source_integration_tests_asana", "fqn": ["asana", "intermediate", "int_asana__task_tags"], "unique_id": "model.asana.int_asana__task_tags", "package_name": "asana", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Asana/dbt_asana/integration_tests/dbt_modules/asana", "path": "intermediate/int_asana__task_tags.sql", "original_file_path": "models/intermediate/int_asana__task_tags.sql", "name": "int_asana__task_tags", "resource_type": "model", "alias": "int_asana__task_tags", "checksum": {"name": "sha256", "checksum": "8016dbd490f23f719d4a3dd688ab6c5c2897b86746e3ea63c0b739cfbdda6848"}, "config": {"enabled": true, "materialized": "ephemeral", "persist_docs": {}, "post-hook": [], "pre-hook": [], "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "asana", "database": null, "tags": [], "full_refresh": null}, "tags": [], "refs": [["stg_asana__task_tag"], ["stg_asana__tag"]], "sources": [], "depends_on": {"macros": ["macro.fivetran_utils.string_agg"], "nodes": ["model.asana_source.stg_asana__task_tag", "model.asana_source.stg_asana__tag"]}, "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": "models/intermediate/intermediate_asana.yml", "build_path": "target/compiled/asana/models/intermediate/int_asana__task_tags.sql", "deferred": false, "unrendered_config": {"schema": "asana", "materialized": "ephemeral"}, "compiled_sql": "with task_tag as (\n \n select *\n from `dbt-package-testing`.`asana_source_integration_tests_stg_asana`.`stg_asana__task_tag`\n\n),\n\nasana_tag as (\n\n select * \n from `dbt-package-testing`.`asana_source_integration_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": {"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, "database": "dbt-package-testing", "schema": "asana_source_integration_tests_asana", "fqn": ["asana", "intermediate", "int_asana__task_open_length"], "unique_id": "model.asana.int_asana__task_open_length", "package_name": "asana", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Asana/dbt_asana/integration_tests/dbt_modules/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", "resource_type": "model", "alias": "int_asana__task_open_length", "checksum": {"name": "sha256", "checksum": "c4b9e95d02887eb78b1e57f611e87a7c1b9a5e30ff6f9018647a2b0ebc592f0e"}, "config": {"enabled": true, "materialized": "ephemeral", "persist_docs": {}, "post-hook": [], "pre-hook": [], "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "asana", "database": null, "tags": [], "full_refresh": null}, "tags": [], "refs": [["stg_asana__task"], ["int_asana__task_story"]], "sources": [], "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"]}, "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": "models/intermediate/intermediate_asana.yml", "build_path": "target/compiled/asana/models/intermediate/int_asana__task_open_length.sql", "deferred": false, "unrendered_config": {"schema": "asana", "materialized": "ephemeral"}, "compiled_sql": "with task as (\n \n select *\n from `dbt-package-testing`.`asana_source_integration_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 datetime_diff(\n cast(\n current_timestamp\n as datetime),\n cast(task.created_at as datetime),\n day\n )\n\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 datetime_diff(\n cast(\n current_timestamp\n as datetime),\n cast(assignments.last_assigned_at as datetime),\n day\n )\n\n as days_since_last_assignment,\n\n \n\n datetime_diff(\n cast(\n current_timestamp\n as datetime),\n cast(assignments.first_assigned_at as datetime),\n day\n )\n\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_tests_stg_asana`.`stg_asana__story`\n\n),\n\nasana_user as (\n\n select * \n from `dbt-package-testing`.`asana_source_integration_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": {"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, "database": "dbt-package-testing", "schema": "asana_source_integration_tests_asana", "fqn": ["asana", "intermediate", "int_asana__task_followers"], "unique_id": "model.asana.int_asana__task_followers", "package_name": "asana", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Asana/dbt_asana/integration_tests/dbt_modules/asana", "path": "intermediate/int_asana__task_followers.sql", "original_file_path": "models/intermediate/int_asana__task_followers.sql", "name": "int_asana__task_followers", "resource_type": "model", "alias": "int_asana__task_followers", "checksum": {"name": "sha256", "checksum": "fafdd691a271f08b345565db3962fd360163ec2213098c8fda86265d2680710c"}, "config": {"enabled": true, "materialized": "ephemeral", "persist_docs": {}, "post-hook": [], "pre-hook": [], "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "asana", "database": null, "tags": [], "full_refresh": null}, "tags": [], "refs": [["stg_asana__task_follower"], ["stg_asana__user"]], "sources": [], "depends_on": {"macros": ["macro.fivetran_utils.string_agg"], "nodes": ["model.asana_source.stg_asana__task_follower", "model.asana_source.stg_asana__user"]}, "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": "models/intermediate/intermediate_asana.yml", "build_path": "target/compiled/asana/models/intermediate/int_asana__task_followers.sql", "deferred": false, "unrendered_config": {"schema": "asana", "materialized": "ephemeral"}, "compiled_sql": "with task_follower as (\n \n select *\n from `dbt-package-testing`.`asana_source_integration_tests_stg_asana`.`stg_asana__task_follower`\n\n),\n\nasana_user as (\n\n select * \n from `dbt-package-testing`.`asana_source_integration_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": {"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, "database": "dbt-package-testing", "schema": "asana_source_integration_tests_asana", "fqn": ["asana", "intermediate", "int_asana__project_user"], "unique_id": "model.asana.int_asana__project_user", "package_name": "asana", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Asana/dbt_asana/integration_tests/dbt_modules/asana", "path": "intermediate/int_asana__project_user.sql", "original_file_path": "models/intermediate/int_asana__project_user.sql", "name": "int_asana__project_user", "resource_type": "model", "alias": "int_asana__project_user", "checksum": {"name": "sha256", "checksum": "28422acac2869e218af531cdd062ef4dcdde594a75a39e7ba4cc56119117e636"}, "config": {"enabled": true, "materialized": "ephemeral", "persist_docs": {}, "post-hook": [], "pre-hook": [], "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "asana", "database": null, "tags": [], "full_refresh": null}, "tags": [], "refs": [["stg_asana__project_task"], ["int_asana__task_assignee"], ["stg_asana__project"]], "sources": [], "depends_on": {"macros": [], "nodes": ["model.asana_source.stg_asana__project_task", "model.asana.int_asana__task_assignee", "model.asana_source.stg_asana__project"]}, "description": "Table of who is *working* on the project -- its owner + users assigned to it tasks", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": "models/intermediate/intermediate_asana.yml", "build_path": "target/compiled/asana/models/intermediate/int_asana__project_user.sql", "deferred": false, "unrendered_config": {"schema": "asana", "materialized": "ephemeral"}, "compiled_sql": "with project_tasks as (\n \n select *\n from `dbt-package-testing`.`asana_source_integration_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 `dbt-package-testing`.`asana_source_integration_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 `dbt-package-testing`.`asana_source_integration_tests_stg_asana`.`stg_asana__task`\n\n),\n\nasana_user as (\n\n select *\n from `dbt-package-testing`.`asana_source_integration_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": {"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, "database": "dbt-package-testing", "schema": "asana_source_integration_tests_asana", "fqn": ["asana", "intermediate", "int_asana__task_first_modifier"], "unique_id": "model.asana.int_asana__task_first_modifier", "package_name": "asana", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Asana/dbt_asana/integration_tests/dbt_modules/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", "resource_type": "model", "alias": "int_asana__task_first_modifier", "checksum": {"name": "sha256", "checksum": "1f6f8640a32bd71cb45062dfd5cffc7c6c5232051c33580299b613717f7ba2f6"}, "config": {"enabled": true, "materialized": "ephemeral", "persist_docs": {}, "post-hook": [], "pre-hook": [], "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "asana", "database": null, "tags": [], "full_refresh": null}, "tags": [], "refs": [["int_asana__task_story"]], "sources": [], "depends_on": {"macros": [], "nodes": ["model.asana.int_asana__task_story"]}, "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": "models/intermediate/intermediate_asana.yml", "build_path": "target/compiled/asana/models/intermediate/int_asana__task_first_modifier.sql", "deferred": false, "unrendered_config": {"schema": "asana", "materialized": "ephemeral"}, "compiled_sql": "with 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_tests_stg_asana`.`stg_asana__story`\n\n),\n\nasana_user as (\n\n select * \n from `dbt-package-testing`.`asana_source_integration_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": {"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, "database": "dbt-package-testing", "schema": "asana_source_integration_tests_asana", "fqn": ["asana", "intermediate", "int_asana__task_projects"], "unique_id": "model.asana.int_asana__task_projects", "package_name": "asana", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Asana/dbt_asana/integration_tests/dbt_modules/asana", "path": "intermediate/int_asana__task_projects.sql", "original_file_path": "models/intermediate/int_asana__task_projects.sql", "name": "int_asana__task_projects", "resource_type": "model", "alias": "int_asana__task_projects", "checksum": {"name": "sha256", "checksum": "fc36b507b9dba1840ad1d41d014cc5451ecb0c11c4e2043478f3ccf47d184aa2"}, "config": {"enabled": true, "materialized": "ephemeral", "persist_docs": {}, "post-hook": [], "pre-hook": [], "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "asana", "database": null, "tags": [], "full_refresh": null}, "tags": [], "refs": [["stg_asana__project_task"], ["stg_asana__project"], ["stg_asana__task_section"], ["stg_asana__section"]], "sources": [], "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"]}, "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": "models/intermediate/intermediate_asana.yml", "build_path": "target/compiled/asana/models/intermediate/int_asana__task_projects.sql", "deferred": false, "unrendered_config": {"schema": "asana", "materialized": "ephemeral"}, "compiled_sql": "with task_project as (\n\n select * \n from `dbt-package-testing`.`asana_source_integration_tests_stg_asana`.`stg_asana__project_task`\n\n),\n\nproject as (\n \n select * \n from `dbt-package-testing`.`asana_source_integration_tests_stg_asana`.`stg_asana__project`\n),\n\ntask_section as (\n\n select * \n from `dbt-package-testing`.`asana_source_integration_tests_stg_asana`.`stg_asana__task_section`\n\n),\n\nsection as (\n \n select * \n from `dbt-package-testing`.`asana_source_integration_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": {"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, "database": "dbt-package-testing", "schema": "asana_source_integration_tests_asana", "fqn": ["asana", "intermediate", "int_asana__task_assignee"], "unique_id": "model.asana.int_asana__task_assignee", "package_name": "asana", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Asana/dbt_asana/integration_tests/dbt_modules/asana", "path": "intermediate/int_asana__task_assignee.sql", "original_file_path": "models/intermediate/int_asana__task_assignee.sql", "name": "int_asana__task_assignee", "resource_type": "model", "alias": "int_asana__task_assignee", "checksum": {"name": "sha256", "checksum": "2dfff153566b1418a423d4275b9704e5d8b8c3a661be9e9babfc15aa4c5cead8"}, "config": {"enabled": true, "materialized": "ephemeral", "persist_docs": {}, "post-hook": [], "pre-hook": [], "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "asana", "database": null, "tags": [], "full_refresh": null}, "tags": [], "refs": [["stg_asana__task"], ["stg_asana__user"]], "sources": [], "depends_on": {"macros": [], "nodes": ["model.asana_source.stg_asana__task", "model.asana_source.stg_asana__user"]}, "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": "models/intermediate/intermediate_asana.yml", "build_path": "target/compiled/asana/models/intermediate/int_asana__task_assignee.sql", "deferred": false, "unrendered_config": {"schema": "asana", "materialized": "ephemeral"}, "compiled_sql": "with task as (\n\n select * \n from `dbt-package-testing`.`asana_source_integration_tests_stg_asana`.`stg_asana__task`\n\n),\n\nasana_user as (\n\n select *\n from `dbt-package-testing`.`asana_source_integration_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": {"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, "database": "dbt-package-testing", "schema": "asana_source_integration_tests_asana", "fqn": ["asana", "intermediate", "int_asana__subtask_parent"], "unique_id": "model.asana.int_asana__subtask_parent", "package_name": "asana", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Asana/dbt_asana/integration_tests/dbt_modules/asana", "path": "intermediate/int_asana__subtask_parent.sql", "original_file_path": "models/intermediate/int_asana__subtask_parent.sql", "name": "int_asana__subtask_parent", "resource_type": "model", "alias": "int_asana__subtask_parent", "checksum": {"name": "sha256", "checksum": "4abb15c88cfe83c53f5d4d97013d37d41689f4940b334b296b076eff5528b7b7"}, "config": {"enabled": true, "materialized": "ephemeral", "persist_docs": {}, "post-hook": [], "pre-hook": [], "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "asana", "database": null, "tags": [], "full_refresh": null}, "tags": [], "refs": [["int_asana__task_assignee"]], "sources": [], "depends_on": {"macros": [], "nodes": ["model.asana.int_asana__task_assignee"]}, "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": "models/intermediate/intermediate_asana.yml", "build_path": "target/compiled/asana/models/intermediate/int_asana__subtask_parent.sql", "deferred": false, "unrendered_config": {"schema": "asana", "materialized": "ephemeral"}, "compiled_sql": "with 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_tests_stg_asana`.`stg_asana__task`\n\n),\n\nasana_user as (\n\n select *\n from `dbt-package-testing`.`asana_source_integration_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": {"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, "database": "dbt-package-testing", "schema": "asana_source_integration_tests_asana", "fqn": ["asana", "intermediate", "int_asana__task_story"], "unique_id": "model.asana.int_asana__task_story", "package_name": "asana", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Asana/dbt_asana/integration_tests/dbt_modules/asana", "path": "intermediate/int_asana__task_story.sql", "original_file_path": "models/intermediate/int_asana__task_story.sql", "name": "int_asana__task_story", "resource_type": "model", "alias": "int_asana__task_story", "checksum": {"name": "sha256", "checksum": "805d894194316cd83e1d8545a98c05a3b63d808f0bdf342160be47c79c05f6e9"}, "config": {"enabled": true, "materialized": "ephemeral", "persist_docs": {}, "post-hook": [], "pre-hook": [], "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "asana", "database": null, "tags": [], "full_refresh": null}, "tags": [], "refs": [["stg_asana__story"], ["stg_asana__user"]], "sources": [], "depends_on": {"macros": [], "nodes": ["model.asana_source.stg_asana__story", "model.asana_source.stg_asana__user"]}, "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": "models/intermediate/intermediate_asana.yml", "build_path": "target/compiled/asana/models/intermediate/int_asana__task_story.sql", "deferred": false, "unrendered_config": {"schema": "asana", "materialized": "ephemeral"}, "compiled_sql": "with story as (\n \n select * \n from `dbt-package-testing`.`asana_source_integration_tests_stg_asana`.`stg_asana__story`\n\n),\n\nasana_user as (\n\n select * \n from `dbt-package-testing`.`asana_source_integration_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.unique_asana__task_task_id": {"raw_sql": "{{ config(severity='ERROR') }}{{ test_unique(**_dbt_schema_test_kwargs) }}", "test_metadata": {"namespace": null, "name": "unique", "kwargs": {"column_name": "task_id", "model": "{{ ref('asana__task') }}"}}, "compiled": true, "database": "dbt-package-testing", "schema": "asana_source_integration_tests_asana", "fqn": ["asana", "schema_test", "unique_asana__task_task_id"], "unique_id": "test.asana.unique_asana__task_task_id", "package_name": "asana", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Asana/dbt_asana/integration_tests/dbt_modules/asana", "path": "schema_test/unique_asana__task_task_id.sql", "original_file_path": "models/asana.yml", "name": "unique_asana__task_task_id", "resource_type": "test", "alias": "unique_asana__task_task_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "materialized": "table", "persist_docs": {}, "post-hook": [], "pre-hook": [], "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "asana", "database": null, "tags": [], "full_refresh": null, "severity": "ERROR"}, "tags": ["schema"], "refs": [["asana__task"]], "sources": [], "depends_on": {"macros": ["macro.dbt.test_unique"], "nodes": ["model.asana.asana__task"]}, "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "build_path": "target/compiled/asana/models/asana.yml/schema_test/unique_asana__task_task_id.sql", "deferred": false, "unrendered_config": {"schema": "asana", "materialized": "table", "severity": "ERROR"}, "compiled_sql": "\n \n \n\n\n\nselect count(*) as validation_errors\nfrom (\n\n select\n task_id\n\n from `dbt-package-testing`.`asana_source_integration_tests_asana`.`asana__task`\n where task_id is not null\n group by task_id\n having count(*) > 1\n\n) validation_errors\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "task_id"}, "test.asana.not_null_asana__task_task_id": {"raw_sql": "{{ config(severity='ERROR') }}{{ test_not_null(**_dbt_schema_test_kwargs) }}", "test_metadata": {"namespace": null, "name": "not_null", "kwargs": {"column_name": "task_id", "model": "{{ ref('asana__task') }}"}}, "compiled": true, "database": "dbt-package-testing", "schema": "asana_source_integration_tests_asana", "fqn": ["asana", "schema_test", "not_null_asana__task_task_id"], "unique_id": "test.asana.not_null_asana__task_task_id", "package_name": "asana", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Asana/dbt_asana/integration_tests/dbt_modules/asana", "path": "schema_test/not_null_asana__task_task_id.sql", "original_file_path": "models/asana.yml", "name": "not_null_asana__task_task_id", "resource_type": "test", "alias": "not_null_asana__task_task_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "materialized": "table", "persist_docs": {}, "post-hook": [], "pre-hook": [], "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "asana", "database": null, "tags": [], "full_refresh": null, "severity": "ERROR"}, "tags": ["schema"], "refs": [["asana__task"]], "sources": [], "depends_on": {"macros": ["macro.dbt.test_not_null"], "nodes": ["model.asana.asana__task"]}, "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "build_path": "target/compiled/asana/models/asana.yml/schema_test/not_null_asana__task_task_id.sql", "deferred": false, "unrendered_config": {"schema": "asana", "materialized": "table", "severity": "ERROR"}, "compiled_sql": "\n \n \n\n\n\nselect count(*) as validation_errors\nfrom `dbt-package-testing`.`asana_source_integration_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"}, "test.asana.unique_asana__user_user_id": {"raw_sql": "{{ config(severity='ERROR') }}{{ test_unique(**_dbt_schema_test_kwargs) }}", "test_metadata": {"namespace": null, "name": "unique", "kwargs": {"column_name": "user_id", "model": "{{ ref('asana__user') }}"}}, "compiled": true, "database": "dbt-package-testing", "schema": "asana_source_integration_tests_asana", "fqn": ["asana", "schema_test", "unique_asana__user_user_id"], "unique_id": "test.asana.unique_asana__user_user_id", "package_name": "asana", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Asana/dbt_asana/integration_tests/dbt_modules/asana", "path": "schema_test/unique_asana__user_user_id.sql", "original_file_path": "models/asana.yml", "name": "unique_asana__user_user_id", "resource_type": "test", "alias": "unique_asana__user_user_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "materialized": "table", "persist_docs": {}, "post-hook": [], "pre-hook": [], "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "asana", "database": null, "tags": [], "full_refresh": null, "severity": "ERROR"}, "tags": ["schema"], "refs": [["asana__user"]], "sources": [], "depends_on": {"macros": ["macro.dbt.test_unique"], "nodes": ["model.asana.asana__user"]}, "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "build_path": "target/compiled/asana/models/asana.yml/schema_test/unique_asana__user_user_id.sql", "deferred": false, "unrendered_config": {"schema": "asana", "materialized": "table", "severity": "ERROR"}, "compiled_sql": "\n \n \n\n\n\nselect count(*) as validation_errors\nfrom (\n\n select\n user_id\n\n from `dbt-package-testing`.`asana_source_integration_tests_asana`.`asana__user`\n where user_id is not null\n group by user_id\n having count(*) > 1\n\n) validation_errors\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "user_id"}, "test.asana.not_null_asana__user_user_id": {"raw_sql": "{{ config(severity='ERROR') }}{{ test_not_null(**_dbt_schema_test_kwargs) }}", "test_metadata": {"namespace": null, "name": "not_null", "kwargs": {"column_name": "user_id", "model": "{{ ref('asana__user') }}"}}, "compiled": true, "database": "dbt-package-testing", "schema": "asana_source_integration_tests_asana", "fqn": ["asana", "schema_test", "not_null_asana__user_user_id"], "unique_id": "test.asana.not_null_asana__user_user_id", "package_name": "asana", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Asana/dbt_asana/integration_tests/dbt_modules/asana", "path": "schema_test/not_null_asana__user_user_id.sql", "original_file_path": "models/asana.yml", "name": "not_null_asana__user_user_id", "resource_type": "test", "alias": "not_null_asana__user_user_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "materialized": "table", "persist_docs": {}, "post-hook": [], "pre-hook": [], "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "asana", "database": null, "tags": [], "full_refresh": null, "severity": "ERROR"}, "tags": ["schema"], "refs": [["asana__user"]], "sources": [], "depends_on": {"macros": ["macro.dbt.test_not_null"], "nodes": ["model.asana.asana__user"]}, "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "build_path": "target/compiled/asana/models/asana.yml/schema_test/not_null_asana__user_user_id.sql", "deferred": false, "unrendered_config": {"schema": "asana", "materialized": "table", "severity": "ERROR"}, "compiled_sql": "\n \n \n\n\n\nselect count(*) as validation_errors\nfrom `dbt-package-testing`.`asana_source_integration_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"}, "test.asana.unique_asana__project_project_id": {"raw_sql": "{{ config(severity='ERROR') }}{{ test_unique(**_dbt_schema_test_kwargs) }}", "test_metadata": {"namespace": null, "name": "unique", "kwargs": {"column_name": "project_id", "model": "{{ ref('asana__project') }}"}}, "compiled": true, "database": "dbt-package-testing", "schema": "asana_source_integration_tests_asana", "fqn": ["asana", "schema_test", "unique_asana__project_project_id"], "unique_id": "test.asana.unique_asana__project_project_id", "package_name": "asana", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Asana/dbt_asana/integration_tests/dbt_modules/asana", "path": "schema_test/unique_asana__project_project_id.sql", "original_file_path": "models/asana.yml", "name": "unique_asana__project_project_id", "resource_type": "test", "alias": "unique_asana__project_project_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "materialized": "table", "persist_docs": {}, "post-hook": [], "pre-hook": [], "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "asana", "database": null, "tags": [], "full_refresh": null, "severity": "ERROR"}, "tags": ["schema"], "refs": [["asana__project"]], "sources": [], "depends_on": {"macros": ["macro.dbt.test_unique"], "nodes": ["model.asana.asana__project"]}, "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "build_path": "target/compiled/asana/models/asana.yml/schema_test/unique_asana__project_project_id.sql", "deferred": false, "unrendered_config": {"schema": "asana", "materialized": "table", "severity": "ERROR"}, "compiled_sql": "\n \n \n\n\n\nselect count(*) as validation_errors\nfrom (\n\n select\n project_id\n\n from `dbt-package-testing`.`asana_source_integration_tests_asana`.`asana__project`\n where project_id is not null\n group by project_id\n having count(*) > 1\n\n) validation_errors\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "project_id"}, "test.asana.not_null_asana__project_project_id": {"raw_sql": "{{ config(severity='ERROR') }}{{ test_not_null(**_dbt_schema_test_kwargs) }}", "test_metadata": {"namespace": null, "name": "not_null", "kwargs": {"column_name": "project_id", "model": "{{ ref('asana__project') }}"}}, "compiled": true, "database": "dbt-package-testing", "schema": "asana_source_integration_tests_asana", "fqn": ["asana", "schema_test", "not_null_asana__project_project_id"], "unique_id": "test.asana.not_null_asana__project_project_id", "package_name": "asana", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Asana/dbt_asana/integration_tests/dbt_modules/asana", "path": "schema_test/not_null_asana__project_project_id.sql", "original_file_path": "models/asana.yml", "name": "not_null_asana__project_project_id", "resource_type": "test", "alias": "not_null_asana__project_project_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "materialized": "table", "persist_docs": {}, "post-hook": [], "pre-hook": [], "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "asana", "database": null, "tags": [], "full_refresh": null, "severity": "ERROR"}, "tags": ["schema"], "refs": [["asana__project"]], "sources": [], "depends_on": {"macros": ["macro.dbt.test_not_null"], "nodes": ["model.asana.asana__project"]}, "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "build_path": "target/compiled/asana/models/asana.yml/schema_test/not_null_asana__project_project_id.sql", "deferred": false, "unrendered_config": {"schema": "asana", "materialized": "table", "severity": "ERROR"}, "compiled_sql": "\n \n \n\n\n\nselect count(*) as validation_errors\nfrom `dbt-package-testing`.`asana_source_integration_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"}, "test.asana.unique_asana__team_team_id": {"raw_sql": "{{ config(severity='ERROR') }}{{ test_unique(**_dbt_schema_test_kwargs) }}", "test_metadata": {"namespace": null, "name": "unique", "kwargs": {"column_name": "team_id", "model": "{{ ref('asana__team') }}"}}, "compiled": true, "database": "dbt-package-testing", "schema": "asana_source_integration_tests_asana", "fqn": ["asana", "schema_test", "unique_asana__team_team_id"], "unique_id": "test.asana.unique_asana__team_team_id", "package_name": "asana", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Asana/dbt_asana/integration_tests/dbt_modules/asana", "path": "schema_test/unique_asana__team_team_id.sql", "original_file_path": "models/asana.yml", "name": "unique_asana__team_team_id", "resource_type": "test", "alias": "unique_asana__team_team_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "materialized": "table", "persist_docs": {}, "post-hook": [], "pre-hook": [], "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "asana", "database": null, "tags": [], "full_refresh": null, "severity": "ERROR"}, "tags": ["schema"], "refs": [["asana__team"]], "sources": [], "depends_on": {"macros": ["macro.dbt.test_unique"], "nodes": ["model.asana.asana__team"]}, "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "build_path": "target/compiled/asana/models/asana.yml/schema_test/unique_asana__team_team_id.sql", "deferred": false, "unrendered_config": {"schema": "asana", "materialized": "table", "severity": "ERROR"}, "compiled_sql": "\n \n \n\n\n\nselect count(*) as validation_errors\nfrom (\n\n select\n team_id\n\n from `dbt-package-testing`.`asana_source_integration_tests_asana`.`asana__team`\n where team_id is not null\n group by team_id\n having count(*) > 1\n\n) validation_errors\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "team_id"}, "test.asana.not_null_asana__team_team_id": {"raw_sql": "{{ config(severity='ERROR') }}{{ test_not_null(**_dbt_schema_test_kwargs) }}", "test_metadata": {"namespace": null, "name": "not_null", "kwargs": {"column_name": "team_id", "model": "{{ ref('asana__team') }}"}}, "compiled": true, "database": "dbt-package-testing", "schema": "asana_source_integration_tests_asana", "fqn": ["asana", "schema_test", "not_null_asana__team_team_id"], "unique_id": "test.asana.not_null_asana__team_team_id", "package_name": "asana", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Asana/dbt_asana/integration_tests/dbt_modules/asana", "path": "schema_test/not_null_asana__team_team_id.sql", "original_file_path": "models/asana.yml", "name": "not_null_asana__team_team_id", "resource_type": "test", "alias": "not_null_asana__team_team_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "materialized": "table", "persist_docs": {}, "post-hook": [], "pre-hook": [], "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "asana", "database": null, "tags": [], "full_refresh": null, "severity": "ERROR"}, "tags": ["schema"], "refs": [["asana__team"]], "sources": [], "depends_on": {"macros": ["macro.dbt.test_not_null"], "nodes": ["model.asana.asana__team"]}, "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "build_path": "target/compiled/asana/models/asana.yml/schema_test/not_null_asana__team_team_id.sql", "deferred": false, "unrendered_config": {"schema": "asana", "materialized": "table", "severity": "ERROR"}, "compiled_sql": "\n \n \n\n\n\nselect count(*) as validation_errors\nfrom `dbt-package-testing`.`asana_source_integration_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"}, "test.asana.unique_asana__tag_tag_id": {"raw_sql": "{{ config(severity='ERROR') }}{{ test_unique(**_dbt_schema_test_kwargs) }}", "test_metadata": {"namespace": null, "name": "unique", "kwargs": {"column_name": "tag_id", "model": "{{ ref('asana__tag') }}"}}, "compiled": true, "database": "dbt-package-testing", "schema": "asana_source_integration_tests_asana", "fqn": ["asana", "schema_test", "unique_asana__tag_tag_id"], "unique_id": "test.asana.unique_asana__tag_tag_id", "package_name": "asana", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Asana/dbt_asana/integration_tests/dbt_modules/asana", "path": "schema_test/unique_asana__tag_tag_id.sql", "original_file_path": "models/asana.yml", "name": "unique_asana__tag_tag_id", "resource_type": "test", "alias": "unique_asana__tag_tag_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "materialized": "table", "persist_docs": {}, "post-hook": [], "pre-hook": [], "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "asana", "database": null, "tags": [], "full_refresh": null, "severity": "ERROR"}, "tags": ["schema"], "refs": [["asana__tag"]], "sources": [], "depends_on": {"macros": ["macro.dbt.test_unique"], "nodes": ["model.asana.asana__tag"]}, "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "build_path": "target/compiled/asana/models/asana.yml/schema_test/unique_asana__tag_tag_id.sql", "deferred": false, "unrendered_config": {"schema": "asana", "materialized": "table", "severity": "ERROR"}, "compiled_sql": "\n \n \n\n\n\nselect count(*) as validation_errors\nfrom (\n\n select\n tag_id\n\n from `dbt-package-testing`.`asana_source_integration_tests_asana`.`asana__tag`\n where tag_id is not null\n group by tag_id\n having count(*) > 1\n\n) validation_errors\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "tag_id"}, "test.asana.not_null_asana__tag_tag_id": {"raw_sql": "{{ config(severity='ERROR') }}{{ test_not_null(**_dbt_schema_test_kwargs) }}", "test_metadata": {"namespace": null, "name": "not_null", "kwargs": {"column_name": "tag_id", "model": "{{ ref('asana__tag') }}"}}, "compiled": true, "database": "dbt-package-testing", "schema": "asana_source_integration_tests_asana", "fqn": ["asana", "schema_test", "not_null_asana__tag_tag_id"], "unique_id": "test.asana.not_null_asana__tag_tag_id", "package_name": "asana", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Asana/dbt_asana/integration_tests/dbt_modules/asana", "path": "schema_test/not_null_asana__tag_tag_id.sql", "original_file_path": "models/asana.yml", "name": "not_null_asana__tag_tag_id", "resource_type": "test", "alias": "not_null_asana__tag_tag_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "materialized": "table", "persist_docs": {}, "post-hook": [], "pre-hook": [], "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "asana", "database": null, "tags": [], "full_refresh": null, "severity": "ERROR"}, "tags": ["schema"], "refs": [["asana__tag"]], "sources": [], "depends_on": {"macros": ["macro.dbt.test_not_null"], "nodes": ["model.asana.asana__tag"]}, "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "build_path": "target/compiled/asana/models/asana.yml/schema_test/not_null_asana__tag_tag_id.sql", "deferred": false, "unrendered_config": {"schema": "asana", "materialized": "table", "severity": "ERROR"}, "compiled_sql": "\n \n \n\n\n\nselect count(*) as validation_errors\nfrom `dbt-package-testing`.`asana_source_integration_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"}, "test.asana.unique_asana__daily_metrics_date_day": {"raw_sql": "{{ config(severity='ERROR') }}{{ test_unique(**_dbt_schema_test_kwargs) }}", "test_metadata": {"namespace": null, "name": "unique", "kwargs": {"column_name": "date_day", "model": "{{ ref('asana__daily_metrics') }}"}}, "compiled": true, "database": "dbt-package-testing", "schema": "asana_source_integration_tests_asana", "fqn": ["asana", "schema_test", "unique_asana__daily_metrics_date_day"], "unique_id": "test.asana.unique_asana__daily_metrics_date_day", "package_name": "asana", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Asana/dbt_asana/integration_tests/dbt_modules/asana", "path": "schema_test/unique_asana__daily_metrics_date_day.sql", "original_file_path": "models/asana.yml", "name": "unique_asana__daily_metrics_date_day", "resource_type": "test", "alias": "unique_asana__daily_metrics_date_day", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "materialized": "table", "persist_docs": {}, "post-hook": [], "pre-hook": [], "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "asana", "database": null, "tags": [], "full_refresh": null, "severity": "ERROR"}, "tags": ["schema"], "refs": [["asana__daily_metrics"]], "sources": [], "depends_on": {"macros": ["macro.dbt.test_unique"], "nodes": ["model.asana.asana__daily_metrics"]}, "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "build_path": "target/compiled/asana/models/asana.yml/schema_test/unique_asana__daily_metrics_date_day.sql", "deferred": false, "unrendered_config": {"schema": "asana", "materialized": "table", "severity": "ERROR"}, "compiled_sql": "\n \n \n\n\n\nselect count(*) as validation_errors\nfrom (\n\n select\n date_day\n\n from `dbt-package-testing`.`asana_source_integration_tests_asana`.`asana__daily_metrics`\n where date_day is not null\n group by date_day\n having count(*) > 1\n\n) validation_errors\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "date_day"}, "test.asana.not_null_asana__daily_metrics_date_day": {"raw_sql": "{{ config(severity='ERROR') }}{{ test_not_null(**_dbt_schema_test_kwargs) }}", "test_metadata": {"namespace": null, "name": "not_null", "kwargs": {"column_name": "date_day", "model": "{{ ref('asana__daily_metrics') }}"}}, "compiled": true, "database": "dbt-package-testing", "schema": "asana_source_integration_tests_asana", "fqn": ["asana", "schema_test", "not_null_asana__daily_metrics_date_day"], "unique_id": "test.asana.not_null_asana__daily_metrics_date_day", "package_name": "asana", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Asana/dbt_asana/integration_tests/dbt_modules/asana", "path": "schema_test/not_null_asana__daily_metrics_date_day.sql", "original_file_path": "models/asana.yml", "name": "not_null_asana__daily_metrics_date_day", "resource_type": "test", "alias": "not_null_asana__daily_metrics_date_day", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "materialized": "table", "persist_docs": {}, "post-hook": [], "pre-hook": [], "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "asana", "database": null, "tags": [], "full_refresh": null, "severity": "ERROR"}, "tags": ["schema"], "refs": [["asana__daily_metrics"]], "sources": [], "depends_on": {"macros": ["macro.dbt.test_not_null"], "nodes": ["model.asana.asana__daily_metrics"]}, "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "build_path": "target/compiled/asana/models/asana.yml/schema_test/not_null_asana__daily_metrics_date_day.sql", "deferred": false, "unrendered_config": {"schema": "asana", "materialized": "table", "severity": "ERROR"}, "compiled_sql": "\n \n \n\n\n\nselect count(*) as validation_errors\nfrom `dbt-package-testing`.`asana_source_integration_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"}, "test.asana.unique_int_asana__project_task_metrics_project_id": {"raw_sql": "{{ config(severity='ERROR') }}{{ test_unique(**_dbt_schema_test_kwargs) }}", "test_metadata": {"namespace": null, "name": "unique", "kwargs": {"column_name": "project_id", "model": "{{ ref('int_asana__project_task_metrics') }}"}}, "compiled": true, "database": "dbt-package-testing", "schema": "asana_source_integration_tests_asana", "fqn": ["asana", "schema_test", "unique_int_asana__project_task_metrics_project_id"], "unique_id": "test.asana.unique_int_asana__project_task_metrics_project_id", "package_name": "asana", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Asana/dbt_asana/integration_tests/dbt_modules/asana", "path": "schema_test/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", "resource_type": "test", "alias": "unique_int_asana__project_task_metrics_project_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "materialized": "table", "persist_docs": {}, "post-hook": [], "pre-hook": [], "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "asana", "database": null, "tags": [], "full_refresh": null, "severity": "ERROR"}, "tags": ["schema"], "refs": [["int_asana__project_task_metrics"]], "sources": [], "depends_on": {"macros": ["macro.dbt.test_unique"], "nodes": ["model.asana.int_asana__project_task_metrics"]}, "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "build_path": "target/compiled/asana/models/intermediate/intermediate_asana.yml/schema_test/unique_int_asana__project_task_metrics_project_id.sql", "deferred": false, "unrendered_config": {"schema": "asana", "materialized": "table", "severity": "ERROR"}, "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_tests_asana`.`asana__task`\n\n),\n\nproject as (\n\n select * \n from `dbt-package-testing`.`asana_source_integration_tests_stg_asana`.`stg_asana__project`\n\n),\n\nproject_task as (\n\n select * \n from `dbt-package-testing`.`asana_source_integration_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 count(*) as validation_errors\nfrom (\n\n select\n project_id\n\n from __dbt__CTE__int_asana__project_task_metrics\n where project_id is not null\n group by project_id\n having count(*) > 1\n\n) validation_errors\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_tests_asana`.`asana__task`\n\n),\n\nproject as (\n\n select * \n from `dbt-package-testing`.`asana_source_integration_tests_stg_asana`.`stg_asana__project`\n\n),\n\nproject_task as (\n\n select * \n from `dbt-package-testing`.`asana_source_integration_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"}, "test.asana.not_null_int_asana__project_task_metrics_project_id": {"raw_sql": "{{ config(severity='ERROR') }}{{ test_not_null(**_dbt_schema_test_kwargs) }}", "test_metadata": {"namespace": null, "name": "not_null", "kwargs": {"column_name": "project_id", "model": "{{ ref('int_asana__project_task_metrics') }}"}}, "compiled": true, "database": "dbt-package-testing", "schema": "asana_source_integration_tests_asana", "fqn": ["asana", "schema_test", "not_null_int_asana__project_task_metrics_project_id"], "unique_id": "test.asana.not_null_int_asana__project_task_metrics_project_id", "package_name": "asana", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Asana/dbt_asana/integration_tests/dbt_modules/asana", "path": "schema_test/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", "resource_type": "test", "alias": "not_null_int_asana__project_task_metrics_project_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "materialized": "table", "persist_docs": {}, "post-hook": [], "pre-hook": [], "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "asana", "database": null, "tags": [], "full_refresh": null, "severity": "ERROR"}, "tags": ["schema"], "refs": [["int_asana__project_task_metrics"]], "sources": [], "depends_on": {"macros": ["macro.dbt.test_not_null"], "nodes": ["model.asana.int_asana__project_task_metrics"]}, "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "build_path": "target/compiled/asana/models/intermediate/intermediate_asana.yml/schema_test/not_null_int_asana__project_task_metrics_project_id.sql", "deferred": false, "unrendered_config": {"schema": "asana", "materialized": "table", "severity": "ERROR"}, "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_tests_asana`.`asana__task`\n\n),\n\nproject as (\n\n select * \n from `dbt-package-testing`.`asana_source_integration_tests_stg_asana`.`stg_asana__project`\n\n),\n\nproject_task as (\n\n select * \n from `dbt-package-testing`.`asana_source_integration_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 count(*) as validation_errors\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_tests_asana`.`asana__task`\n\n),\n\nproject as (\n\n select * \n from `dbt-package-testing`.`asana_source_integration_tests_stg_asana`.`stg_asana__project`\n\n),\n\nproject_task as (\n\n select * \n from `dbt-package-testing`.`asana_source_integration_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"}, "test.asana.dbt_utils_unique_combination_of_columns_int_asana__project_user_project_id__user_id__role__currently_working_on": {"raw_sql": "{{ config(severity='ERROR') }}{{ dbt_utils.test_unique_combination_of_columns(**_dbt_schema_test_kwargs) }}", "test_metadata": {"namespace": "dbt_utils", "name": "unique_combination_of_columns", "kwargs": {"combination_of_columns": ["project_id", "user_id", "role", "currently_working_on"], "model": "{{ ref('int_asana__project_user') }}"}}, "compiled": true, "database": "dbt-package-testing", "schema": "asana_source_integration_tests_asana", "fqn": ["asana", "schema_test", "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", "package_name": "asana", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Asana/dbt_asana/integration_tests/dbt_modules/asana", "path": "schema_test/dbt_utils_unique_combination_of_columns_int_asana__project_user_efdaebbddbf132e469db851ae8fcd100.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", "resource_type": "test", "alias": "dbt_utils_unique_combination_of_columns_int_asana__project_user_project_id__user_id__role__currently_working_on", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "materialized": "table", "persist_docs": {}, "post-hook": [], "pre-hook": [], "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "asana", "database": null, "tags": [], "full_refresh": null, "severity": "ERROR"}, "tags": ["schema"], "refs": [["int_asana__project_user"]], "sources": [], "depends_on": {"macros": ["macro.dbt_utils.test_unique_combination_of_columns"], "nodes": ["model.asana.int_asana__project_user"]}, "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "build_path": "target/compiled/asana/models/intermediate/intermediate_asana.yml/schema_test/dbt_utils_unique_combination_of_columns_int_asana__project_user_efdaebbddbf132e469db851ae8fcd100.sql", "deferred": false, "unrendered_config": {"schema": "asana", "materialized": "table", "severity": "ERROR"}, "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_tests_stg_asana`.`stg_asana__task`\n\n),\n\nasana_user as (\n\n select *\n from `dbt-package-testing`.`asana_source_integration_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 `dbt-package-testing`.`asana_source_integration_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 `dbt-package-testing`.`asana_source_integration_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\n group by project_id, user_id, role, currently_working_on\n having count(*) > 1\n\n)\n\nselect count(*)\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_tests_stg_asana`.`stg_asana__task`\n\n),\n\nasana_user as (\n\n select *\n from `dbt-package-testing`.`asana_source_integration_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 `dbt-package-testing`.`asana_source_integration_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 `dbt-package-testing`.`asana_source_integration_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}, "test.asana.unique_int_asana__subtask_parent_subtask_id": {"raw_sql": "{{ config(severity='ERROR') }}{{ test_unique(**_dbt_schema_test_kwargs) }}", "test_metadata": {"namespace": null, "name": "unique", "kwargs": {"column_name": "subtask_id", "model": "{{ ref('int_asana__subtask_parent') }}"}}, "compiled": true, "database": "dbt-package-testing", "schema": "asana_source_integration_tests_asana", "fqn": ["asana", "schema_test", "unique_int_asana__subtask_parent_subtask_id"], "unique_id": "test.asana.unique_int_asana__subtask_parent_subtask_id", "package_name": "asana", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Asana/dbt_asana/integration_tests/dbt_modules/asana", "path": "schema_test/unique_int_asana__subtask_parent_subtask_id.sql", "original_file_path": "models/intermediate/intermediate_asana.yml", "name": "unique_int_asana__subtask_parent_subtask_id", "resource_type": "test", "alias": "unique_int_asana__subtask_parent_subtask_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "materialized": "table", "persist_docs": {}, "post-hook": [], "pre-hook": [], "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "asana", "database": null, "tags": [], "full_refresh": null, "severity": "ERROR"}, "tags": ["schema"], "refs": [["int_asana__subtask_parent"]], "sources": [], "depends_on": {"macros": ["macro.dbt.test_unique"], "nodes": ["model.asana.int_asana__subtask_parent"]}, "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "build_path": "target/compiled/asana/models/intermediate/intermediate_asana.yml/schema_test/unique_int_asana__subtask_parent_subtask_id.sql", "deferred": false, "unrendered_config": {"schema": "asana", "materialized": "table", "severity": "ERROR"}, "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_tests_stg_asana`.`stg_asana__task`\n\n),\n\nasana_user as (\n\n select *\n from `dbt-package-testing`.`asana_source_integration_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 count(*) as validation_errors\nfrom (\n\n select\n subtask_id\n\n from __dbt__CTE__int_asana__subtask_parent\n where subtask_id is not null\n group by subtask_id\n having count(*) > 1\n\n) 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_tests_stg_asana`.`stg_asana__task`\n\n),\n\nasana_user as (\n\n select *\n from `dbt-package-testing`.`asana_source_integration_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"}, "test.asana.not_null_int_asana__subtask_parent_subtask_id": {"raw_sql": "{{ config(severity='ERROR') }}{{ test_not_null(**_dbt_schema_test_kwargs) }}", "test_metadata": {"namespace": null, "name": "not_null", "kwargs": {"column_name": "subtask_id", "model": "{{ ref('int_asana__subtask_parent') }}"}}, "compiled": true, "database": "dbt-package-testing", "schema": "asana_source_integration_tests_asana", "fqn": ["asana", "schema_test", "not_null_int_asana__subtask_parent_subtask_id"], "unique_id": "test.asana.not_null_int_asana__subtask_parent_subtask_id", "package_name": "asana", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Asana/dbt_asana/integration_tests/dbt_modules/asana", "path": "schema_test/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", "resource_type": "test", "alias": "not_null_int_asana__subtask_parent_subtask_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "materialized": "table", "persist_docs": {}, "post-hook": [], "pre-hook": [], "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "asana", "database": null, "tags": [], "full_refresh": null, "severity": "ERROR"}, "tags": ["schema"], "refs": [["int_asana__subtask_parent"]], "sources": [], "depends_on": {"macros": ["macro.dbt.test_not_null"], "nodes": ["model.asana.int_asana__subtask_parent"]}, "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "build_path": "target/compiled/asana/models/intermediate/intermediate_asana.yml/schema_test/not_null_int_asana__subtask_parent_subtask_id.sql", "deferred": false, "unrendered_config": {"schema": "asana", "materialized": "table", "severity": "ERROR"}, "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_tests_stg_asana`.`stg_asana__task`\n\n),\n\nasana_user as (\n\n select *\n from `dbt-package-testing`.`asana_source_integration_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 count(*) as validation_errors\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_tests_stg_asana`.`stg_asana__task`\n\n),\n\nasana_user as (\n\n select *\n from `dbt-package-testing`.`asana_source_integration_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"}, "test.asana.unique_int_asana__task_assignee_task_id": {"raw_sql": "{{ config(severity='ERROR') }}{{ test_unique(**_dbt_schema_test_kwargs) }}", "test_metadata": {"namespace": null, "name": "unique", "kwargs": {"column_name": "task_id", "model": "{{ ref('int_asana__task_assignee') }}"}}, "compiled": true, "database": "dbt-package-testing", "schema": "asana_source_integration_tests_asana", "fqn": ["asana", "schema_test", "unique_int_asana__task_assignee_task_id"], "unique_id": "test.asana.unique_int_asana__task_assignee_task_id", "package_name": "asana", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Asana/dbt_asana/integration_tests/dbt_modules/asana", "path": "schema_test/unique_int_asana__task_assignee_task_id.sql", "original_file_path": "models/intermediate/intermediate_asana.yml", "name": "unique_int_asana__task_assignee_task_id", "resource_type": "test", "alias": "unique_int_asana__task_assignee_task_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "materialized": "table", "persist_docs": {}, "post-hook": [], "pre-hook": [], "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "asana", "database": null, "tags": [], "full_refresh": null, "severity": "ERROR"}, "tags": ["schema"], "refs": [["int_asana__task_assignee"]], "sources": [], "depends_on": {"macros": ["macro.dbt.test_unique"], "nodes": ["model.asana.int_asana__task_assignee"]}, "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "build_path": "target/compiled/asana/models/intermediate/intermediate_asana.yml/schema_test/unique_int_asana__task_assignee_task_id.sql", "deferred": false, "unrendered_config": {"schema": "asana", "materialized": "table", "severity": "ERROR"}, "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_tests_stg_asana`.`stg_asana__task`\n\n),\n\nasana_user as (\n\n select *\n from `dbt-package-testing`.`asana_source_integration_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 count(*) as validation_errors\nfrom (\n\n select\n task_id\n\n from __dbt__CTE__int_asana__task_assignee\n where task_id is not null\n group by task_id\n having count(*) > 1\n\n) 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_tests_stg_asana`.`stg_asana__task`\n\n),\n\nasana_user as (\n\n select *\n from `dbt-package-testing`.`asana_source_integration_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"}, "test.asana.not_null_int_asana__task_assignee_task_id": {"raw_sql": "{{ config(severity='ERROR') }}{{ test_not_null(**_dbt_schema_test_kwargs) }}", "test_metadata": {"namespace": null, "name": "not_null", "kwargs": {"column_name": "task_id", "model": "{{ ref('int_asana__task_assignee') }}"}}, "compiled": true, "database": "dbt-package-testing", "schema": "asana_source_integration_tests_asana", "fqn": ["asana", "schema_test", "not_null_int_asana__task_assignee_task_id"], "unique_id": "test.asana.not_null_int_asana__task_assignee_task_id", "package_name": "asana", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Asana/dbt_asana/integration_tests/dbt_modules/asana", "path": "schema_test/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", "resource_type": "test", "alias": "not_null_int_asana__task_assignee_task_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "materialized": "table", "persist_docs": {}, "post-hook": [], "pre-hook": [], "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "asana", "database": null, "tags": [], "full_refresh": null, "severity": "ERROR"}, "tags": ["schema"], "refs": [["int_asana__task_assignee"]], "sources": [], "depends_on": {"macros": ["macro.dbt.test_not_null"], "nodes": ["model.asana.int_asana__task_assignee"]}, "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "build_path": "target/compiled/asana/models/intermediate/intermediate_asana.yml/schema_test/not_null_int_asana__task_assignee_task_id.sql", "deferred": false, "unrendered_config": {"schema": "asana", "materialized": "table", "severity": "ERROR"}, "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_tests_stg_asana`.`stg_asana__task`\n\n),\n\nasana_user as (\n\n select *\n from `dbt-package-testing`.`asana_source_integration_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 count(*) as validation_errors\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_tests_stg_asana`.`stg_asana__task`\n\n),\n\nasana_user as (\n\n select *\n from `dbt-package-testing`.`asana_source_integration_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"}, "test.asana.unique_int_asana__task_comments_task_id": {"raw_sql": "{{ config(severity='ERROR') }}{{ test_unique(**_dbt_schema_test_kwargs) }}", "test_metadata": {"namespace": null, "name": "unique", "kwargs": {"column_name": "task_id", "model": "{{ ref('int_asana__task_comments') }}"}}, "compiled": true, "database": "dbt-package-testing", "schema": "asana_source_integration_tests_asana", "fqn": ["asana", "schema_test", "unique_int_asana__task_comments_task_id"], "unique_id": "test.asana.unique_int_asana__task_comments_task_id", "package_name": "asana", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Asana/dbt_asana/integration_tests/dbt_modules/asana", "path": "schema_test/unique_int_asana__task_comments_task_id.sql", "original_file_path": "models/intermediate/intermediate_asana.yml", "name": "unique_int_asana__task_comments_task_id", "resource_type": "test", "alias": "unique_int_asana__task_comments_task_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "materialized": "table", "persist_docs": {}, "post-hook": [], "pre-hook": [], "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "asana", "database": null, "tags": [], "full_refresh": null, "severity": "ERROR"}, "tags": ["schema"], "refs": [["int_asana__task_comments"]], "sources": [], "depends_on": {"macros": ["macro.dbt.test_unique"], "nodes": ["model.asana.int_asana__task_comments"]}, "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "build_path": "target/compiled/asana/models/intermediate/intermediate_asana.yml/schema_test/unique_int_asana__task_comments_task_id.sql", "deferred": false, "unrendered_config": {"schema": "asana", "materialized": "table", "severity": "ERROR"}, "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_tests_stg_asana`.`stg_asana__story`\n\n),\n\nasana_user as (\n\n select * \n from `dbt-package-testing`.`asana_source_integration_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 count(*) as validation_errors\nfrom (\n\n select\n task_id\n\n from __dbt__CTE__int_asana__task_comments\n where task_id is not null\n group by task_id\n having count(*) > 1\n\n) validation_errors\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_tests_stg_asana`.`stg_asana__story`\n\n),\n\nasana_user as (\n\n select * \n from `dbt-package-testing`.`asana_source_integration_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"}, "test.asana.not_null_int_asana__task_comments_task_id": {"raw_sql": "{{ config(severity='ERROR') }}{{ test_not_null(**_dbt_schema_test_kwargs) }}", "test_metadata": {"namespace": null, "name": "not_null", "kwargs": {"column_name": "task_id", "model": "{{ ref('int_asana__task_comments') }}"}}, "compiled": true, "database": "dbt-package-testing", "schema": "asana_source_integration_tests_asana", "fqn": ["asana", "schema_test", "not_null_int_asana__task_comments_task_id"], "unique_id": "test.asana.not_null_int_asana__task_comments_task_id", "package_name": "asana", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Asana/dbt_asana/integration_tests/dbt_modules/asana", "path": "schema_test/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", "resource_type": "test", "alias": "not_null_int_asana__task_comments_task_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "materialized": "table", "persist_docs": {}, "post-hook": [], "pre-hook": [], "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "asana", "database": null, "tags": [], "full_refresh": null, "severity": "ERROR"}, "tags": ["schema"], "refs": [["int_asana__task_comments"]], "sources": [], "depends_on": {"macros": ["macro.dbt.test_not_null"], "nodes": ["model.asana.int_asana__task_comments"]}, "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "build_path": "target/compiled/asana/models/intermediate/intermediate_asana.yml/schema_test/not_null_int_asana__task_comments_task_id.sql", "deferred": false, "unrendered_config": {"schema": "asana", "materialized": "table", "severity": "ERROR"}, "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_tests_stg_asana`.`stg_asana__story`\n\n),\n\nasana_user as (\n\n select * \n from `dbt-package-testing`.`asana_source_integration_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 count(*) as validation_errors\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_tests_stg_asana`.`stg_asana__story`\n\n),\n\nasana_user as (\n\n select * \n from `dbt-package-testing`.`asana_source_integration_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"}, "test.asana.unique_int_asana__task_first_modifier_task_id": {"raw_sql": "{{ config(severity='ERROR') }}{{ test_unique(**_dbt_schema_test_kwargs) }}", "test_metadata": {"namespace": null, "name": "unique", "kwargs": {"column_name": "task_id", "model": "{{ ref('int_asana__task_first_modifier') }}"}}, "compiled": true, "database": "dbt-package-testing", "schema": "asana_source_integration_tests_asana", "fqn": ["asana", "schema_test", "unique_int_asana__task_first_modifier_task_id"], "unique_id": "test.asana.unique_int_asana__task_first_modifier_task_id", "package_name": "asana", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Asana/dbt_asana/integration_tests/dbt_modules/asana", "path": "schema_test/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", "resource_type": "test", "alias": "unique_int_asana__task_first_modifier_task_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "materialized": "table", "persist_docs": {}, "post-hook": [], "pre-hook": [], "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "asana", "database": null, "tags": [], "full_refresh": null, "severity": "ERROR"}, "tags": ["schema"], "refs": [["int_asana__task_first_modifier"]], "sources": [], "depends_on": {"macros": ["macro.dbt.test_unique"], "nodes": ["model.asana.int_asana__task_first_modifier"]}, "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "build_path": "target/compiled/asana/models/intermediate/intermediate_asana.yml/schema_test/unique_int_asana__task_first_modifier_task_id.sql", "deferred": false, "unrendered_config": {"schema": "asana", "materialized": "table", "severity": "ERROR"}, "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_tests_stg_asana`.`stg_asana__story`\n\n),\n\nasana_user as (\n\n select * \n from `dbt-package-testing`.`asana_source_integration_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 count(*) as validation_errors\nfrom (\n\n select\n task_id\n\n from __dbt__CTE__int_asana__task_first_modifier\n where task_id is not null\n group by task_id\n having count(*) > 1\n\n) validation_errors\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_tests_stg_asana`.`stg_asana__story`\n\n),\n\nasana_user as (\n\n select * \n from `dbt-package-testing`.`asana_source_integration_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"}, "test.asana.not_null_int_asana__task_first_modifier_task_id": {"raw_sql": "{{ config(severity='ERROR') }}{{ test_not_null(**_dbt_schema_test_kwargs) }}", "test_metadata": {"namespace": null, "name": "not_null", "kwargs": {"column_name": "task_id", "model": "{{ ref('int_asana__task_first_modifier') }}"}}, "compiled": true, "database": "dbt-package-testing", "schema": "asana_source_integration_tests_asana", "fqn": ["asana", "schema_test", "not_null_int_asana__task_first_modifier_task_id"], "unique_id": "test.asana.not_null_int_asana__task_first_modifier_task_id", "package_name": "asana", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Asana/dbt_asana/integration_tests/dbt_modules/asana", "path": "schema_test/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", "resource_type": "test", "alias": "not_null_int_asana__task_first_modifier_task_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "materialized": "table", "persist_docs": {}, "post-hook": [], "pre-hook": [], "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "asana", "database": null, "tags": [], "full_refresh": null, "severity": "ERROR"}, "tags": ["schema"], "refs": [["int_asana__task_first_modifier"]], "sources": [], "depends_on": {"macros": ["macro.dbt.test_not_null"], "nodes": ["model.asana.int_asana__task_first_modifier"]}, "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "build_path": "target/compiled/asana/models/intermediate/intermediate_asana.yml/schema_test/not_null_int_asana__task_first_modifier_task_id.sql", "deferred": false, "unrendered_config": {"schema": "asana", "materialized": "table", "severity": "ERROR"}, "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_tests_stg_asana`.`stg_asana__story`\n\n),\n\nasana_user as (\n\n select * \n from `dbt-package-testing`.`asana_source_integration_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 count(*) as validation_errors\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_tests_stg_asana`.`stg_asana__story`\n\n),\n\nasana_user as (\n\n select * \n from `dbt-package-testing`.`asana_source_integration_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"}, "test.asana.unique_int_asana__task_followers_task_id": {"raw_sql": "{{ config(severity='ERROR') }}{{ test_unique(**_dbt_schema_test_kwargs) }}", "test_metadata": {"namespace": null, "name": "unique", "kwargs": {"column_name": "task_id", "model": "{{ ref('int_asana__task_followers') }}"}}, "compiled": true, "database": "dbt-package-testing", "schema": "asana_source_integration_tests_asana", "fqn": ["asana", "schema_test", "unique_int_asana__task_followers_task_id"], "unique_id": "test.asana.unique_int_asana__task_followers_task_id", "package_name": "asana", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Asana/dbt_asana/integration_tests/dbt_modules/asana", "path": "schema_test/unique_int_asana__task_followers_task_id.sql", "original_file_path": "models/intermediate/intermediate_asana.yml", "name": "unique_int_asana__task_followers_task_id", "resource_type": "test", "alias": "unique_int_asana__task_followers_task_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "materialized": "table", "persist_docs": {}, "post-hook": [], "pre-hook": [], "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "asana", "database": null, "tags": [], "full_refresh": null, "severity": "ERROR"}, "tags": ["schema"], "refs": [["int_asana__task_followers"]], "sources": [], "depends_on": {"macros": ["macro.dbt.test_unique"], "nodes": ["model.asana.int_asana__task_followers"]}, "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "build_path": "target/compiled/asana/models/intermediate/intermediate_asana.yml/schema_test/unique_int_asana__task_followers_task_id.sql", "deferred": false, "unrendered_config": {"schema": "asana", "materialized": "table", "severity": "ERROR"}, "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_tests_stg_asana`.`stg_asana__task_follower`\n\n),\n\nasana_user as (\n\n select * \n from `dbt-package-testing`.`asana_source_integration_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 count(*) as validation_errors\nfrom (\n\n select\n task_id\n\n from __dbt__CTE__int_asana__task_followers\n where task_id is not null\n group by task_id\n having count(*) > 1\n\n) validation_errors\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_tests_stg_asana`.`stg_asana__task_follower`\n\n),\n\nasana_user as (\n\n select * \n from `dbt-package-testing`.`asana_source_integration_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"}, "test.asana.not_null_int_asana__task_followers_task_id": {"raw_sql": "{{ config(severity='ERROR') }}{{ test_not_null(**_dbt_schema_test_kwargs) }}", "test_metadata": {"namespace": null, "name": "not_null", "kwargs": {"column_name": "task_id", "model": "{{ ref('int_asana__task_followers') }}"}}, "compiled": true, "database": "dbt-package-testing", "schema": "asana_source_integration_tests_asana", "fqn": ["asana", "schema_test", "not_null_int_asana__task_followers_task_id"], "unique_id": "test.asana.not_null_int_asana__task_followers_task_id", "package_name": "asana", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Asana/dbt_asana/integration_tests/dbt_modules/asana", "path": "schema_test/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", "resource_type": "test", "alias": "not_null_int_asana__task_followers_task_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "materialized": "table", "persist_docs": {}, "post-hook": [], "pre-hook": [], "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "asana", "database": null, "tags": [], "full_refresh": null, "severity": "ERROR"}, "tags": ["schema"], "refs": [["int_asana__task_followers"]], "sources": [], "depends_on": {"macros": ["macro.dbt.test_not_null"], "nodes": ["model.asana.int_asana__task_followers"]}, "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "build_path": "target/compiled/asana/models/intermediate/intermediate_asana.yml/schema_test/not_null_int_asana__task_followers_task_id.sql", "deferred": false, "unrendered_config": {"schema": "asana", "materialized": "table", "severity": "ERROR"}, "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_tests_stg_asana`.`stg_asana__task_follower`\n\n),\n\nasana_user as (\n\n select * \n from `dbt-package-testing`.`asana_source_integration_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 count(*) as validation_errors\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_tests_stg_asana`.`stg_asana__task_follower`\n\n),\n\nasana_user as (\n\n select * \n from `dbt-package-testing`.`asana_source_integration_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"}, "test.asana.unique_int_asana__task_open_length_task_id": {"raw_sql": "{{ config(severity='ERROR') }}{{ test_unique(**_dbt_schema_test_kwargs) }}", "test_metadata": {"namespace": null, "name": "unique", "kwargs": {"column_name": "task_id", "model": "{{ ref('int_asana__task_open_length') }}"}}, "compiled": true, "database": "dbt-package-testing", "schema": "asana_source_integration_tests_asana", "fqn": ["asana", "schema_test", "unique_int_asana__task_open_length_task_id"], "unique_id": "test.asana.unique_int_asana__task_open_length_task_id", "package_name": "asana", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Asana/dbt_asana/integration_tests/dbt_modules/asana", "path": "schema_test/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", "resource_type": "test", "alias": "unique_int_asana__task_open_length_task_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "materialized": "table", "persist_docs": {}, "post-hook": [], "pre-hook": [], "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "asana", "database": null, "tags": [], "full_refresh": null, "severity": "ERROR"}, "tags": ["schema"], "refs": [["int_asana__task_open_length"]], "sources": [], "depends_on": {"macros": ["macro.dbt.test_unique"], "nodes": ["model.asana.int_asana__task_open_length"]}, "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "build_path": "target/compiled/asana/models/intermediate/intermediate_asana.yml/schema_test/unique_int_asana__task_open_length_task_id.sql", "deferred": false, "unrendered_config": {"schema": "asana", "materialized": "table", "severity": "ERROR"}, "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_tests_stg_asana`.`stg_asana__story`\n\n),\n\nasana_user as (\n\n select * \n from `dbt-package-testing`.`asana_source_integration_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 `dbt-package-testing`.`asana_source_integration_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 datetime_diff(\n cast(\n current_timestamp\n as datetime),\n cast(task.created_at as datetime),\n day\n )\n\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 datetime_diff(\n cast(\n current_timestamp\n as datetime),\n cast(assignments.last_assigned_at as datetime),\n day\n )\n\n as days_since_last_assignment,\n\n \n\n datetime_diff(\n cast(\n current_timestamp\n as datetime),\n cast(assignments.first_assigned_at as datetime),\n day\n )\n\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 count(*) as validation_errors\nfrom (\n\n select\n task_id\n\n from __dbt__CTE__int_asana__task_open_length\n where task_id is not null\n group by task_id\n having count(*) > 1\n\n) validation_errors\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_tests_stg_asana`.`stg_asana__story`\n\n),\n\nasana_user as (\n\n select * \n from `dbt-package-testing`.`asana_source_integration_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 `dbt-package-testing`.`asana_source_integration_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 datetime_diff(\n cast(\n current_timestamp\n as datetime),\n cast(task.created_at as datetime),\n day\n )\n\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 datetime_diff(\n cast(\n current_timestamp\n as datetime),\n cast(assignments.last_assigned_at as datetime),\n day\n )\n\n as days_since_last_assignment,\n\n \n\n datetime_diff(\n cast(\n current_timestamp\n as datetime),\n cast(assignments.first_assigned_at as datetime),\n day\n )\n\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"}, "test.asana.not_null_int_asana__task_open_length_task_id": {"raw_sql": "{{ config(severity='ERROR') }}{{ test_not_null(**_dbt_schema_test_kwargs) }}", "test_metadata": {"namespace": null, "name": "not_null", "kwargs": {"column_name": "task_id", "model": "{{ ref('int_asana__task_open_length') }}"}}, "compiled": true, "database": "dbt-package-testing", "schema": "asana_source_integration_tests_asana", "fqn": ["asana", "schema_test", "not_null_int_asana__task_open_length_task_id"], "unique_id": "test.asana.not_null_int_asana__task_open_length_task_id", "package_name": "asana", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Asana/dbt_asana/integration_tests/dbt_modules/asana", "path": "schema_test/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", "resource_type": "test", "alias": "not_null_int_asana__task_open_length_task_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "materialized": "table", "persist_docs": {}, "post-hook": [], "pre-hook": [], "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "asana", "database": null, "tags": [], "full_refresh": null, "severity": "ERROR"}, "tags": ["schema"], "refs": [["int_asana__task_open_length"]], "sources": [], "depends_on": {"macros": ["macro.dbt.test_not_null"], "nodes": ["model.asana.int_asana__task_open_length"]}, "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "build_path": "target/compiled/asana/models/intermediate/intermediate_asana.yml/schema_test/not_null_int_asana__task_open_length_task_id.sql", "deferred": false, "unrendered_config": {"schema": "asana", "materialized": "table", "severity": "ERROR"}, "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_tests_stg_asana`.`stg_asana__story`\n\n),\n\nasana_user as (\n\n select * \n from `dbt-package-testing`.`asana_source_integration_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 `dbt-package-testing`.`asana_source_integration_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 datetime_diff(\n cast(\n current_timestamp\n as datetime),\n cast(task.created_at as datetime),\n day\n )\n\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 datetime_diff(\n cast(\n current_timestamp\n as datetime),\n cast(assignments.last_assigned_at as datetime),\n day\n )\n\n as days_since_last_assignment,\n\n \n\n datetime_diff(\n cast(\n current_timestamp\n as datetime),\n cast(assignments.first_assigned_at as datetime),\n day\n )\n\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 count(*) as validation_errors\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_tests_stg_asana`.`stg_asana__story`\n\n),\n\nasana_user as (\n\n select * \n from `dbt-package-testing`.`asana_source_integration_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 `dbt-package-testing`.`asana_source_integration_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 datetime_diff(\n cast(\n current_timestamp\n as datetime),\n cast(task.created_at as datetime),\n day\n )\n\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 datetime_diff(\n cast(\n current_timestamp\n as datetime),\n cast(assignments.last_assigned_at as datetime),\n day\n )\n\n as days_since_last_assignment,\n\n \n\n datetime_diff(\n cast(\n current_timestamp\n as datetime),\n cast(assignments.first_assigned_at as datetime),\n day\n )\n\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"}, "test.asana.unique_int_asana__task_projects_task_id": {"raw_sql": "{{ config(severity='ERROR') }}{{ test_unique(**_dbt_schema_test_kwargs) }}", "test_metadata": {"namespace": null, "name": "unique", "kwargs": {"column_name": "task_id", "model": "{{ ref('int_asana__task_projects') }}"}}, "compiled": true, "database": "dbt-package-testing", "schema": "asana_source_integration_tests_asana", "fqn": ["asana", "schema_test", "unique_int_asana__task_projects_task_id"], "unique_id": "test.asana.unique_int_asana__task_projects_task_id", "package_name": "asana", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Asana/dbt_asana/integration_tests/dbt_modules/asana", "path": "schema_test/unique_int_asana__task_projects_task_id.sql", "original_file_path": "models/intermediate/intermediate_asana.yml", "name": "unique_int_asana__task_projects_task_id", "resource_type": "test", "alias": "unique_int_asana__task_projects_task_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "materialized": "table", "persist_docs": {}, "post-hook": [], "pre-hook": [], "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "asana", "database": null, "tags": [], "full_refresh": null, "severity": "ERROR"}, "tags": ["schema"], "refs": [["int_asana__task_projects"]], "sources": [], "depends_on": {"macros": ["macro.dbt.test_unique"], "nodes": ["model.asana.int_asana__task_projects"]}, "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "build_path": "target/compiled/asana/models/intermediate/intermediate_asana.yml/schema_test/unique_int_asana__task_projects_task_id.sql", "deferred": false, "unrendered_config": {"schema": "asana", "materialized": "table", "severity": "ERROR"}, "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_tests_stg_asana`.`stg_asana__project_task`\n\n),\n\nproject as (\n \n select * \n from `dbt-package-testing`.`asana_source_integration_tests_stg_asana`.`stg_asana__project`\n),\n\ntask_section as (\n\n select * \n from `dbt-package-testing`.`asana_source_integration_tests_stg_asana`.`stg_asana__task_section`\n\n),\n\nsection as (\n \n select * \n from `dbt-package-testing`.`asana_source_integration_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 count(*) as validation_errors\nfrom (\n\n select\n task_id\n\n from __dbt__CTE__int_asana__task_projects\n where task_id is not null\n group by task_id\n having count(*) > 1\n\n) validation_errors\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_tests_stg_asana`.`stg_asana__project_task`\n\n),\n\nproject as (\n \n select * \n from `dbt-package-testing`.`asana_source_integration_tests_stg_asana`.`stg_asana__project`\n),\n\ntask_section as (\n\n select * \n from `dbt-package-testing`.`asana_source_integration_tests_stg_asana`.`stg_asana__task_section`\n\n),\n\nsection as (\n \n select * \n from `dbt-package-testing`.`asana_source_integration_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"}, "test.asana.not_null_int_asana__task_projects_task_id": {"raw_sql": "{{ config(severity='ERROR') }}{{ test_not_null(**_dbt_schema_test_kwargs) }}", "test_metadata": {"namespace": null, "name": "not_null", "kwargs": {"column_name": "task_id", "model": "{{ ref('int_asana__task_projects') }}"}}, "compiled": true, "database": "dbt-package-testing", "schema": "asana_source_integration_tests_asana", "fqn": ["asana", "schema_test", "not_null_int_asana__task_projects_task_id"], "unique_id": "test.asana.not_null_int_asana__task_projects_task_id", "package_name": "asana", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Asana/dbt_asana/integration_tests/dbt_modules/asana", "path": "schema_test/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", "resource_type": "test", "alias": "not_null_int_asana__task_projects_task_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "materialized": "table", "persist_docs": {}, "post-hook": [], "pre-hook": [], "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "asana", "database": null, "tags": [], "full_refresh": null, "severity": "ERROR"}, "tags": ["schema"], "refs": [["int_asana__task_projects"]], "sources": [], "depends_on": {"macros": ["macro.dbt.test_not_null"], "nodes": ["model.asana.int_asana__task_projects"]}, "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "build_path": "target/compiled/asana/models/intermediate/intermediate_asana.yml/schema_test/not_null_int_asana__task_projects_task_id.sql", "deferred": false, "unrendered_config": {"schema": "asana", "materialized": "table", "severity": "ERROR"}, "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_tests_stg_asana`.`stg_asana__project_task`\n\n),\n\nproject as (\n \n select * \n from `dbt-package-testing`.`asana_source_integration_tests_stg_asana`.`stg_asana__project`\n),\n\ntask_section as (\n\n select * \n from `dbt-package-testing`.`asana_source_integration_tests_stg_asana`.`stg_asana__task_section`\n\n),\n\nsection as (\n \n select * \n from `dbt-package-testing`.`asana_source_integration_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 count(*) as validation_errors\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_tests_stg_asana`.`stg_asana__project_task`\n\n),\n\nproject as (\n \n select * \n from `dbt-package-testing`.`asana_source_integration_tests_stg_asana`.`stg_asana__project`\n),\n\ntask_section as (\n\n select * \n from `dbt-package-testing`.`asana_source_integration_tests_stg_asana`.`stg_asana__task_section`\n\n),\n\nsection as (\n \n select * \n from `dbt-package-testing`.`asana_source_integration_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"}, "test.asana.unique_int_asana__task_story_story_id": {"raw_sql": "{{ config(severity='ERROR') }}{{ test_unique(**_dbt_schema_test_kwargs) }}", "test_metadata": {"namespace": null, "name": "unique", "kwargs": {"column_name": "story_id", "model": "{{ ref('int_asana__task_story') }}"}}, "compiled": true, "database": "dbt-package-testing", "schema": "asana_source_integration_tests_asana", "fqn": ["asana", "schema_test", "unique_int_asana__task_story_story_id"], "unique_id": "test.asana.unique_int_asana__task_story_story_id", "package_name": "asana", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Asana/dbt_asana/integration_tests/dbt_modules/asana", "path": "schema_test/unique_int_asana__task_story_story_id.sql", "original_file_path": "models/intermediate/intermediate_asana.yml", "name": "unique_int_asana__task_story_story_id", "resource_type": "test", "alias": "unique_int_asana__task_story_story_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "materialized": "table", "persist_docs": {}, "post-hook": [], "pre-hook": [], "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "asana", "database": null, "tags": [], "full_refresh": null, "severity": "ERROR"}, "tags": ["schema"], "refs": [["int_asana__task_story"]], "sources": [], "depends_on": {"macros": ["macro.dbt.test_unique"], "nodes": ["model.asana.int_asana__task_story"]}, "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "build_path": "target/compiled/asana/models/intermediate/intermediate_asana.yml/schema_test/unique_int_asana__task_story_story_id.sql", "deferred": false, "unrendered_config": {"schema": "asana", "materialized": "table", "severity": "ERROR"}, "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_tests_stg_asana`.`stg_asana__story`\n\n),\n\nasana_user as (\n\n select * \n from `dbt-package-testing`.`asana_source_integration_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 count(*) as validation_errors\nfrom (\n\n select\n story_id\n\n from __dbt__CTE__int_asana__task_story\n where story_id is not null\n group by story_id\n having count(*) > 1\n\n) validation_errors\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_tests_stg_asana`.`stg_asana__story`\n\n),\n\nasana_user as (\n\n select * \n from `dbt-package-testing`.`asana_source_integration_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"}, "test.asana.not_null_int_asana__task_story_story_id": {"raw_sql": "{{ config(severity='ERROR') }}{{ test_not_null(**_dbt_schema_test_kwargs) }}", "test_metadata": {"namespace": null, "name": "not_null", "kwargs": {"column_name": "story_id", "model": "{{ ref('int_asana__task_story') }}"}}, "compiled": true, "database": "dbt-package-testing", "schema": "asana_source_integration_tests_asana", "fqn": ["asana", "schema_test", "not_null_int_asana__task_story_story_id"], "unique_id": "test.asana.not_null_int_asana__task_story_story_id", "package_name": "asana", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Asana/dbt_asana/integration_tests/dbt_modules/asana", "path": "schema_test/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", "resource_type": "test", "alias": "not_null_int_asana__task_story_story_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "materialized": "table", "persist_docs": {}, "post-hook": [], "pre-hook": [], "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "asana", "database": null, "tags": [], "full_refresh": null, "severity": "ERROR"}, "tags": ["schema"], "refs": [["int_asana__task_story"]], "sources": [], "depends_on": {"macros": ["macro.dbt.test_not_null"], "nodes": ["model.asana.int_asana__task_story"]}, "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "build_path": "target/compiled/asana/models/intermediate/intermediate_asana.yml/schema_test/not_null_int_asana__task_story_story_id.sql", "deferred": false, "unrendered_config": {"schema": "asana", "materialized": "table", "severity": "ERROR"}, "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_tests_stg_asana`.`stg_asana__story`\n\n),\n\nasana_user as (\n\n select * \n from `dbt-package-testing`.`asana_source_integration_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 count(*) as validation_errors\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_tests_stg_asana`.`stg_asana__story`\n\n),\n\nasana_user as (\n\n select * \n from `dbt-package-testing`.`asana_source_integration_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"}, "test.asana.unique_int_asana__task_tags_task_id": {"raw_sql": "{{ config(severity='ERROR') }}{{ test_unique(**_dbt_schema_test_kwargs) }}", "test_metadata": {"namespace": null, "name": "unique", "kwargs": {"column_name": "task_id", "model": "{{ ref('int_asana__task_tags') }}"}}, "compiled": true, "database": "dbt-package-testing", "schema": "asana_source_integration_tests_asana", "fqn": ["asana", "schema_test", "unique_int_asana__task_tags_task_id"], "unique_id": "test.asana.unique_int_asana__task_tags_task_id", "package_name": "asana", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Asana/dbt_asana/integration_tests/dbt_modules/asana", "path": "schema_test/unique_int_asana__task_tags_task_id.sql", "original_file_path": "models/intermediate/intermediate_asana.yml", "name": "unique_int_asana__task_tags_task_id", "resource_type": "test", "alias": "unique_int_asana__task_tags_task_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "materialized": "table", "persist_docs": {}, "post-hook": [], "pre-hook": [], "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "asana", "database": null, "tags": [], "full_refresh": null, "severity": "ERROR"}, "tags": ["schema"], "refs": [["int_asana__task_tags"]], "sources": [], "depends_on": {"macros": ["macro.dbt.test_unique"], "nodes": ["model.asana.int_asana__task_tags"]}, "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "build_path": "target/compiled/asana/models/intermediate/intermediate_asana.yml/schema_test/unique_int_asana__task_tags_task_id.sql", "deferred": false, "unrendered_config": {"schema": "asana", "materialized": "table", "severity": "ERROR"}, "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_tests_stg_asana`.`stg_asana__task_tag`\n\n),\n\nasana_tag as (\n\n select * \n from `dbt-package-testing`.`asana_source_integration_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 count(*) as validation_errors\nfrom (\n\n select\n task_id\n\n from __dbt__CTE__int_asana__task_tags\n where task_id is not null\n group by task_id\n having count(*) > 1\n\n) validation_errors\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_tests_stg_asana`.`stg_asana__task_tag`\n\n),\n\nasana_tag as (\n\n select * \n from `dbt-package-testing`.`asana_source_integration_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"}, "test.asana.not_null_int_asana__task_tags_task_id": {"raw_sql": "{{ config(severity='ERROR') }}{{ test_not_null(**_dbt_schema_test_kwargs) }}", "test_metadata": {"namespace": null, "name": "not_null", "kwargs": {"column_name": "task_id", "model": "{{ ref('int_asana__task_tags') }}"}}, "compiled": true, "database": "dbt-package-testing", "schema": "asana_source_integration_tests_asana", "fqn": ["asana", "schema_test", "not_null_int_asana__task_tags_task_id"], "unique_id": "test.asana.not_null_int_asana__task_tags_task_id", "package_name": "asana", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Asana/dbt_asana/integration_tests/dbt_modules/asana", "path": "schema_test/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", "resource_type": "test", "alias": "not_null_int_asana__task_tags_task_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "materialized": "table", "persist_docs": {}, "post-hook": [], "pre-hook": [], "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "asana", "database": null, "tags": [], "full_refresh": null, "severity": "ERROR"}, "tags": ["schema"], "refs": [["int_asana__task_tags"]], "sources": [], "depends_on": {"macros": ["macro.dbt.test_not_null"], "nodes": ["model.asana.int_asana__task_tags"]}, "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "build_path": "target/compiled/asana/models/intermediate/intermediate_asana.yml/schema_test/not_null_int_asana__task_tags_task_id.sql", "deferred": false, "unrendered_config": {"schema": "asana", "materialized": "table", "severity": "ERROR"}, "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_tests_stg_asana`.`stg_asana__task_tag`\n\n),\n\nasana_tag as (\n\n select * \n from `dbt-package-testing`.`asana_source_integration_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 count(*) as validation_errors\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_tests_stg_asana`.`stg_asana__task_tag`\n\n),\n\nasana_tag as (\n\n select * \n from `dbt-package-testing`.`asana_source_integration_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"}, "test.asana.unique_int_asana__user_task_metrics_user_id": {"raw_sql": "{{ config(severity='ERROR') }}{{ test_unique(**_dbt_schema_test_kwargs) }}", "test_metadata": {"namespace": null, "name": "unique", "kwargs": {"column_name": "user_id", "model": "{{ ref('int_asana__user_task_metrics') }}"}}, "compiled": true, "database": "dbt-package-testing", "schema": "asana_source_integration_tests_asana", "fqn": ["asana", "schema_test", "unique_int_asana__user_task_metrics_user_id"], "unique_id": "test.asana.unique_int_asana__user_task_metrics_user_id", "package_name": "asana", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Asana/dbt_asana/integration_tests/dbt_modules/asana", "path": "schema_test/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", "resource_type": "test", "alias": "unique_int_asana__user_task_metrics_user_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "materialized": "table", "persist_docs": {}, "post-hook": [], "pre-hook": [], "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "asana", "database": null, "tags": [], "full_refresh": null, "severity": "ERROR"}, "tags": ["schema"], "refs": [["int_asana__user_task_metrics"]], "sources": [], "depends_on": {"macros": ["macro.dbt.test_unique"], "nodes": ["model.asana.int_asana__user_task_metrics"]}, "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "build_path": "target/compiled/asana/models/intermediate/intermediate_asana.yml/schema_test/unique_int_asana__user_task_metrics_user_id.sql", "deferred": false, "unrendered_config": {"schema": "asana", "materialized": "table", "severity": "ERROR"}, "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_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 count(*) as validation_errors\nfrom (\n\n select\n user_id\n\n from __dbt__CTE__int_asana__user_task_metrics\n where user_id is not null\n group by user_id\n having count(*) > 1\n\n) validation_errors\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_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"}, "test.asana.not_null_int_asana__user_task_metrics_user_id": {"raw_sql": "{{ config(severity='ERROR') }}{{ test_not_null(**_dbt_schema_test_kwargs) }}", "test_metadata": {"namespace": null, "name": "not_null", "kwargs": {"column_name": "user_id", "model": "{{ ref('int_asana__user_task_metrics') }}"}}, "compiled": true, "database": "dbt-package-testing", "schema": "asana_source_integration_tests_asana", "fqn": ["asana", "schema_test", "not_null_int_asana__user_task_metrics_user_id"], "unique_id": "test.asana.not_null_int_asana__user_task_metrics_user_id", "package_name": "asana", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Asana/dbt_asana/integration_tests/dbt_modules/asana", "path": "schema_test/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", "resource_type": "test", "alias": "not_null_int_asana__user_task_metrics_user_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "materialized": "table", "persist_docs": {}, "post-hook": [], "pre-hook": [], "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "asana", "database": null, "tags": [], "full_refresh": null, "severity": "ERROR"}, "tags": ["schema"], "refs": [["int_asana__user_task_metrics"]], "sources": [], "depends_on": {"macros": ["macro.dbt.test_not_null"], "nodes": ["model.asana.int_asana__user_task_metrics"]}, "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "build_path": "target/compiled/asana/models/intermediate/intermediate_asana.yml/schema_test/not_null_int_asana__user_task_metrics_user_id.sql", "deferred": false, "unrendered_config": {"schema": "asana", "materialized": "table", "severity": "ERROR"}, "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_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 count(*) as validation_errors\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_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"}}, "sources": {"source.asana_source.asana.user": {"fqn": ["asana_source", "asana", "user"], "database": "dbt-package-testing", "schema": "asana_integration_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_modules/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", "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_integration_tests`.`user`"}, "source.asana_source.asana.task": {"fqn": ["asana_source", "asana", "task"], "database": "dbt-package-testing", "schema": "asana_integration_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_modules/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", "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": []}, "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": []}, "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": []}, "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_integration_tests`.`task`"}, "source.asana_source.asana.project": {"fqn": ["asana_source", "asana", "project"], "database": "dbt-package-testing", "schema": "asana_integration_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_modules/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", "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_integration_tests`.`project`"}, "source.asana_source.asana.story": {"fqn": ["asana_source", "asana", "story"], "database": "dbt-package-testing", "schema": "asana_integration_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_modules/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", "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_integration_tests`.`story`"}, "source.asana_source.asana.team": {"fqn": ["asana_source", "asana", "team"], "database": "dbt-package-testing", "schema": "asana_integration_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_modules/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", "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_integration_tests`.`team`"}, "source.asana_source.asana.tag": {"fqn": ["asana_source", "asana", "tag"], "database": "dbt-package-testing", "schema": "asana_integration_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_modules/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", "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_integration_tests`.`tag`"}, "source.asana_source.asana.section": {"fqn": ["asana_source", "asana", "section"], "database": "dbt-package-testing", "schema": "asana_integration_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_modules/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", "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_integration_tests`.`section`"}, "source.asana_source.asana.project_task": {"fqn": ["asana_source", "asana", "project_task"], "database": "dbt-package-testing", "schema": "asana_integration_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_modules/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", "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_integration_tests`.`project_task`"}, "source.asana_source.asana.task_follower": {"fqn": ["asana_source", "asana", "task_follower"], "database": "dbt-package-testing", "schema": "asana_integration_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_modules/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", "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_integration_tests`.`task_follower`"}, "source.asana_source.asana.task_tag": {"fqn": ["asana_source", "asana", "task_tag"], "database": "dbt-package-testing", "schema": "asana_integration_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_modules/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", "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_integration_tests`.`task_tag`"}, "source.asana_source.asana.task_section": {"fqn": ["asana_source", "asana", "task_section"], "database": "dbt-package-testing", "schema": "asana_integration_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_modules/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", "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_integration_tests`.`task_section`"}}, "macros": {"macro.dbt_bigquery.date_sharded_table": {"unique_id": "macro.dbt_bigquery.date_sharded_table", "package_name": "dbt_bigquery", "root_path": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/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": []}, "macro.dbt_bigquery.grant_access_to": {"unique_id": "macro.dbt_bigquery.grant_access_to", "package_name": "dbt_bigquery", "root_path": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/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": []}, "macro.dbt_bigquery.get_partitions_metadata": {"unique_id": "macro.dbt_bigquery.get_partitions_metadata", "package_name": "dbt_bigquery", "root_path": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/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": []}, "macro.dbt_bigquery.bigquery__get_catalog": {"unique_id": "macro.dbt_bigquery.bigquery__get_catalog", "package_name": "dbt_bigquery", "root_path": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/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": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt_bigquery.partition_by": {"unique_id": "macro.dbt_bigquery.partition_by", "package_name": "dbt_bigquery", "root_path": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/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": []}, "macro.dbt_bigquery.cluster_by": {"unique_id": "macro.dbt_bigquery.cluster_by", "package_name": "dbt_bigquery", "root_path": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/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\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt_bigquery.bigquery_table_options": {"unique_id": "macro.dbt_bigquery.bigquery_table_options", "package_name": "dbt_bigquery", "root_path": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/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\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": []}, "macro.dbt_bigquery.bigquery__create_table_as": {"unique_id": "macro.dbt_bigquery.bigquery__create_table_as", "package_name": "dbt_bigquery", "root_path": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/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": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt_bigquery.bigquery__create_view_as": {"unique_id": "macro.dbt_bigquery.bigquery__create_view_as", "package_name": "dbt_bigquery", "root_path": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/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_table_options(config, model, temporary=false) }}\n as {{ sql }};\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt_bigquery.bigquery__create_schema": {"unique_id": "macro.dbt_bigquery.bigquery__create_schema", "package_name": "dbt_bigquery", "root_path": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/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": []}, "macro.dbt_bigquery.bigquery__drop_schema": {"unique_id": "macro.dbt_bigquery.bigquery__drop_schema", "package_name": "dbt_bigquery", "root_path": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/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": []}, "macro.dbt_bigquery.bigquery__drop_relation": {"unique_id": "macro.dbt_bigquery.bigquery__drop_relation", "package_name": "dbt_bigquery", "root_path": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/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": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt_bigquery.bigquery__get_columns_in_relation": {"unique_id": "macro.dbt_bigquery.bigquery__get_columns_in_relation", "package_name": "dbt_bigquery", "root_path": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/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": []}, "macro.dbt_bigquery.bigquery__list_relations_without_caching": {"unique_id": "macro.dbt_bigquery.bigquery__list_relations_without_caching", "package_name": "dbt_bigquery", "root_path": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/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": []}, "macro.dbt_bigquery.bigquery__current_timestamp": {"unique_id": "macro.dbt_bigquery.bigquery__current_timestamp", "package_name": "dbt_bigquery", "root_path": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/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": []}, "macro.dbt_bigquery.bigquery__snapshot_string_as_time": {"unique_id": "macro.dbt_bigquery.bigquery__snapshot_string_as_time", "package_name": "dbt_bigquery", "root_path": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/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": []}, "macro.dbt_bigquery.bigquery__list_schemas": {"unique_id": "macro.dbt_bigquery.bigquery__list_schemas", "package_name": "dbt_bigquery", "root_path": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/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": []}, "macro.dbt_bigquery.bigquery__check_schema_exists": {"unique_id": "macro.dbt_bigquery.bigquery__check_schema_exists", "package_name": "dbt_bigquery", "root_path": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/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": []}, "macro.dbt_bigquery.bigquery__persist_docs": {"unique_id": "macro.dbt_bigquery.bigquery__persist_docs", "package_name": "dbt_bigquery", "root_path": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/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": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt_bigquery.bigquery__alter_column_comment": {"unique_id": "macro.dbt_bigquery.bigquery__alter_column_comment", "package_name": "dbt_bigquery", "root_path": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/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": []}, "macro.dbt_bigquery.bigquery__rename_relation": {"unique_id": "macro.dbt_bigquery.bigquery__rename_relation", "package_name": "dbt_bigquery", "root_path": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/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": []}, "macro.dbt_bigquery.bigquery__alter_column_type": {"unique_id": "macro.dbt_bigquery.bigquery__alter_column_type", "package_name": "dbt_bigquery", "root_path": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/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 {#\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": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt_bigquery.bigquery__create_csv_table": {"unique_id": "macro.dbt_bigquery.bigquery__create_csv_table", "package_name": "dbt_bigquery", "root_path": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/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": []}, "macro.dbt_bigquery.bigquery__reset_csv_table": {"unique_id": "macro.dbt_bigquery.bigquery__reset_csv_table", "package_name": "dbt_bigquery", "root_path": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/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": []}, "macro.dbt_bigquery.bigquery__load_csv_rows": {"unique_id": "macro.dbt_bigquery.bigquery__load_csv_rows", "package_name": "dbt_bigquery", "root_path": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/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": []}, "macro.dbt_bigquery.bigquery__handle_existing_table": {"unique_id": "macro.dbt_bigquery.bigquery__handle_existing_table", "package_name": "dbt_bigquery", "root_path": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/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": []}, "macro.dbt_bigquery.materialization_view_bigquery": {"unique_id": "macro.dbt_bigquery.materialization_view_bigquery", "package_name": "dbt_bigquery", "root_path": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/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 {% set to_return = create_or_replace_view(run_outside_transaction_hooks=False) %}\n\n {% set target_relation = this.incorporate(type='view') %}\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": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt_bigquery.make_date_partitioned_table": {"unique_id": "macro.dbt_bigquery.make_date_partitioned_table", "package_name": "dbt_bigquery", "root_path": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/dbt/include/bigquery", "path": "macros/materializations/table.sql", "original_file_path": "macros/materializations/table.sql", "name": "make_date_partitioned_table", "macro_sql": "{% macro make_date_partitioned_table(model, relation, dates, should_create, verbose=False) %}\n\n {% if should_create %}\n {{ adapter.make_date_partitioned_table(relation) }}\n {% endif %}\n\n {% for date in dates %}\n {% set date = (date | string) %}\n {% if verbose %}\n {% set table_start_time = modules.datetime.datetime.now().strftime(\"%H:%M:%S\") %}\n {{ log(table_start_time ~ ' | -> Running for day ' ~ date, info=True) }}\n {% endif %}\n\n {% set fixed_sql = model['compiled_sql'] | replace('[DBT__PARTITION_DATE]', date) %}\n {% set _ = adapter.execute_model(model, 'table', fixed_sql, decorator=date) %}\n {% endfor %}\n\n {% set num_days = dates | length %}\n {% if num_days == 1 %}\n {% set result_str = 'CREATED 1 PARTITION' %}\n {% else %}\n {% set result_str = 'CREATED ' ~ num_days ~ ' PARTITIONS' %}\n {% endif %}\n\n {{ store_result('main', response=result_str) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt_bigquery.materialization_table_bigquery": {"unique_id": "macro.dbt_bigquery.materialization_table_bigquery", "package_name": "dbt_bigquery", "root_path": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/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 {%- set verbose = config.get('verbose', False) -%}\n\n {# partitions: iterate over each partition, running a separate query in a for-loop #}\n {%- set partitions = config.get('partitions') -%}\n\n {% if partitions %}\n {% if partitions is number or partitions is string %}\n {% set partitions = [(partitions | string)] %}\n {% endif %}\n\n {% if partitions is not iterable %}\n {{ exceptions.raise_compiler_error(\"Provided `partitions` configuration is not a list. Got: \" ~ partitions, model) }}\n {% endif %}\n {% endif %}\n\n {{ run_hooks(pre_hooks) }}\n\n {#\n Since dbt uses WRITE_TRUNCATE mode for tables, we only need to drop this thing\n if it is not a table. If it _is_ already a table, then we can overwrite it without downtime\n #}\n {%- if exists_not_as_table -%}\n {{ adapter.drop_relation(old_relation) }}\n {%- endif -%}\n\n -- build model\n {% if partitions %}\n {# Create the dp-table if 1. it does not exist or 2. it existed, but we just dropped it #}\n {%- set should_create = (old_relation is none or exists_not_as_table) -%}\n {{ make_date_partitioned_table(model, target_relation, partitions, should_create, verbose) }}\n {% else %}\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 {% endif %}\n\n {{ run_hooks(post_hooks) }}\n\n {% do persist_docs(target_relation, model) %}\n\n {{ return({'relations': [target_relation]}) }}\n\n{% endmaterialization %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt_bigquery.materialization_copy_bigquery": {"unique_id": "macro.dbt_bigquery.materialization_copy_bigquery", "package_name": "dbt_bigquery", "root_path": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/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 {# there should be exactly one ref or exactly one source #}\n {% set destination = this.incorporate(type='table') %}\n\n {% set dependency_type = none %}\n {% if (model.refs | length) == 1 and (model.sources | length) == 0 %}\n {% set dependency_type = 'ref' %}\n {% elif (model.refs | length) == 0 and (model.sources | length) == 1 %}\n {% set dependency_type = 'source' %}\n {% else %}\n {% set msg %}\n Expected exactly one ref or exactly one source, instead got {{ model.refs | length }} models and {{ model.sources | length }} sources.\n {% endset %}\n {% do exceptions.raise_compiler_error(msg) %}\n {% endif %}\n\n {% if dependency_type == 'ref' %}\n {% set src = ref(*model.refs[0]) %}\n {% else %}\n {% set src = source(*model.sources[0]) %}\n {% endif %}\n\n {%- set result_str = adapter.copy_table(\n src,\n destination,\n config.get('copy_materialization', 'table')) -%}\n\n {{ store_result('main', response=result_str) }}\n\n {# Clean up #}\n {{ run_hooks(post_hooks) }}\n {{ adapter.commit() }}\n\n {{ return({'relations': [destination]}) }}\n{%- endmaterialization %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "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": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/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": []}, "macro.dbt_bigquery.bq_insert_overwrite": {"unique_id": "macro.dbt_bigquery.bq_insert_overwrite", "package_name": "dbt_bigquery", "root_path": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/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(tmp_relation, target_relation, sql, unique_key, partition_by, partitions, dest_columns) %}\n {%- set partition_type =\n 'date' if partition_by.data_type in ('timestamp, datetime')\n else partition_by.data_type -%}\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_type }}>;\n declare _dbt_max_partition {{ partition_by.data_type }};\n\n set _dbt_max_partition = (\n select max({{ partition_by.field }}) from {{ this }}\n );\n\n -- 1. create a temp table\n {{ create_table_as(True, tmp_relation, sql) }}\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": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt_bigquery.materialization_incremental_bigquery": {"unique_id": "macro.dbt_bigquery.materialization_incremental_bigquery", "package_name": "dbt_bigquery", "root_path": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/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 {{ run_hooks(pre_hooks) }}\n\n {% if existing_relation is none %}\n {% set build_sql = create_table_as(False, target_relation, sql) %}\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 {% 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 {% else %}\n {% set dest_columns = adapter.get_columns_in_relation(existing_relation) %}\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,\n target_relation,\n sql,\n unique_key,\n partition_by,\n partitions,\n dest_columns) %}\n\n {% else %}\n {#-- wrap sql in parens to make it a subquery --#}\n {%- set source_sql -%}\n (\n {{sql}}\n )\n {%- endset -%}\n\n {% set build_sql = get_merge_sql(target_relation, source_sql, unique_key, dest_columns) %}\n\n {% endif %}\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 {% do persist_docs(target_relation, model) %}\n\n {{ return({'relations': [target_relation]}) }}\n\n{%- endmaterialization %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt_bigquery.bigquery__snapshot_hash_arguments": {"unique_id": "macro.dbt_bigquery.bigquery__snapshot_hash_arguments", "package_name": "dbt_bigquery", "root_path": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/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": []}, "macro.dbt_bigquery.bigquery__create_columns": {"unique_id": "macro.dbt_bigquery.bigquery__create_columns", "package_name": "dbt_bigquery", "root_path": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/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": []}, "macro.dbt_bigquery.bigquery__post_snapshot": {"unique_id": "macro.dbt_bigquery.bigquery__post_snapshot", "package_name": "dbt_bigquery", "root_path": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/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": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt.statement": {"unique_id": "macro.dbt.statement", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/dbt/include/global_project", "path": "macros/core.sql", "original_file_path": "macros/core.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": []}, "macro.dbt.noop_statement": {"unique_id": "macro.dbt.noop_statement", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/dbt/include/global_project", "path": "macros/core.sql", "original_file_path": "macros/core.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": []}, "macro.dbt.run_hooks": {"unique_id": "macro.dbt.run_hooks", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/dbt/include/global_project", "path": "macros/materializations/helpers.sql", "original_file_path": "macros/materializations/helpers.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": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt.column_list": {"unique_id": "macro.dbt.column_list", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/dbt/include/global_project", "path": "macros/materializations/helpers.sql", "original_file_path": "macros/materializations/helpers.sql", "name": "column_list", "macro_sql": "{% macro column_list(columns) %}\n {%- for col in columns %}\n {{ col.name }} {% 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": []}, "macro.dbt.column_list_for_create_table": {"unique_id": "macro.dbt.column_list_for_create_table", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/dbt/include/global_project", "path": "macros/materializations/helpers.sql", "original_file_path": "macros/materializations/helpers.sql", "name": "column_list_for_create_table", "macro_sql": "{% macro column_list_for_create_table(columns) %}\n {%- for col in columns %}\n {{ col.name }} {{ col.data_type }} {%- 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": []}, "macro.dbt.make_hook_config": {"unique_id": "macro.dbt.make_hook_config", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/dbt/include/global_project", "path": "macros/materializations/helpers.sql", "original_file_path": "macros/materializations/helpers.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": []}, "macro.dbt.before_begin": {"unique_id": "macro.dbt.before_begin", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/dbt/include/global_project", "path": "macros/materializations/helpers.sql", "original_file_path": "macros/materializations/helpers.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": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt.in_transaction": {"unique_id": "macro.dbt.in_transaction", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/dbt/include/global_project", "path": "macros/materializations/helpers.sql", "original_file_path": "macros/materializations/helpers.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": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt.after_commit": {"unique_id": "macro.dbt.after_commit", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/dbt/include/global_project", "path": "macros/materializations/helpers.sql", "original_file_path": "macros/materializations/helpers.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": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt.drop_relation_if_exists": {"unique_id": "macro.dbt.drop_relation_if_exists", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/dbt/include/global_project", "path": "macros/materializations/helpers.sql", "original_file_path": "macros/materializations/helpers.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": []}, "macro.dbt.load_relation": {"unique_id": "macro.dbt.load_relation", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/dbt/include/global_project", "path": "macros/materializations/helpers.sql", "original_file_path": "macros/materializations/helpers.sql", "name": "load_relation", "macro_sql": "{% macro load_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": []}, "macro.dbt.should_full_refresh": {"unique_id": "macro.dbt.should_full_refresh", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/dbt/include/global_project", "path": "macros/materializations/helpers.sql", "original_file_path": "macros/materializations/helpers.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": []}, "macro.dbt.snapshot_merge_sql": {"unique_id": "macro.dbt.snapshot_merge_sql", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshot/snapshot_merge.sql", "original_file_path": "macros/materializations/snapshot/snapshot_merge.sql", "name": "snapshot_merge_sql", "macro_sql": "{% macro snapshot_merge_sql(target, source, insert_cols) -%}\n {{ adapter.dispatch('snapshot_merge_sql')(target, source, insert_cols) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt.default__snapshot_merge_sql": {"unique_id": "macro.dbt.default__snapshot_merge_sql", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshot/snapshot_merge.sql", "original_file_path": "macros/materializations/snapshot/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": []}, "macro.dbt.strategy_dispatch": {"unique_id": "macro.dbt.strategy_dispatch", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshot/strategies.sql", "original_file_path": "macros/materializations/snapshot/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": []}, "macro.dbt.snapshot_hash_arguments": {"unique_id": "macro.dbt.snapshot_hash_arguments", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshot/strategies.sql", "original_file_path": "macros/materializations/snapshot/strategies.sql", "name": "snapshot_hash_arguments", "macro_sql": "{% macro snapshot_hash_arguments(args) -%}\n {{ adapter.dispatch('snapshot_hash_arguments')(args) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt.default__snapshot_hash_arguments": {"unique_id": "macro.dbt.default__snapshot_hash_arguments", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshot/strategies.sql", "original_file_path": "macros/materializations/snapshot/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": []}, "macro.dbt.snapshot_get_time": {"unique_id": "macro.dbt.snapshot_get_time", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshot/strategies.sql", "original_file_path": "macros/materializations/snapshot/strategies.sql", "name": "snapshot_get_time", "macro_sql": "{% macro snapshot_get_time() -%}\n {{ adapter.dispatch('snapshot_get_time')() }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt.default__snapshot_get_time": {"unique_id": "macro.dbt.default__snapshot_get_time", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshot/strategies.sql", "original_file_path": "macros/materializations/snapshot/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": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt.snapshot_timestamp_strategy": {"unique_id": "macro.dbt.snapshot_timestamp_strategy", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshot/strategies.sql", "original_file_path": "macros/materializations/snapshot/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/fishtown-analytics/dbt/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": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt.snapshot_string_as_time": {"unique_id": "macro.dbt.snapshot_string_as_time", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshot/strategies.sql", "original_file_path": "macros/materializations/snapshot/strategies.sql", "name": "snapshot_string_as_time", "macro_sql": "{% macro snapshot_string_as_time(timestamp) -%}\n {{ adapter.dispatch('snapshot_string_as_time')(timestamp) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt.default__snapshot_string_as_time": {"unique_id": "macro.dbt.default__snapshot_string_as_time", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshot/strategies.sql", "original_file_path": "macros/materializations/snapshot/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": []}, "macro.dbt.snapshot_check_all_get_existing_columns": {"unique_id": "macro.dbt.snapshot_check_all_get_existing_columns", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshot/strategies.sql", "original_file_path": "macros/materializations/snapshot/strategies.sql", "name": "snapshot_check_all_get_existing_columns", "macro_sql": "{% macro snapshot_check_all_get_existing_columns(node, target_exists) -%}\n {%- set query_columns = get_columns_in_query(node['compiled_sql']) -%}\n {%- if not target_exists -%}\n {# no table yet -> return whatever the query does #}\n {{ return([false, query_columns]) }}\n {%- endif -%}\n {# handle any schema changes #}\n {%- set target_table = node.get('alias', node.get('name')) -%}\n {%- set target_relation = adapter.get_relation(database=node.database, schema=node.schema, identifier=target_table) -%}\n {%- set existing_cols = get_columns_in_query('select * from ' ~ target_relation) -%}\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(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": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt.snapshot_check_strategy": {"unique_id": "macro.dbt.snapshot_check_strategy", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshot/strategies.sql", "original_file_path": "macros/materializations/snapshot/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 \n {% set select_current_time -%}\n select {{ snapshot_get_time() }} as snapshot_start\n {%- endset %}\n\n {#-- don't access the column by name, to avoid dealing with casing issues on snowflake #}\n {%- set now = run_query(select_current_time)[0][0] -%}\n {% if now is none or now is undefined -%}\n {%- do exceptions.raise_compiler_error('Could not get a snapshot start time from the database') -%}\n {%- endif %}\n {% set updated_at = snapshot_string_as_time(now) %}\n\n {% set column_added = false %}\n\n {% if check_cols_config == 'all' %}\n {% set column_added, check_cols = snapshot_check_all_get_existing_columns(node, target_exists) %}\n {% elif check_cols_config is iterable and (check_cols_config | length) > 0 %}\n {% set check_cols = check_cols_config %}\n {% else %}\n {% do exceptions.raise_compiler_error(\"Invalid value for 'check_cols': \" ~ check_cols_config) %}\n {% endif %}\n\n {%- set row_changed_expr -%}\n (\n {%- if column_added -%}\n TRUE\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": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt.create_columns": {"unique_id": "macro.dbt.create_columns", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshot/snapshot.sql", "original_file_path": "macros/materializations/snapshot/snapshot.sql", "name": "create_columns", "macro_sql": "{% macro create_columns(relation, columns) %}\n {{ adapter.dispatch('create_columns')(relation, columns) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt.default__create_columns": {"unique_id": "macro.dbt.default__create_columns", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshot/snapshot.sql", "original_file_path": "macros/materializations/snapshot/snapshot.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": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt.post_snapshot": {"unique_id": "macro.dbt.post_snapshot", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshot/snapshot.sql", "original_file_path": "macros/materializations/snapshot/snapshot.sql", "name": "post_snapshot", "macro_sql": "{% macro post_snapshot(staging_relation) %}\n {{ adapter.dispatch('post_snapshot')(staging_relation) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt.default__post_snapshot": {"unique_id": "macro.dbt.default__post_snapshot", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshot/snapshot.sql", "original_file_path": "macros/materializations/snapshot/snapshot.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": []}, "macro.dbt.snapshot_staging_table": {"unique_id": "macro.dbt.snapshot_staging_table", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshot/snapshot.sql", "original_file_path": "macros/materializations/snapshot/snapshot.sql", "name": "snapshot_staging_table", "macro_sql": "{% macro 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": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt.build_snapshot_table": {"unique_id": "macro.dbt.build_snapshot_table", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshot/snapshot.sql", "original_file_path": "macros/materializations/snapshot/snapshot.sql", "name": "build_snapshot_table", "macro_sql": "{% macro 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": []}, "macro.dbt.get_or_create_relation": {"unique_id": "macro.dbt.get_or_create_relation", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshot/snapshot.sql", "original_file_path": "macros/materializations/snapshot/snapshot.sql", "name": "get_or_create_relation", "macro_sql": "{% macro 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": []}, "macro.dbt.build_snapshot_staging_table": {"unique_id": "macro.dbt.build_snapshot_staging_table", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshot/snapshot.sql", "original_file_path": "macros/materializations/snapshot/snapshot.sql", "name": "build_snapshot_staging_table", "macro_sql": "{% macro build_snapshot_staging_table(strategy, sql, target_relation) %}\n {% set tmp_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, tmp_relation, select) }}\n {% endcall %}\n\n {% do return(tmp_relation) %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt.materialization_snapshot_default": {"unique_id": "macro.dbt.materialization_snapshot_default", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshot/snapshot.sql", "original_file_path": "macros/materializations/snapshot/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\n {% if not adapter.check_schema_exists(model.database, model.schema) %}\n {% do create_schema(model.database, model.schema) %}\n {% endif %}\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 {% do persist_docs(target_relation, model) %}\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": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt.create_csv_table": {"unique_id": "macro.dbt.create_csv_table", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/dbt/include/global_project", "path": "macros/materializations/seed/seed.sql", "original_file_path": "macros/materializations/seed/seed.sql", "name": "create_csv_table", "macro_sql": "{% macro create_csv_table(model, agate_table) -%}\n {{ adapter.dispatch('create_csv_table')(model, agate_table) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt.reset_csv_table": {"unique_id": "macro.dbt.reset_csv_table", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/dbt/include/global_project", "path": "macros/materializations/seed/seed.sql", "original_file_path": "macros/materializations/seed/seed.sql", "name": "reset_csv_table", "macro_sql": "{% macro reset_csv_table(model, full_refresh, old_relation, agate_table) -%}\n {{ adapter.dispatch('reset_csv_table')(model, full_refresh, old_relation, agate_table) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt.load_csv_rows": {"unique_id": "macro.dbt.load_csv_rows", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/dbt/include/global_project", "path": "macros/materializations/seed/seed.sql", "original_file_path": "macros/materializations/seed/seed.sql", "name": "load_csv_rows", "macro_sql": "{% macro load_csv_rows(model, agate_table) -%}\n {{ adapter.dispatch('load_csv_rows')(model, agate_table) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt.default__create_csv_table": {"unique_id": "macro.dbt.default__create_csv_table", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/dbt/include/global_project", "path": "macros/materializations/seed/seed.sql", "original_file_path": "macros/materializations/seed/seed.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": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt.default__reset_csv_table": {"unique_id": "macro.dbt.default__reset_csv_table", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/dbt/include/global_project", "path": "macros/materializations/seed/seed.sql", "original_file_path": "macros/materializations/seed/seed.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": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt.get_seed_column_quoted_csv": {"unique_id": "macro.dbt.get_seed_column_quoted_csv", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/dbt/include/global_project", "path": "macros/materializations/seed/seed.sql", "original_file_path": "macros/materializations/seed/seed.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": []}, "macro.dbt.basic_load_csv_rows": {"unique_id": "macro.dbt.basic_load_csv_rows", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/dbt/include/global_project", "path": "macros/materializations/seed/seed.sql", "original_file_path": "macros/materializations/seed/seed.sql", "name": "basic_load_csv_rows", "macro_sql": "{% macro basic_load_csv_rows(model, batch_size, agate_table) %}\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 %s\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": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt.default__load_csv_rows": {"unique_id": "macro.dbt.default__load_csv_rows", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/dbt/include/global_project", "path": "macros/materializations/seed/seed.sql", "original_file_path": "macros/materializations/seed/seed.sql", "name": "default__load_csv_rows", "macro_sql": "{% macro default__load_csv_rows(model, agate_table) %}\n {{ return(basic_load_csv_rows(model, 10000, agate_table) )}}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt.materialization_seed_default": {"unique_id": "macro.dbt.materialization_seed_default", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/dbt/include/global_project", "path": "macros/materializations/seed/seed.sql", "original_file_path": "macros/materializations/seed/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 agate_table = load_agate_table() -%}\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 {{ create_table_sql }};\n -- dbt seed --\n {{ sql }}\n {% endcall %}\n\n {% set target_relation = this.incorporate(type='table') %}\n {% do persist_docs(target_relation, model) %}\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": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt.incremental_upsert": {"unique_id": "macro.dbt.incremental_upsert", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/dbt/include/global_project", "path": "macros/materializations/incremental/helpers.sql", "original_file_path": "macros/materializations/incremental/helpers.sql", "name": "incremental_upsert", "macro_sql": "{% macro incremental_upsert(tmp_relation, target_relation, unique_key=none, statement_name=\"main\") %}\n {%- set dest_columns = adapter.get_columns_in_relation(target_relation) -%}\n {%- set dest_cols_csv = dest_columns | map(attribute='quoted') | join(', ') -%}\n\n {%- if unique_key is not none -%}\n delete\n from {{ target_relation }}\n where ({{ unique_key }}) in (\n select ({{ unique_key }})\n from {{ tmp_relation }}\n );\n {%- endif %}\n\n insert into {{ target_relation }} ({{ dest_cols_csv }})\n (\n select {{ dest_cols_csv }}\n from {{ tmp_relation }}\n );\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt.materialization_incremental_default": {"unique_id": "macro.dbt.materialization_incremental_default", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/dbt/include/global_project", "path": "macros/materializations/incremental/incremental.sql", "original_file_path": "macros/materializations/incremental/incremental.sql", "name": "materialization_incremental_default", "macro_sql": "{% materialization incremental, default -%}\n\n {% set unique_key = config.get('unique_key') %}\n\n {% set target_relation = this.incorporate(type='table') %}\n {% set existing_relation = load_relation(this) %}\n {% set tmp_relation = make_temp_relation(this) %}\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 {% if existing_relation is none %}\n {% set build_sql = create_table_as(False, target_relation, sql) %}\n {% elif existing_relation.is_view or should_full_refresh() %}\n {#-- Make sure the backup doesn't exist so we don't encounter issues with the rename below #}\n {% set backup_identifier = existing_relation.identifier ~ \"__dbt_backup\" %}\n {% set backup_relation = existing_relation.incorporate(path={\"identifier\": backup_identifier}) %}\n {% do adapter.drop_relation(backup_relation) %}\n\n {% do adapter.rename_relation(target_relation, backup_relation) %}\n {% set build_sql = create_table_as(False, target_relation, sql) %}\n {% do to_drop.append(backup_relation) %}\n {% else %}\n {% set tmp_relation = make_temp_relation(target_relation) %}\n {% do run_query(create_table_as(True, tmp_relation, sql)) %}\n {% do adapter.expand_target_column_types(\n from_relation=tmp_relation,\n to_relation=target_relation) %}\n {% set build_sql = incremental_upsert(tmp_relation, target_relation, unique_key=unique_key) %}\n {% endif %}\n\n {% call statement(\"main\") %}\n {{ build_sql }}\n {% endcall %}\n\n {% do persist_docs(target_relation, model) %}\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": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt.get_merge_sql": {"unique_id": "macro.dbt.get_merge_sql", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/dbt/include/global_project", "path": "macros/materializations/common/merge.sql", "original_file_path": "macros/materializations/common/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')(target, source, unique_key, dest_columns, predicates) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt.get_delete_insert_merge_sql": {"unique_id": "macro.dbt.get_delete_insert_merge_sql", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/dbt/include/global_project", "path": "macros/materializations/common/merge.sql", "original_file_path": "macros/materializations/common/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')(target, source, unique_key, dest_columns) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt.get_insert_overwrite_merge_sql": {"unique_id": "macro.dbt.get_insert_overwrite_merge_sql", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/dbt/include/global_project", "path": "macros/materializations/common/merge.sql", "original_file_path": "macros/materializations/common/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')(target, source, dest_columns, predicates, include_sql_header) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt.default__get_merge_sql": {"unique_id": "macro.dbt.default__get_merge_sql", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/dbt/include/global_project", "path": "macros/materializations/common/merge.sql", "original_file_path": "macros/materializations/common/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 sql_header = config.get('sql_header', none) -%}\n\n {% if unique_key %}\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 {% 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 in dest_columns -%}\n {{ adapter.quote(column.name) }} = DBT_INTERNAL_SOURCE.{{ adapter.quote(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": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt.get_quoted_csv": {"unique_id": "macro.dbt.get_quoted_csv", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/dbt/include/global_project", "path": "macros/materializations/common/merge.sql", "original_file_path": "macros/materializations/common/merge.sql", "name": "get_quoted_csv", "macro_sql": "{% macro get_quoted_csv(column_names) %}\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{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt.common_get_delete_insert_merge_sql": {"unique_id": "macro.dbt.common_get_delete_insert_merge_sql", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/dbt/include/global_project", "path": "macros/materializations/common/merge.sql", "original_file_path": "macros/materializations/common/merge.sql", "name": "common_get_delete_insert_merge_sql", "macro_sql": "{% macro common_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 is not none %}\n delete from {{ target }}\n where ({{ unique_key }}) in (\n select ({{ unique_key }})\n from {{ source }}\n );\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": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt.default__get_delete_insert_merge_sql": {"unique_id": "macro.dbt.default__get_delete_insert_merge_sql", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/dbt/include/global_project", "path": "macros/materializations/common/merge.sql", "original_file_path": "macros/materializations/common/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 {{ common_get_delete_insert_merge_sql(target, source, unique_key, dest_columns) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt.default__get_insert_overwrite_merge_sql": {"unique_id": "macro.dbt.default__get_insert_overwrite_merge_sql", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/dbt/include/global_project", "path": "macros/materializations/common/merge.sql", "original_file_path": "macros/materializations/common/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": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt.materialization_table_default": {"unique_id": "macro.dbt.materialization_table_default", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/dbt/include/global_project", "path": "macros/materializations/table/table.sql", "original_file_path": "macros/materializations/table/table.sql", "name": "materialization_table_default", "macro_sql": "{% materialization table, default %}\n {%- set identifier = model['alias'] -%}\n {%- set tmp_identifier = model['name'] + '__dbt_tmp' -%}\n {%- set backup_identifier = model['name'] + '__dbt_backup' -%}\n\n {%- set old_relation = adapter.get_relation(database=database, schema=schema, identifier=identifier) -%}\n {%- set target_relation = api.Relation.create(identifier=identifier,\n schema=schema,\n database=database,\n type='table') -%}\n {%- set intermediate_relation = api.Relation.create(identifier=tmp_identifier,\n schema=schema,\n database=database,\n type='table') -%}\n\n /*\n See ../view/view.sql for more information about this relation.\n */\n {%- set backup_relation_type = 'table' if old_relation is none else old_relation.type -%}\n {%- set backup_relation = api.Relation.create(identifier=backup_identifier,\n schema=schema,\n database=database,\n type=backup_relation_type) -%}\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\n -- drop the temp relations if they exists for some reason\n {{ adapter.drop_relation(intermediate_relation) }}\n {{ adapter.drop_relation(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 {{ create_table_as(False, intermediate_relation, sql) }}\n {%- endcall %}\n\n -- cleanup\n {% if old_relation is not none %}\n {{ adapter.rename_relation(target_relation, backup_relation) }}\n {% endif %}\n\n {{ adapter.rename_relation(intermediate_relation, target_relation) }}\n\n {{ run_hooks(post_hooks, inside_transaction=True) }}\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": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt.materialization_view_default": {"unique_id": "macro.dbt.materialization_view_default", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/dbt/include/global_project", "path": "macros/materializations/view/view.sql", "original_file_path": "macros/materializations/view/view.sql", "name": "materialization_view_default", "macro_sql": "{%- materialization view, default -%}\n\n {%- set identifier = model['alias'] -%}\n {%- set tmp_identifier = model['name'] + '__dbt_tmp' -%}\n {%- set backup_identifier = model['name'] + '__dbt_backup' -%}\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, database=database,\n type='view') -%}\n {%- set intermediate_relation = api.Relation.create(identifier=tmp_identifier,\n schema=schema, database=database, type='view') -%}\n\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 \"old_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 old_relation, if it exists,\n or else \"view\" as a sane default if it does not. Note that if the old_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 old_relation is none else old_relation.type -%}\n {%- set backup_relation = api.Relation.create(identifier=backup_identifier,\n schema=schema, database=database,\n type=backup_relation_type) -%}\n\n {%- set exists_as_view = (old_relation is not none and old_relation.is_view) -%}\n\n {{ run_hooks(pre_hooks, inside_transaction=False) }}\n\n -- drop the temp relations if they exists for some reason\n {{ adapter.drop_relation(intermediate_relation) }}\n {{ adapter.drop_relation(backup_relation) }}\n\n -- `BEGIN` happens here:\n {{ run_hooks(pre_hooks, inside_transaction=True) }}\n\n -- build model\n {% call statement('main') -%}\n {{ create_view_as(intermediate_relation, sql) }}\n {%- endcall %}\n\n -- cleanup\n -- move the existing view out of the way\n {% if old_relation is not none %}\n {{ adapter.rename_relation(target_relation, backup_relation) }}\n {% endif %}\n {{ adapter.rename_relation(intermediate_relation, target_relation) }}\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": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt.handle_existing_table": {"unique_id": "macro.dbt.handle_existing_table", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/dbt/include/global_project", "path": "macros/materializations/view/create_or_replace_view.sql", "original_file_path": "macros/materializations/view/create_or_replace_view.sql", "name": "handle_existing_table", "macro_sql": "{% macro handle_existing_table(full_refresh, old_relation) %}\n {{ adapter.dispatch(\"handle_existing_table\", packages=['dbt'])(full_refresh, old_relation) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt.default__handle_existing_table": {"unique_id": "macro.dbt.default__handle_existing_table", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/dbt/include/global_project", "path": "macros/materializations/view/create_or_replace_view.sql", "original_file_path": "macros/materializations/view/create_or_replace_view.sql", "name": "default__handle_existing_table", "macro_sql": "{% macro default__handle_existing_table(full_refresh, old_relation) %}\n {{ adapter.drop_relation(old_relation) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt.create_or_replace_view": {"unique_id": "macro.dbt.create_or_replace_view", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/dbt/include/global_project", "path": "macros/materializations/view/create_or_replace_view.sql", "original_file_path": "macros/materializations/view/create_or_replace_view.sql", "name": "create_or_replace_view", "macro_sql": "{% macro create_or_replace_view(run_outside_transaction_hooks=True) %}\n {%- set identifier = model['alias'] -%}\n\n {%- set old_relation = adapter.get_relation(database=database, schema=schema, identifier=identifier) -%}\n\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\n {% if run_outside_transaction_hooks %}\n -- no transactions on BigQuery\n {{ run_hooks(pre_hooks, inside_transaction=False) }}\n {% endif %}\n\n -- `BEGIN` happens here on Snowflake\n {{ run_hooks(pre_hooks, inside_transaction=True) }}\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 {{ create_view_as(target_relation, sql) }}\n {%- endcall %}\n\n {{ run_hooks(post_hooks, inside_transaction=True) }}\n\n {{ adapter.commit() }}\n\n {% if run_outside_transaction_hooks %}\n -- No transactions on BigQuery\n {{ run_hooks(post_hooks, inside_transaction=False) }}\n {% endif %}\n\n {{ return({'relations': [target_relation]}) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt.generate_alias_name": {"unique_id": "macro.dbt.generate_alias_name", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/dbt/include/global_project", "path": "macros/etc/get_custom_alias.sql", "original_file_path": "macros/etc/get_custom_alias.sql", "name": "generate_alias_name", "macro_sql": "{% macro 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": []}, "macro.dbt.run_query": {"unique_id": "macro.dbt.run_query", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/dbt/include/global_project", "path": "macros/etc/query.sql", "original_file_path": "macros/etc/query.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": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt.is_incremental": {"unique_id": "macro.dbt.is_incremental", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/dbt/include/global_project", "path": "macros/etc/is_incremental.sql", "original_file_path": "macros/etc/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": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt.convert_datetime": {"unique_id": "macro.dbt.convert_datetime", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/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": []}, "macro.dbt.dates_in_range": {"unique_id": "macro.dbt.dates_in_range", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/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": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt.partition_range": {"unique_id": "macro.dbt.partition_range", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/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": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt.py_current_timestring": {"unique_id": "macro.dbt.py_current_timestring", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/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": []}, "macro.dbt.generate_schema_name": {"unique_id": "macro.dbt.generate_schema_name", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/dbt/include/global_project", "path": "macros/etc/get_custom_schema.sql", "original_file_path": "macros/etc/get_custom_schema.sql", "name": "generate_schema_name", "macro_sql": "{% macro 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": []}, "macro.dbt.generate_schema_name_for_env": {"unique_id": "macro.dbt.generate_schema_name_for_env", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/dbt/include/global_project", "path": "macros/etc/get_custom_schema.sql", "original_file_path": "macros/etc/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": []}, "macro.dbt.generate_database_name": {"unique_id": "macro.dbt.generate_database_name", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/dbt/include/global_project", "path": "macros/etc/get_custom_database.sql", "original_file_path": "macros/etc/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')(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": []}, "macro.dbt.default__generate_database_name": {"unique_id": "macro.dbt.default__generate_database_name", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/dbt/include/global_project", "path": "macros/etc/get_custom_database.sql", "original_file_path": "macros/etc/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": []}, "macro.dbt.get_columns_in_query": {"unique_id": "macro.dbt.get_columns_in_query", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/dbt/include/global_project", "path": "macros/adapters/common.sql", "original_file_path": "macros/adapters/common.sql", "name": "get_columns_in_query", "macro_sql": "{% macro get_columns_in_query(select_sql) -%}\n {{ return(adapter.dispatch('get_columns_in_query')(select_sql)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt.default__get_columns_in_query": {"unique_id": "macro.dbt.default__get_columns_in_query", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/dbt/include/global_project", "path": "macros/adapters/common.sql", "original_file_path": "macros/adapters/common.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": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt.create_schema": {"unique_id": "macro.dbt.create_schema", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/dbt/include/global_project", "path": "macros/adapters/common.sql", "original_file_path": "macros/adapters/common.sql", "name": "create_schema", "macro_sql": "{% macro create_schema(relation) -%}\n {{ adapter.dispatch('create_schema')(relation) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt.default__create_schema": {"unique_id": "macro.dbt.default__create_schema", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/dbt/include/global_project", "path": "macros/adapters/common.sql", "original_file_path": "macros/adapters/common.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": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt.drop_schema": {"unique_id": "macro.dbt.drop_schema", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/dbt/include/global_project", "path": "macros/adapters/common.sql", "original_file_path": "macros/adapters/common.sql", "name": "drop_schema", "macro_sql": "{% macro drop_schema(relation) -%}\n {{ adapter.dispatch('drop_schema')(relation) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt.default__drop_schema": {"unique_id": "macro.dbt.default__drop_schema", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/dbt/include/global_project", "path": "macros/adapters/common.sql", "original_file_path": "macros/adapters/common.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": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt.create_table_as": {"unique_id": "macro.dbt.create_table_as", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/dbt/include/global_project", "path": "macros/adapters/common.sql", "original_file_path": "macros/adapters/common.sql", "name": "create_table_as", "macro_sql": "{% macro create_table_as(temporary, relation, sql) -%}\n {{ adapter.dispatch('create_table_as')(temporary, relation, sql) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt.default__create_table_as": {"unique_id": "macro.dbt.default__create_table_as", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/dbt/include/global_project", "path": "macros/adapters/common.sql", "original_file_path": "macros/adapters/common.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\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt.create_view_as": {"unique_id": "macro.dbt.create_view_as", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/dbt/include/global_project", "path": "macros/adapters/common.sql", "original_file_path": "macros/adapters/common.sql", "name": "create_view_as", "macro_sql": "{% macro create_view_as(relation, sql) -%}\n {{ adapter.dispatch('create_view_as')(relation, sql) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt.default__create_view_as": {"unique_id": "macro.dbt.default__create_view_as", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/dbt/include/global_project", "path": "macros/adapters/common.sql", "original_file_path": "macros/adapters/common.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": []}, "macro.dbt.get_catalog": {"unique_id": "macro.dbt.get_catalog", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/dbt/include/global_project", "path": "macros/adapters/common.sql", "original_file_path": "macros/adapters/common.sql", "name": "get_catalog", "macro_sql": "{% macro get_catalog(information_schema, schemas) -%}\n {{ return(adapter.dispatch('get_catalog')(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": []}, "macro.dbt.default__get_catalog": {"unique_id": "macro.dbt.default__get_catalog", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/dbt/include/global_project", "path": "macros/adapters/common.sql", "original_file_path": "macros/adapters/common.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": []}, "macro.dbt.get_columns_in_relation": {"unique_id": "macro.dbt.get_columns_in_relation", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/dbt/include/global_project", "path": "macros/adapters/common.sql", "original_file_path": "macros/adapters/common.sql", "name": "get_columns_in_relation", "macro_sql": "{% macro get_columns_in_relation(relation) -%}\n {{ return(adapter.dispatch('get_columns_in_relation')(relation)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt.sql_convert_columns_in_relation": {"unique_id": "macro.dbt.sql_convert_columns_in_relation", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/dbt/include/global_project", "path": "macros/adapters/common.sql", "original_file_path": "macros/adapters/common.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": []}, "macro.dbt.default__get_columns_in_relation": {"unique_id": "macro.dbt.default__get_columns_in_relation", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/dbt/include/global_project", "path": "macros/adapters/common.sql", "original_file_path": "macros/adapters/common.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": []}, "macro.dbt.alter_column_type": {"unique_id": "macro.dbt.alter_column_type", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/dbt/include/global_project", "path": "macros/adapters/common.sql", "original_file_path": "macros/adapters/common.sql", "name": "alter_column_type", "macro_sql": "{% macro alter_column_type(relation, column_name, new_column_type) -%}\n {{ return(adapter.dispatch('alter_column_type')(relation, column_name, new_column_type)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt.alter_column_comment": {"unique_id": "macro.dbt.alter_column_comment", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/dbt/include/global_project", "path": "macros/adapters/common.sql", "original_file_path": "macros/adapters/common.sql", "name": "alter_column_comment", "macro_sql": "{% macro alter_column_comment(relation, column_dict) -%}\n {{ return(adapter.dispatch('alter_column_comment')(relation, column_dict)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt.default__alter_column_comment": {"unique_id": "macro.dbt.default__alter_column_comment", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/dbt/include/global_project", "path": "macros/adapters/common.sql", "original_file_path": "macros/adapters/common.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": []}, "macro.dbt.alter_relation_comment": {"unique_id": "macro.dbt.alter_relation_comment", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/dbt/include/global_project", "path": "macros/adapters/common.sql", "original_file_path": "macros/adapters/common.sql", "name": "alter_relation_comment", "macro_sql": "{% macro alter_relation_comment(relation, relation_comment) -%}\n {{ return(adapter.dispatch('alter_relation_comment')(relation, relation_comment)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt.default__alter_relation_comment": {"unique_id": "macro.dbt.default__alter_relation_comment", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/dbt/include/global_project", "path": "macros/adapters/common.sql", "original_file_path": "macros/adapters/common.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": []}, "macro.dbt.persist_docs": {"unique_id": "macro.dbt.persist_docs", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/dbt/include/global_project", "path": "macros/adapters/common.sql", "original_file_path": "macros/adapters/common.sql", "name": "persist_docs", "macro_sql": "{% macro persist_docs(relation, model, for_relation=true, for_columns=true) -%}\n {{ return(adapter.dispatch('persist_docs')(relation, model, for_relation, for_columns)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt.default__persist_docs": {"unique_id": "macro.dbt.default__persist_docs", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/dbt/include/global_project", "path": "macros/adapters/common.sql", "original_file_path": "macros/adapters/common.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": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt.default__alter_column_type": {"unique_id": "macro.dbt.default__alter_column_type", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/dbt/include/global_project", "path": "macros/adapters/common.sql", "original_file_path": "macros/adapters/common.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": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt.drop_relation": {"unique_id": "macro.dbt.drop_relation", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/dbt/include/global_project", "path": "macros/adapters/common.sql", "original_file_path": "macros/adapters/common.sql", "name": "drop_relation", "macro_sql": "{% macro drop_relation(relation) -%}\n {{ return(adapter.dispatch('drop_relation')(relation)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt.default__drop_relation": {"unique_id": "macro.dbt.default__drop_relation", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/dbt/include/global_project", "path": "macros/adapters/common.sql", "original_file_path": "macros/adapters/common.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": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt.truncate_relation": {"unique_id": "macro.dbt.truncate_relation", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/dbt/include/global_project", "path": "macros/adapters/common.sql", "original_file_path": "macros/adapters/common.sql", "name": "truncate_relation", "macro_sql": "{% macro truncate_relation(relation) -%}\n {{ return(adapter.dispatch('truncate_relation')(relation)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt.default__truncate_relation": {"unique_id": "macro.dbt.default__truncate_relation", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/dbt/include/global_project", "path": "macros/adapters/common.sql", "original_file_path": "macros/adapters/common.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": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt.rename_relation": {"unique_id": "macro.dbt.rename_relation", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/dbt/include/global_project", "path": "macros/adapters/common.sql", "original_file_path": "macros/adapters/common.sql", "name": "rename_relation", "macro_sql": "{% macro rename_relation(from_relation, to_relation) -%}\n {{ return(adapter.dispatch('rename_relation')(from_relation, to_relation)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt.default__rename_relation": {"unique_id": "macro.dbt.default__rename_relation", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/dbt/include/global_project", "path": "macros/adapters/common.sql", "original_file_path": "macros/adapters/common.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": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt.information_schema_name": {"unique_id": "macro.dbt.information_schema_name", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/dbt/include/global_project", "path": "macros/adapters/common.sql", "original_file_path": "macros/adapters/common.sql", "name": "information_schema_name", "macro_sql": "{% macro information_schema_name(database) %}\n {{ return(adapter.dispatch('information_schema_name')(database)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt.default__information_schema_name": {"unique_id": "macro.dbt.default__information_schema_name", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/dbt/include/global_project", "path": "macros/adapters/common.sql", "original_file_path": "macros/adapters/common.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": []}, "macro.dbt.list_schemas": {"unique_id": "macro.dbt.list_schemas", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/dbt/include/global_project", "path": "macros/adapters/common.sql", "original_file_path": "macros/adapters/common.sql", "name": "list_schemas", "macro_sql": "{% macro list_schemas(database) -%}\n {{ return(adapter.dispatch('list_schemas')(database)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt.default__list_schemas": {"unique_id": "macro.dbt.default__list_schemas", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/dbt/include/global_project", "path": "macros/adapters/common.sql", "original_file_path": "macros/adapters/common.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": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt.check_schema_exists": {"unique_id": "macro.dbt.check_schema_exists", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/dbt/include/global_project", "path": "macros/adapters/common.sql", "original_file_path": "macros/adapters/common.sql", "name": "check_schema_exists", "macro_sql": "{% macro check_schema_exists(information_schema, schema) -%}\n {{ return(adapter.dispatch('check_schema_exists')(information_schema, schema)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt.default__check_schema_exists": {"unique_id": "macro.dbt.default__check_schema_exists", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/dbt/include/global_project", "path": "macros/adapters/common.sql", "original_file_path": "macros/adapters/common.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": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt.list_relations_without_caching": {"unique_id": "macro.dbt.list_relations_without_caching", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/dbt/include/global_project", "path": "macros/adapters/common.sql", "original_file_path": "macros/adapters/common.sql", "name": "list_relations_without_caching", "macro_sql": "{% macro list_relations_without_caching(schema_relation) %}\n {{ return(adapter.dispatch('list_relations_without_caching')(schema_relation)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt.default__list_relations_without_caching": {"unique_id": "macro.dbt.default__list_relations_without_caching", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/dbt/include/global_project", "path": "macros/adapters/common.sql", "original_file_path": "macros/adapters/common.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": []}, "macro.dbt.current_timestamp": {"unique_id": "macro.dbt.current_timestamp", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/dbt/include/global_project", "path": "macros/adapters/common.sql", "original_file_path": "macros/adapters/common.sql", "name": "current_timestamp", "macro_sql": "{% macro current_timestamp() -%}\n {{ adapter.dispatch('current_timestamp')() }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt.default__current_timestamp": {"unique_id": "macro.dbt.default__current_timestamp", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/dbt/include/global_project", "path": "macros/adapters/common.sql", "original_file_path": "macros/adapters/common.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": []}, "macro.dbt.collect_freshness": {"unique_id": "macro.dbt.collect_freshness", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/dbt/include/global_project", "path": "macros/adapters/common.sql", "original_file_path": "macros/adapters/common.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": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt.default__collect_freshness": {"unique_id": "macro.dbt.default__collect_freshness", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/dbt/include/global_project", "path": "macros/adapters/common.sql", "original_file_path": "macros/adapters/common.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": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt.make_temp_relation": {"unique_id": "macro.dbt.make_temp_relation", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/dbt/include/global_project", "path": "macros/adapters/common.sql", "original_file_path": "macros/adapters/common.sql", "name": "make_temp_relation", "macro_sql": "{% macro make_temp_relation(base_relation, suffix='__dbt_tmp') %}\n {{ return(adapter.dispatch('make_temp_relation')(base_relation, suffix))}}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt.default__make_temp_relation": {"unique_id": "macro.dbt.default__make_temp_relation", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/dbt/include/global_project", "path": "macros/adapters/common.sql", "original_file_path": "macros/adapters/common.sql", "name": "default__make_temp_relation", "macro_sql": "{% macro default__make_temp_relation(base_relation, suffix) %}\n {% set tmp_identifier = base_relation.identifier ~ suffix %}\n {% set tmp_relation = base_relation.incorporate(\n path={\"identifier\": tmp_identifier}) -%}\n\n {% do return(tmp_relation) %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt.set_sql_header": {"unique_id": "macro.dbt.set_sql_header", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/dbt/include/global_project", "path": "macros/adapters/common.sql", "original_file_path": "macros/adapters/common.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": []}, "macro.dbt.default__test_relationships": {"unique_id": "macro.dbt.default__test_relationships", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/dbt/include/global_project", "path": "macros/schema_tests/relationships.sql", "original_file_path": "macros/schema_tests/relationships.sql", "name": "default__test_relationships", "macro_sql": "{% macro default__test_relationships(model, to, field) %}\n\n{% set column_name = kwargs.get('column_name', kwargs.get('from')) %}\n\n\nselect count(*) as validation_errors\nfrom (\n select {{ column_name }} as id from {{ model }}\n) as child\nleft join (\n select {{ field }} as id from {{ to }}\n) as parent on parent.id = child.id\nwhere child.id is not null\n and parent.id is null\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt.test_relationships": {"unique_id": "macro.dbt.test_relationships", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/dbt/include/global_project", "path": "macros/schema_tests/relationships.sql", "original_file_path": "macros/schema_tests/relationships.sql", "name": "test_relationships", "macro_sql": "{% macro test_relationships(model, to, field) %}\n {% set macro = adapter.dispatch('test_relationships') %}\n {{ macro(model, to, field, **kwargs) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt.default__test_not_null": {"unique_id": "macro.dbt.default__test_not_null", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/dbt/include/global_project", "path": "macros/schema_tests/not_null.sql", "original_file_path": "macros/schema_tests/not_null.sql", "name": "default__test_not_null", "macro_sql": "{% macro default__test_not_null(model) %}\n\n{% set column_name = kwargs.get('column_name', kwargs.get('arg')) %}\n\nselect count(*) as validation_errors\nfrom {{ model }}\nwhere {{ column_name }} is null\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt.test_not_null": {"unique_id": "macro.dbt.test_not_null", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/dbt/include/global_project", "path": "macros/schema_tests/not_null.sql", "original_file_path": "macros/schema_tests/not_null.sql", "name": "test_not_null", "macro_sql": "{% macro test_not_null(model) %}\n {% set macro = adapter.dispatch('test_not_null') %}\n {{ macro(model, **kwargs) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt.default__test_unique": {"unique_id": "macro.dbt.default__test_unique", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/dbt/include/global_project", "path": "macros/schema_tests/unique.sql", "original_file_path": "macros/schema_tests/unique.sql", "name": "default__test_unique", "macro_sql": "{% macro default__test_unique(model) %}\n\n{% set column_name = kwargs.get('column_name', kwargs.get('arg')) %}\n\nselect count(*) as validation_errors\nfrom (\n\n select\n {{ column_name }}\n\n from {{ model }}\n where {{ column_name }} is not null\n group by {{ column_name }}\n having count(*) > 1\n\n) validation_errors\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt.test_unique": {"unique_id": "macro.dbt.test_unique", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/dbt/include/global_project", "path": "macros/schema_tests/unique.sql", "original_file_path": "macros/schema_tests/unique.sql", "name": "test_unique", "macro_sql": "{% macro test_unique(model) %}\n {% set macro = adapter.dispatch('test_unique') %}\n {{ macro(model, **kwargs) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt.default__test_accepted_values": {"unique_id": "macro.dbt.default__test_accepted_values", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/dbt/include/global_project", "path": "macros/schema_tests/accepted_values.sql", "original_file_path": "macros/schema_tests/accepted_values.sql", "name": "default__test_accepted_values", "macro_sql": "{% macro default__test_accepted_values(model, values) %}\n\n{% set column_name = kwargs.get('column_name', kwargs.get('field')) %}\n{% set quote_values = kwargs.get('quote', True) %}\n\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 not in (\n {% for value in values -%}\n {% if quote_values -%}\n '{{ value }}'\n {%- else -%}\n {{ value }}\n {%- endif -%}\n {%- if not loop.last -%},{%- endif %}\n {%- endfor %}\n )\n)\n\nselect count(*) as validation_errors\nfrom validation_errors\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt.test_accepted_values": {"unique_id": "macro.dbt.test_accepted_values", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/dbt/include/global_project", "path": "macros/schema_tests/accepted_values.sql", "original_file_path": "macros/schema_tests/accepted_values.sql", "name": "test_accepted_values", "macro_sql": "{% macro test_accepted_values(model, values) %}\n {% set macro = adapter.dispatch('test_accepted_values') %}\n {{ macro(model, values, **kwargs) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt_utils.except": {"unique_id": "macro.dbt_utils.except", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Asana/dbt_asana/integration_tests/dbt_modules/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', packages = dbt_utils._get_utils_namespaces())()) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt_utils.default__except": {"unique_id": "macro.dbt_utils.default__except", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Asana/dbt_asana/integration_tests/dbt_modules/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": []}, "macro.dbt_utils.bigquery__except": {"unique_id": "macro.dbt_utils.bigquery__except", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Asana/dbt_asana/integration_tests/dbt_modules/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": []}, "macro.dbt_utils.replace": {"unique_id": "macro.dbt_utils.replace", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Asana/dbt_asana/integration_tests/dbt_modules/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', packages = dbt_utils._get_utils_namespaces()) (field, old_chars, new_chars)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt_utils.default__replace": {"unique_id": "macro.dbt_utils.default__replace", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Asana/dbt_asana/integration_tests/dbt_modules/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": []}, "macro.dbt_utils.concat": {"unique_id": "macro.dbt_utils.concat", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Asana/dbt_asana/integration_tests/dbt_modules/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', packages = dbt_utils._get_utils_namespaces())(fields)) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt_utils.default__concat": {"unique_id": "macro.dbt_utils.default__concat", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Asana/dbt_asana/integration_tests/dbt_modules/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 concat({{ fields|join(', ') }})\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt_utils.alternative_concat": {"unique_id": "macro.dbt_utils.alternative_concat", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Asana/dbt_asana/integration_tests/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/concat.sql", "original_file_path": "macros/cross_db_utils/concat.sql", "name": "alternative_concat", "macro_sql": "{% macro alternative_concat(fields) %}\n {{ fields|join(' || ') }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt_utils.redshift__concat": {"unique_id": "macro.dbt_utils.redshift__concat", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Asana/dbt_asana/integration_tests/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/concat.sql", "original_file_path": "macros/cross_db_utils/concat.sql", "name": "redshift__concat", "macro_sql": "{% macro redshift__concat(fields) %}\n {{ dbt_utils.alternative_concat(fields) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt_utils.snowflake__concat": {"unique_id": "macro.dbt_utils.snowflake__concat", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Asana/dbt_asana/integration_tests/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/concat.sql", "original_file_path": "macros/cross_db_utils/concat.sql", "name": "snowflake__concat", "macro_sql": "{% macro snowflake__concat(fields) %}\n {{ dbt_utils.alternative_concat(fields) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt_utils.type_string": {"unique_id": "macro.dbt_utils.type_string", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Asana/dbt_asana/integration_tests/dbt_modules/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', packages = dbt_utils._get_utils_namespaces())()) }}\n{%- endmacro -%}\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt_utils.default__type_string": {"unique_id": "macro.dbt_utils.default__type_string", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Asana/dbt_asana/integration_tests/dbt_modules/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": []}, "macro.dbt_utils.redshift__type_string": {"unique_id": "macro.dbt_utils.redshift__type_string", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Asana/dbt_asana/integration_tests/dbt_modules/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": []}, "macro.dbt_utils.postgres__type_string": {"unique_id": "macro.dbt_utils.postgres__type_string", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Asana/dbt_asana/integration_tests/dbt_modules/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": []}, "macro.dbt_utils.snowflake__type_string": {"unique_id": "macro.dbt_utils.snowflake__type_string", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Asana/dbt_asana/integration_tests/dbt_modules/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": []}, "macro.dbt_utils.type_timestamp": {"unique_id": "macro.dbt_utils.type_timestamp", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Asana/dbt_asana/integration_tests/dbt_modules/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', packages = dbt_utils._get_utils_namespaces())()) }}\n{%- endmacro -%}\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt_utils.default__type_timestamp": {"unique_id": "macro.dbt_utils.default__type_timestamp", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Asana/dbt_asana/integration_tests/dbt_modules/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": []}, "macro.dbt_utils.snowflake__type_timestamp": {"unique_id": "macro.dbt_utils.snowflake__type_timestamp", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Asana/dbt_asana/integration_tests/dbt_modules/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": []}, "macro.dbt_utils.type_float": {"unique_id": "macro.dbt_utils.type_float", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Asana/dbt_asana/integration_tests/dbt_modules/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', packages = dbt_utils._get_utils_namespaces())()) }}\n{%- endmacro -%}\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt_utils.default__type_float": {"unique_id": "macro.dbt_utils.default__type_float", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Asana/dbt_asana/integration_tests/dbt_modules/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": []}, "macro.dbt_utils.bigquery__type_float": {"unique_id": "macro.dbt_utils.bigquery__type_float", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Asana/dbt_asana/integration_tests/dbt_modules/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": []}, "macro.dbt_utils.type_numeric": {"unique_id": "macro.dbt_utils.type_numeric", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Asana/dbt_asana/integration_tests/dbt_modules/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', packages = dbt_utils._get_utils_namespaces())()) }}\n{%- endmacro -%}\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt_utils.default__type_numeric": {"unique_id": "macro.dbt_utils.default__type_numeric", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Asana/dbt_asana/integration_tests/dbt_modules/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": []}, "macro.dbt_utils.bigquery__type_numeric": {"unique_id": "macro.dbt_utils.bigquery__type_numeric", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Asana/dbt_asana/integration_tests/dbt_modules/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": []}, "macro.dbt_utils.type_bigint": {"unique_id": "macro.dbt_utils.type_bigint", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Asana/dbt_asana/integration_tests/dbt_modules/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', packages = dbt_utils._get_utils_namespaces())()) }}\n{%- endmacro -%}\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt_utils.default__type_bigint": {"unique_id": "macro.dbt_utils.default__type_bigint", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Asana/dbt_asana/integration_tests/dbt_modules/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": []}, "macro.dbt_utils.bigquery__type_bigint": {"unique_id": "macro.dbt_utils.bigquery__type_bigint", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Asana/dbt_asana/integration_tests/dbt_modules/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": []}, "macro.dbt_utils.type_int": {"unique_id": "macro.dbt_utils.type_int", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Asana/dbt_asana/integration_tests/dbt_modules/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', packages = dbt_utils._get_utils_namespaces())()) }}\n{%- endmacro -%}\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt_utils.default__type_int": {"unique_id": "macro.dbt_utils.default__type_int", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Asana/dbt_asana/integration_tests/dbt_modules/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": []}, "macro.dbt_utils.bigquery__type_int": {"unique_id": "macro.dbt_utils.bigquery__type_int", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Asana/dbt_asana/integration_tests/dbt_modules/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": []}, "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_modules/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": []}, "macro.dbt_utils.length": {"unique_id": "macro.dbt_utils.length", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Asana/dbt_asana/integration_tests/dbt_modules/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', packages = dbt_utils._get_utils_namespaces()) (expression)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt_utils.default__length": {"unique_id": "macro.dbt_utils.default__length", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Asana/dbt_asana/integration_tests/dbt_modules/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": []}, "macro.dbt_utils.redshift__length": {"unique_id": "macro.dbt_utils.redshift__length", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Asana/dbt_asana/integration_tests/dbt_modules/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": []}, "macro.dbt_utils.dateadd": {"unique_id": "macro.dbt_utils.dateadd", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Asana/dbt_asana/integration_tests/dbt_modules/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', packages = dbt_utils._get_utils_namespaces())(datepart, interval, from_date_or_timestamp)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt_utils.default__dateadd": {"unique_id": "macro.dbt_utils.default__dateadd", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Asana/dbt_asana/integration_tests/dbt_modules/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": []}, "macro.dbt_utils.bigquery__dateadd": {"unique_id": "macro.dbt_utils.bigquery__dateadd", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Asana/dbt_asana/integration_tests/dbt_modules/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": []}, "macro.dbt_utils.postgres__dateadd": {"unique_id": "macro.dbt_utils.postgres__dateadd", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Asana/dbt_asana/integration_tests/dbt_modules/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": []}, "macro.dbt_utils.intersect": {"unique_id": "macro.dbt_utils.intersect", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Asana/dbt_asana/integration_tests/dbt_modules/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', packages = dbt_utils._get_utils_namespaces())()) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt_utils.default__intersect": {"unique_id": "macro.dbt_utils.default__intersect", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Asana/dbt_asana/integration_tests/dbt_modules/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": []}, "macro.dbt_utils.bigquery__intersect": {"unique_id": "macro.dbt_utils.bigquery__intersect", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Asana/dbt_asana/integration_tests/dbt_modules/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": []}, "macro.dbt_utils.right": {"unique_id": "macro.dbt_utils.right", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Asana/dbt_asana/integration_tests/dbt_modules/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', packages = dbt_utils._get_utils_namespaces()) (string_text, length_expression)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt_utils.default__right": {"unique_id": "macro.dbt_utils.default__right", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Asana/dbt_asana/integration_tests/dbt_modules/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": []}, "macro.dbt_utils.bigquery__right": {"unique_id": "macro.dbt_utils.bigquery__right", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Asana/dbt_asana/integration_tests/dbt_modules/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": []}, "macro.dbt_utils.snowflake__right": {"unique_id": "macro.dbt_utils.snowflake__right", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Asana/dbt_asana/integration_tests/dbt_modules/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": []}, "macro.dbt_utils.datediff": {"unique_id": "macro.dbt_utils.datediff", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Asana/dbt_asana/integration_tests/dbt_modules/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', packages = dbt_utils._get_utils_namespaces())(first_date, second_date, datepart)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt_utils.default__datediff": {"unique_id": "macro.dbt_utils.default__datediff", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Asana/dbt_asana/integration_tests/dbt_modules/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": []}, "macro.dbt_utils.bigquery__datediff": {"unique_id": "macro.dbt_utils.bigquery__datediff", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Asana/dbt_asana/integration_tests/dbt_modules/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": []}, "macro.dbt_utils.postgres__datediff": {"unique_id": "macro.dbt_utils.postgres__datediff", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Asana/dbt_asana/integration_tests/dbt_modules/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": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt_utils.safe_cast": {"unique_id": "macro.dbt_utils.safe_cast", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Asana/dbt_asana/integration_tests/dbt_modules/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', packages = dbt_utils._get_utils_namespaces()) (field, type)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt_utils.default__safe_cast": {"unique_id": "macro.dbt_utils.default__safe_cast", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Asana/dbt_asana/integration_tests/dbt_modules/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": []}, "macro.dbt_utils.snowflake__safe_cast": {"unique_id": "macro.dbt_utils.snowflake__safe_cast", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Asana/dbt_asana/integration_tests/dbt_modules/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": []}, "macro.dbt_utils.bigquery__safe_cast": {"unique_id": "macro.dbt_utils.bigquery__safe_cast", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Asana/dbt_asana/integration_tests/dbt_modules/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": []}, "macro.dbt_utils.hash": {"unique_id": "macro.dbt_utils.hash", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Asana/dbt_asana/integration_tests/dbt_modules/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', packages = dbt_utils._get_utils_namespaces()) (field)) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt_utils.default__hash": {"unique_id": "macro.dbt_utils.default__hash", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Asana/dbt_asana/integration_tests/dbt_modules/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": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt_utils.bigquery__hash": {"unique_id": "macro.dbt_utils.bigquery__hash", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Asana/dbt_asana/integration_tests/dbt_modules/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": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt_utils.identifier": {"unique_id": "macro.dbt_utils.identifier", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Asana/dbt_asana/integration_tests/dbt_modules/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', packages = dbt_utils._get_utils_namespaces()) (value)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt_utils.default__identifier": {"unique_id": "macro.dbt_utils.default__identifier", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Asana/dbt_asana/integration_tests/dbt_modules/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": []}, "macro.dbt_utils.bigquery__identifier": {"unique_id": "macro.dbt_utils.bigquery__identifier", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Asana/dbt_asana/integration_tests/dbt_modules/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": []}, "macro.dbt_utils.position": {"unique_id": "macro.dbt_utils.position", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Asana/dbt_asana/integration_tests/dbt_modules/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', packages = dbt_utils._get_utils_namespaces()) (substring_text, string_text)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt_utils.default__position": {"unique_id": "macro.dbt_utils.default__position", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Asana/dbt_asana/integration_tests/dbt_modules/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": []}, "macro.dbt_utils.bigquery__position": {"unique_id": "macro.dbt_utils.bigquery__position", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Asana/dbt_asana/integration_tests/dbt_modules/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": []}, "macro.dbt_utils.string_literal": {"unique_id": "macro.dbt_utils.string_literal", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Asana/dbt_asana/integration_tests/dbt_modules/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', packages = dbt_utils._get_utils_namespaces()) (value)) }}\n{%- endmacro -%}\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt_utils.default__string_literal": {"unique_id": "macro.dbt_utils.default__string_literal", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Asana/dbt_asana/integration_tests/dbt_modules/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": []}, "macro.dbt_utils.current_timestamp": {"unique_id": "macro.dbt_utils.current_timestamp", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Asana/dbt_asana/integration_tests/dbt_modules/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', packages = dbt_utils._get_utils_namespaces())()) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt_utils.default__current_timestamp": {"unique_id": "macro.dbt_utils.default__current_timestamp", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Asana/dbt_asana/integration_tests/dbt_modules/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": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt_utils.redshift__current_timestamp": {"unique_id": "macro.dbt_utils.redshift__current_timestamp", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Asana/dbt_asana/integration_tests/dbt_modules/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": []}, "macro.dbt_utils.bigquery__current_timestamp": {"unique_id": "macro.dbt_utils.bigquery__current_timestamp", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Asana/dbt_asana/integration_tests/dbt_modules/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": []}, "macro.dbt_utils.current_timestamp_in_utc": {"unique_id": "macro.dbt_utils.current_timestamp_in_utc", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Asana/dbt_asana/integration_tests/dbt_modules/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', packages = dbt_utils._get_utils_namespaces())()) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "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/joseph.markiewicz/Documents/dbt_packages/Asana/dbt_asana/integration_tests/dbt_modules/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": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "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/joseph.markiewicz/Documents/dbt_packages/Asana/dbt_asana/integration_tests/dbt_modules/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": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "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/joseph.markiewicz/Documents/dbt_packages/Asana/dbt_asana/integration_tests/dbt_modules/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": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "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_modules/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', packages = dbt_utils._get_utils_namespaces()) (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": []}, "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_modules/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": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "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_modules/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": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "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_modules/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": []}, "macro.dbt_utils._get_utils_namespaces": {"unique_id": "macro.dbt_utils._get_utils_namespaces", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Asana/dbt_asana/integration_tests/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/_get_utils_namespaces.sql", "original_file_path": "macros/cross_db_utils/_get_utils_namespaces.sql", "name": "_get_utils_namespaces", "macro_sql": "{% macro _get_utils_namespaces() %}\n {% set override_namespaces = var('dbt_utils_dispatch_list', []) %}\n {% do return(override_namespaces + ['dbt_utils']) %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt_utils.last_day": {"unique_id": "macro.dbt_utils.last_day", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Asana/dbt_asana/integration_tests/dbt_modules/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', packages = dbt_utils._get_utils_namespaces()) (date, datepart)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt_utils.default_last_day": {"unique_id": "macro.dbt_utils.default_last_day", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Asana/dbt_asana/integration_tests/dbt_modules/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": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt_utils.default__last_day": {"unique_id": "macro.dbt_utils.default__last_day", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Asana/dbt_asana/integration_tests/dbt_modules/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": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt_utils.postgres__last_day": {"unique_id": "macro.dbt_utils.postgres__last_day", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Asana/dbt_asana/integration_tests/dbt_modules/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 {{ exceptions.raise_compiler_error(\n \"dbt_utils.last_day is not supported for datepart 'quarter' on this adapter\") }}\n {%- else -%}\n {{dbt_utils.default_last_day(date, datepart)}}\n {%- endif -%}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt_utils.split_part": {"unique_id": "macro.dbt_utils.split_part", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Asana/dbt_asana/integration_tests/dbt_modules/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', packages = dbt_utils._get_utils_namespaces()) (string_text, delimiter_text, part_number)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt_utils.default__split_part": {"unique_id": "macro.dbt_utils.default__split_part", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Asana/dbt_asana/integration_tests/dbt_modules/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": []}, "macro.dbt_utils.bigquery__split_part": {"unique_id": "macro.dbt_utils.bigquery__split_part", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Asana/dbt_asana/integration_tests/dbt_modules/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 split(\n {{ string_text }},\n {{ delimiter_text }}\n )[safe_offset({{ part_number - 1 }})]\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt_utils.date_trunc": {"unique_id": "macro.dbt_utils.date_trunc", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Asana/dbt_asana/integration_tests/dbt_modules/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', packages = dbt_utils._get_utils_namespaces()) (datepart, date)) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt_utils.default__date_trunc": {"unique_id": "macro.dbt_utils.default__date_trunc", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Asana/dbt_asana/integration_tests/dbt_modules/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": []}, "macro.dbt_utils.bigquery__date_trunc": {"unique_id": "macro.dbt_utils.bigquery__date_trunc", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Asana/dbt_asana/integration_tests/dbt_modules/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": []}, "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_modules/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": []}, "macro.dbt_utils.get_period_boundaries": {"unique_id": "macro.dbt_utils.get_period_boundaries", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Asana/dbt_asana/integration_tests/dbt_modules/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', packages = dbt_utils._get_utils_namespaces())(target_schema, target_table, timestamp_field, start_date, stop_date, period)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt_utils.default__get_period_boundaries": {"unique_id": "macro.dbt_utils.default__get_period_boundaries", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Asana/dbt_asana/integration_tests/dbt_modules/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": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt_utils.get_period_sql": {"unique_id": "macro.dbt_utils.get_period_sql", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Asana/dbt_asana/integration_tests/dbt_modules/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', packages = dbt_utils._get_utils_namespaces())(target_cols_csv, sql, timestamp_field, period, start_timestamp, stop_timestamp, offset)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt_utils.default__get_period_sql": {"unique_id": "macro.dbt_utils.default__get_period_sql", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Asana/dbt_asana/integration_tests/dbt_modules/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": []}, "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/joseph.markiewicz/Documents/dbt_packages/Asana/dbt_asana/integration_tests/dbt_modules/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": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "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_modules/dbt_utils", "path": "macros/logger/pretty_log_format.sql", "original_file_path": "macros/logger/pretty_log_format.sql", "name": "pretty_log_format", "macro_sql": "{% macro pretty_log_format(message) %}\n {{ return(adapter.dispatch('pretty_log_format', packages = dbt_utils._get_utils_namespaces())(message)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "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_modules/dbt_utils", "path": "macros/logger/pretty_log_format.sql", "original_file_path": "macros/logger/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": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "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_modules/dbt_utils", "path": "macros/logger/pretty_time.sql", "original_file_path": "macros/logger/pretty_time.sql", "name": "pretty_time", "macro_sql": "{% macro pretty_time(format='%H:%M:%S') %}\n {{ return(adapter.dispatch('pretty_time', packages = dbt_utils._get_utils_namespaces())(format)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "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_modules/dbt_utils", "path": "macros/logger/pretty_time.sql", "original_file_path": "macros/logger/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": []}, "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_modules/dbt_utils", "path": "macros/logger/log_info.sql", "original_file_path": "macros/logger/log_info.sql", "name": "log_info", "macro_sql": "{% macro log_info(message) %}\n {{ return(adapter.dispatch('log_info', packages = dbt_utils._get_utils_namespaces())(message)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "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_modules/dbt_utils", "path": "macros/logger/log_info.sql", "original_file_path": "macros/logger/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": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "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_modules/dbt_utils", "path": "macros/datetime/date_spine.sql", "original_file_path": "macros/datetime/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', packages = dbt_utils._get_utils_namespaces())(start_date, end_date, datepart)) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "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_modules/dbt_utils", "path": "macros/datetime/date_spine.sql", "original_file_path": "macros/datetime/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": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "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_modules/dbt_utils", "path": "macros/datetime/date_spine.sql", "original_file_path": "macros/datetime/date_spine.sql", "name": "date_spine", "macro_sql": "{% macro date_spine(datepart, start_date, end_date) %}\n {{ return(adapter.dispatch('date_spine', packages = dbt_utils._get_utils_namespaces())(datepart, start_date, end_date)) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "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_modules/dbt_utils", "path": "macros/datetime/date_spine.sql", "original_file_path": "macros/datetime/date_spine.sql", "name": "default__date_spine", "macro_sql": "{% macro default__date_spine(datepart, start_date, end_date) %}\n\n/*\ncall 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*/\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": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "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_modules/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', packages = dbt_utils._get_utils_namespaces())(field)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "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_modules/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(field, \"'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\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "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_modules/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', packages = dbt_utils._get_utils_namespaces())(field)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "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_modules/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": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "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_modules/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', packages = dbt_utils._get_utils_namespaces())(field, url_parameter)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "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_modules/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": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "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_modules/dbt_utils", "path": "macros/geo/haversine_distance.sql", "original_file_path": "macros/geo/haversine_distance.sql", "name": "haversine_distance", "macro_sql": "{% macro haversine_distance(lat1,lon1,lat2,lon2) -%}\n {{ return(adapter.dispatch('haversine_distance', packages = dbt_utils._get_utils_namespaces())(lat1,lon1,lat2,lon2)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "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_modules/dbt_utils", "path": "macros/geo/haversine_distance.sql", "original_file_path": "macros/geo/haversine_distance.sql", "name": "default__haversine_distance", "macro_sql": "{% macro default__haversine_distance(lat1,lon1,lat2,lon2) -%}\n\n 2 * 3961 * asin(sqrt((sin(radians(({{lat2}} - {{lat1}}) / 2))) ^ 2 +\n cos(radians({{lat1}})) * cos(radians({{lat2}})) *\n (sin(radians(({{lon2}} - {{lon1}}) / 2))) ^ 2))\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "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_modules/dbt_utils", "path": "macros/schema_tests/equal_rowcount.sql", "original_file_path": "macros/schema_tests/equal_rowcount.sql", "name": "test_equal_rowcount", "macro_sql": "{% macro test_equal_rowcount(model) %}\n {{ return(adapter.dispatch('test_equal_rowcount', packages = dbt_utils._get_utils_namespaces())(model, **kwargs)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "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_modules/dbt_utils", "path": "macros/schema_tests/equal_rowcount.sql", "original_file_path": "macros/schema_tests/equal_rowcount.sql", "name": "default__test_equal_rowcount", "macro_sql": "{% macro default__test_equal_rowcount(model) %}\n\n{% set compare_model = kwargs.get('compare_model', kwargs.get('arg')) %}\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 abs(\n (select count_a from a) -\n (select count_b from b)\n )\n as diff_count\n\n)\n\nselect diff_count from final\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "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_modules/dbt_utils", "path": "macros/schema_tests/relationships_where.sql", "original_file_path": "macros/schema_tests/relationships_where.sql", "name": "test_relationships_where", "macro_sql": "{% macro test_relationships_where(model, to, field) %}\n {{ return(adapter.dispatch('test_relationships_where', packages = dbt_utils._get_utils_namespaces())(model, to, field, **kwargs)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "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_modules/dbt_utils", "path": "macros/schema_tests/relationships_where.sql", "original_file_path": "macros/schema_tests/relationships_where.sql", "name": "default__test_relationships_where", "macro_sql": "{% macro default__test_relationships_where(model, to, field) %}\n\n{% set column_name = kwargs.get('column_name', kwargs.get('from')) %}\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{% set from_condition = kwargs.get('from_condition', \"1=1\") %}\n{% set to_condition = kwargs.get('to_condition', \"1=1\") %}\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 count(*) from exceptions\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "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_modules/dbt_utils", "path": "macros/schema_tests/recency.sql", "original_file_path": "macros/schema_tests/recency.sql", "name": "test_recency", "macro_sql": "{% macro test_recency(model, datepart, interval) %}\n {{ return(adapter.dispatch('test_recency', packages = dbt_utils._get_utils_namespaces())(model, datepart, interval, **kwargs)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "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_modules/dbt_utils", "path": "macros/schema_tests/recency.sql", "original_file_path": "macros/schema_tests/recency.sql", "name": "default__test_recency", "macro_sql": "{% macro default__test_recency(model, datepart, interval) %}\n\n{% set column_name = kwargs.get('column_name', kwargs.get('field')) %}\n\nselect\n case when count(*) > 0 then 0\n else 1\n end as error_result\nfrom {{model}}\nwhere {{column_name}} >=\n {{dbt_utils.dateadd(datepart, interval * -1, dbt_utils.current_timestamp())}}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "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_modules/dbt_utils", "path": "macros/schema_tests/not_constant.sql", "original_file_path": "macros/schema_tests/not_constant.sql", "name": "test_not_constant", "macro_sql": "{% macro test_not_constant(model) %}\n {{ return(adapter.dispatch('test_not_constant', packages = dbt_utils._get_utils_namespaces())(model, **kwargs)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "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_modules/dbt_utils", "path": "macros/schema_tests/not_constant.sql", "original_file_path": "macros/schema_tests/not_constant.sql", "name": "default__test_not_constant", "macro_sql": "{% macro default__test_not_constant(model) %}\n\n{% set column_name = kwargs.get('column_name', kwargs.get('arg')) %}\n\nselect count(*)\n\nfrom (\n\n select\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\n from {{ model }}\n\n having count(distinct {{ column_name }}) = 1\n\n ) validation_errors\n\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt_utils.test_unique_where": {"unique_id": "macro.dbt_utils.test_unique_where", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Asana/dbt_asana/integration_tests/dbt_modules/dbt_utils", "path": "macros/schema_tests/test_unique_where.sql", "original_file_path": "macros/schema_tests/test_unique_where.sql", "name": "test_unique_where", "macro_sql": "{% macro test_unique_where(model) %}\r\n {{ return(adapter.dispatch('test_unique_where', packages = dbt_utils._get_utils_namespaces())(model, **kwargs)) }}\r\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt_utils.default__test_unique_where": {"unique_id": "macro.dbt_utils.default__test_unique_where", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Asana/dbt_asana/integration_tests/dbt_modules/dbt_utils", "path": "macros/schema_tests/test_unique_where.sql", "original_file_path": "macros/schema_tests/test_unique_where.sql", "name": "default__test_unique_where", "macro_sql": "{% macro default__test_unique_where(model) %}\r\n\r\n{% set column_name = kwargs.get('column_name', kwargs.get('arg')) %}\r\n{% set where = kwargs.get('where', kwargs.get('arg')) %}\r\n\r\nselect count(*)\r\nfrom (\r\n\r\n select\r\n {{ column_name }}\r\n\r\n from {{ model }}\r\n where {{ column_name }} is not null\r\n {% if where %} and {{ where }} {% endif %}\r\n group by {{ column_name }}\r\n having count(*) > 1\r\n\r\n) validation_errors\r\n\r\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "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_modules/dbt_utils", "path": "macros/schema_tests/at_least_one.sql", "original_file_path": "macros/schema_tests/at_least_one.sql", "name": "test_at_least_one", "macro_sql": "{% macro test_at_least_one(model) %}\n {{ return(adapter.dispatch('test_at_least_one', packages = dbt_utils._get_utils_namespaces())(model, **kwargs)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "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_modules/dbt_utils", "path": "macros/schema_tests/at_least_one.sql", "original_file_path": "macros/schema_tests/at_least_one.sql", "name": "default__test_at_least_one", "macro_sql": "{% macro default__test_at_least_one(model) %}\n\n{% set column_name = kwargs.get('column_name', kwargs.get('arg')) %}\n\nselect count(*)\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": []}, "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_modules/dbt_utils", "path": "macros/schema_tests/unique_combination_of_columns.sql", "original_file_path": "macros/schema_tests/unique_combination_of_columns.sql", "name": "test_unique_combination_of_columns", "macro_sql": "{% macro test_unique_combination_of_columns(model, quote_columns = false) %}\n {{ return(adapter.dispatch('test_unique_combination_of_columns', packages = dbt_utils._get_utils_namespaces())(model, quote_columns, **kwargs)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "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_modules/dbt_utils", "path": "macros/schema_tests/unique_combination_of_columns.sql", "original_file_path": "macros/schema_tests/unique_combination_of_columns.sql", "name": "default__test_unique_combination_of_columns", "macro_sql": "{% macro default__test_unique_combination_of_columns(model, quote_columns = false) %}\n\n{%- set columns = kwargs.get('combination_of_columns', kwargs.get('arg')) %}\n\n{% if not quote_columns %}\n {%- set column_list=columns %}\n{% elif quote_columns %}\n {%- set column_list=[] %}\n {% for column in 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\n group by {{ columns_csv }}\n having count(*) > 1\n\n)\n\nselect count(*)\nfrom validation_errors\n\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "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_modules/dbt_utils", "path": "macros/schema_tests/cardinality_equality.sql", "original_file_path": "macros/schema_tests/cardinality_equality.sql", "name": "test_cardinality_equality", "macro_sql": "{% macro test_cardinality_equality(model, to, field) %}\n\n {{ return(adapter.dispatch('test_cardinality_equality', packages = dbt_utils._get_utils_namespaces())(model, to, field, **kwargs)) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "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_modules/dbt_utils", "path": "macros/schema_tests/cardinality_equality.sql", "original_file_path": "macros/schema_tests/cardinality_equality.sql", "name": "default__test_cardinality_equality", "macro_sql": "{% macro default__test_cardinality_equality(model, to, field) %}\n\n{# T-SQL doesn't let you use numbers as aliases for columns #}\n{# Thus, no \"GROUP BY 1\" #}\n\n{% set column_name = kwargs.get('column_name', kwargs.get('from')) %}\n\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 {{ column_name }}\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 count(*)\nfrom unioned\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "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_modules/dbt_utils", "path": "macros/schema_tests/expression_is_true.sql", "original_file_path": "macros/schema_tests/expression_is_true.sql", "name": "test_expression_is_true", "macro_sql": "{% macro test_expression_is_true(model, 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', packages = dbt_utils._get_utils_namespaces())(model, condition, **kwargs)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "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_modules/dbt_utils", "path": "macros/schema_tests/expression_is_true.sql", "original_file_path": "macros/schema_tests/expression_is_true.sql", "name": "default__test_expression_is_true", "macro_sql": "{% macro default__test_expression_is_true(model, condition) %}\n\n{% set expression = kwargs.get('expression', kwargs.get('arg')) %}\n\nwith meet_condition as (\n\n select * from {{ model }} where {{ condition }}\n\n),\nvalidation_errors as (\n\n select\n *\n from meet_condition\n where not({{expression}})\n\n)\n\nselect count(*)\nfrom validation_errors\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt_utils.test_not_null_where": {"unique_id": "macro.dbt_utils.test_not_null_where", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Asana/dbt_asana/integration_tests/dbt_modules/dbt_utils", "path": "macros/schema_tests/test_not_null_where.sql", "original_file_path": "macros/schema_tests/test_not_null_where.sql", "name": "test_not_null_where", "macro_sql": "{% macro test_not_null_where(model) %}\r\n {{ return(adapter.dispatch('test_not_null_where', packages = dbt_utils._get_utils_namespaces())(model, **kwargs)) }}\r\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "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/joseph.markiewicz/Documents/dbt_packages/Asana/dbt_asana/integration_tests/dbt_modules/dbt_utils", "path": "macros/schema_tests/test_not_null_where.sql", "original_file_path": "macros/schema_tests/test_not_null_where.sql", "name": "default__test_not_null_where", "macro_sql": "{% macro default__test_not_null_where(model) %}\r\n\r\n{% set column_name = kwargs.get('column_name', kwargs.get('arg')) %}\r\n{% set where = kwargs.get('where', kwargs.get('arg')) %}\r\n\r\nselect count(*)\r\nfrom {{ model }}\r\nwhere {{ column_name }} is null\r\n{% if where %} and {{ where }} {% endif %}\r\n\r\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "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_modules/dbt_utils", "path": "macros/schema_tests/equality.sql", "original_file_path": "macros/schema_tests/equality.sql", "name": "test_equality", "macro_sql": "{% macro test_equality(model) %}\n {{ return(adapter.dispatch('test_equality', packages = dbt_utils._get_utils_namespaces())(model, **kwargs)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "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_modules/dbt_utils", "path": "macros/schema_tests/equality.sql", "original_file_path": "macros/schema_tests/equality.sql", "name": "default__test_equality", "macro_sql": "{% macro default__test_equality(model) %}\n\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{%- set compare_columns = kwargs.get('compare_columns', None) -%}\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_model = kwargs.get('compare_model', kwargs.get('arg')) %}\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 * from a_minus_b\n union all\n select * from b_minus_a\n\n),\n\nfinal as (\n\n select (select count(*) from unioned) +\n (select abs(\n (select count(*) from a_minus_b) -\n (select count(*) from b_minus_a)\n ))\n as count\n\n)\n\nselect count from final\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "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_modules/dbt_utils", "path": "macros/schema_tests/mutually_exclusive_ranges.sql", "original_file_path": "macros/schema_tests/mutually_exclusive_ranges.sql", "name": "test_mutually_exclusive_ranges", "macro_sql": "{% macro test_mutually_exclusive_ranges(model, lower_bound_column, upper_bound_column, partition_by=None, gaps='allowed') %}\n {{ return(adapter.dispatch('test_mutually_exclusive_ranges', packages = dbt_utils._get_utils_namespaces())(model, lower_bound_column, upper_bound_column, partition_by, gaps)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "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_modules/dbt_utils", "path": "macros/schema_tests/mutually_exclusive_ranges.sql", "original_file_path": "macros/schema_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') %}\n\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\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 }},\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 < upper_bound,\n false\n ) as lower_bound_less_than_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_less_than_upper_bound\n and upper_bound_{{ allow_gaps_operator_in_words }}_next_lower_bound\n )\n)\n\nselect count(*) from validation_errors\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "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_modules/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', packages = dbt_utils._get_utils_namespaces())(relation)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "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_modules/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": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "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_modules/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', packages = dbt_utils._get_utils_namespaces())(schema_pattern, table_pattern, exclude, database)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "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_modules/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": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "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_modules/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', packages = dbt_utils._get_utils_namespaces())(upper_bound)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "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_modules/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": []}, "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_modules/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', packages = dbt_utils._get_utils_namespaces())(upper_bound)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "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_modules/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 * pow(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": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "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_modules/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', packages = dbt_utils._get_utils_namespaces())(schema, prefix, exclude, database)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "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_modules/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": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "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_modules/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', packages = dbt_utils._get_utils_namespaces())(schema, prefix, exclude, database)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "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_modules/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": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "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_modules/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=[]) -%}\n {{ return(adapter.dispatch('star', packages = dbt_utils._get_utils_namespaces())(from, relation_alias, except)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "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_modules/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=[]) -%}\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 include_cols = [] %}\n {%- set cols = adapter.get_columns_in_relation(from) -%}\n\n {%- for col in cols -%}\n\n {%- if col.column not in except -%}\n {% do include_cols.append(col.column) %}\n\n {%- endif %}\n {%- endfor %}\n\n {%- for col in include_cols %}\n\n {%- if relation_alias %}{{ relation_alias }}.{% else %}{%- endif -%}{{ adapter.quote(col)|trim }}\n {%- if not loop.last %},{{ '\\n ' }}{% endif %}\n\n {%- endfor -%}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "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_modules/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', packages = dbt_utils._get_utils_namespaces())(relation, cast_to, exclude, remove, field_name, value_name, table)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "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_modules/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({{ col.column }} 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": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "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_modules/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') -%}\n {{ return(adapter.dispatch('union_relations', packages = dbt_utils._get_utils_namespaces())(relations, column_override, include, exclude, source_column_name)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "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_modules/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') -%}\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\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\n {% if not loop.last -%}\n union all\n {% endif -%}\n\n {%- endfor -%}\n\n{%- endmacro -%}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "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_modules/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', packages = dbt_utils._get_utils_namespaces())(n)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "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_modules/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": []}, "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_modules/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', packages = dbt_utils._get_utils_namespaces())(field_list, *varargs)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "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_modules/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": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "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_modules/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', packages = dbt_utils._get_utils_namespaces())(*varargs)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "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_modules/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": []}, "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_modules/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', packages = dbt_utils._get_utils_namespaces())(cols)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "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_modules/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": []}, "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_modules/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', packages = dbt_utils._get_utils_namespaces())\n (schema_pattern, table_pattern, exclude, database)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "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_modules/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 case table_type\n when 'BASE TABLE' then 'table'\n else lower(table_type)\n end as \"table_type\"\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": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "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_modules/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 case table_type\n when 'BASE TABLE' then 'table'\n else lower(table_type)\n end as table_type\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": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "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_modules/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": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "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_modules/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, max_records=none, default=none) -%}\n {{ return(adapter.dispatch('get_column_values', packages = dbt_utils._get_utils_namespaces())(table, column, max_records, default)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "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_modules/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, max_records=none, default=none) -%}\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\n {%- set target_relation = adapter.get_relation(database=table.database,\n schema=table.schema,\n identifier=table.identifier) -%}\n\n {%- call statement('get_column_values', fetch_result=true) %}\n\n {%- if not target_relation and default is none -%}\n\n {{ exceptions.raise_compiler_error(\"In get_column_values(): relation \" ~ table ~ \" does not exist and no default value was provided.\") }}\n\n {%- elif not target_relation and default is not none -%}\n\n {{ log(\"Relation \" ~ table ~ \" does not exist. Returning the default value: \" ~ default) }}\n\n {{ return(default) }}\n\n {%- else -%}\n\n select\n {{ column }} as value\n\n from {{ target_relation }}\n group by 1\n order by count(*) desc\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": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "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_modules/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', packages = dbt_utils._get_utils_namespaces())(column, values, alias, agg, cmp, prefix, suffix, then_value, else_value, quote_identifiers, distinct)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "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_modules/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 v in values %}\n {{ agg }}(\n {% if distinct %} distinct {% endif %}\n case\n when {{ column }} {{ cmp }} '{{ v }}'\n then {{ then_value }}\n else {{ else_value }}\n end\n )\n {% if alias %}\n {% if quote_identifiers %}\n as {{ adapter.quote(prefix ~ v ~ suffix) }}\n {% else %}\n as {{prefix ~ v ~ suffix }}\n {% endif %}\n {% endif %}\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": []}, "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_modules/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', packages = dbt_utils._get_utils_namespaces())(query)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "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_modules/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": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "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_modules/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": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "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_modules/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": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "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_modules/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\": \"assignee_status\", \"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\": \"hearted\", \"datatype\": \"boolean\"},\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\": \"num_hearts\", \"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": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "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_modules/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": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "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_modules/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": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "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_modules/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": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "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_modules/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": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "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_modules/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": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "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_modules/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": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "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_modules/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": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "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_modules/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": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "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_modules/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": []}, "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_modules/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', packages = fivetran_utils._get_utils_namespaces()) (percentile_field, partition_field, percent) }}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "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_modules/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": []}, "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_modules/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": []}, "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_modules/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', packages = fivetran_utils._get_utils_namespaces()) (boolean_field) }}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "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_modules/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": []}, "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_modules/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": []}, "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_modules/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": []}, "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_modules/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', packages = fivetran_utils._get_utils_namespaces()) (field_to_agg, delimiter) }}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "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_modules/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": []}, "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_modules/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": []}, "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_modules/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": []}, "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_modules/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('datediff', packages = fivetran_utils._get_utils_namespaces())(first_date, second_date, datepart) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "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_modules/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": []}, "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_modules/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": []}, "macro.fivetran_utils.postgres__datediff": {"unique_id": "macro.fivetran_utils.postgres__datediff", "package_name": "fivetran_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Asana/dbt_asana/integration_tests/dbt_modules/fivetran_utils", "path": "macros/timestamp_diff.sql", "original_file_path": "macros/timestamp_diff.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": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.fivetran_utils.generate_columns_macro": {"unique_id": "macro.fivetran_utils.generate_columns_macro", "package_name": "fivetran_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Asana/dbt_asana/integration_tests/dbt_modules/fivetran_utils", "path": "macros/generate_columns_macro.sql", "original_file_path": "macros/generate_columns_macro.sql", "name": "generate_columns_macro", "macro_sql": "{% macro generate_columns_macro(table_name, schema_name, database_name=target.database) %}\n\n{% set columns = get_columns_for_macro(table_name, schema_name, database_name) %}\n\n{% set jinja_macro=[] %}\n\n{% do jinja_macro.append('{% macro get_' ~ table_name ~ '_columns() %}') %}\n{% do jinja_macro.append('') %}\n{% do jinja_macro.append('{% set columns = [') %}\n\n{% for col in columns %}\n{% do jinja_macro.append(' ' ~ col ~ (',' if not loop.last)) %}\n{% endfor %}\n\n{% do jinja_macro.append('] %}') %}\n{% do jinja_macro.append('') %}\n{% do jinja_macro.append('{{ return(columns) }}') %}\n{% do jinja_macro.append('') %}\n{% do jinja_macro.append('{% endmacro %}') %}\n\n{% if execute %}\n\n {% set joined = jinja_macro | join ('\\n') %}\n {{ log(joined, info=True) }}\n {% do return(joined) %}\n\n{% endif %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "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_modules/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', packages = fivetran_utils._get_utils_namespaces()) (first_value_field, partition_field, order_by_field, order) }}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "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_modules/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": []}, "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_modules/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": []}, "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_modules/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": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "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_modules/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": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "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_modules/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": []}, "macro.fivetran_utils.snowflake__get_columns_for_macro": {"unique_id": "macro.fivetran_utils.snowflake__get_columns_for_macro", "package_name": "fivetran_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Asana/dbt_asana/integration_tests/dbt_modules/fivetran_utils", "path": "macros/get_columns_for_macro.sql", "original_file_path": "macros/get_columns_for_macro.sql", "name": "snowflake__get_columns_for_macro", "macro_sql": "{% macro snowflake__get_columns_for_macro(table_name, schema_name, database_name=target.database) %}\n\n{% set query %}\n\nselect\n concat(\n '{\"name\": \"', \n lower(column_name), \n '\", \"datatype\": ',\n case\n when lower(data_type) like '%timestamp%' then 'dbt_utils.type_timestamp()' \n when lower(data_type) = 'text' then 'dbt_utils.type_string()' \n when lower(data_type) = 'boolean' then '\"boolean\"'\n when lower(data_type) = 'number' then 'dbt_utils.type_numeric()' \n when lower(data_type) = 'float' then 'dbt_utils.type_float()' \n when lower(data_type) = 'date' then '\"date\"'\n end,\n '}')\nfrom {{ database_name }}.information_schema.columns\nwhere lower(table_name) = '{{ table_name }}'\nand lower(table_schema) = '{{ schema_name }}'\norder by 1\n\n{% endset %}\n\n{% set results = run_query(query) %}\n{% set results_list = results.columns[0].values() %}}\n\n{{ return(results_list) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.fivetran_utils.bigquery__get_columns_for_macro": {"unique_id": "macro.fivetran_utils.bigquery__get_columns_for_macro", "package_name": "fivetran_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Asana/dbt_asana/integration_tests/dbt_modules/fivetran_utils", "path": "macros/get_columns_for_macro.sql", "original_file_path": "macros/get_columns_for_macro.sql", "name": "bigquery__get_columns_for_macro", "macro_sql": "{% macro bigquery__get_columns_for_macro(table_name, schema_name, database_name=target.database) %}\n\n{% set query %}\n\nselect\n concat(\n '{\"name\": \"', \n lower(column_name), \n '\", \"datatype\": ',\n case\n when lower(data_type) like '%timestamp%' then 'dbt_utils.type_timestamp()' \n when lower(data_type) = 'string' then 'dbt_utils.type_string()' \n when lower(data_type) = 'bool' then '\"boolean\"'\n when lower(data_type) = 'numeric' then 'dbt_utils.type_numeric()' \n when lower(data_type) = 'float64' then 'dbt_utils.type_float()' \n when lower(data_type) = 'int64' then 'dbt_utils.type_int()' \n when lower(data_type) = 'date' then '\"date\"' \n when lower(data_type) = 'datetime' then '\"datetime\"' \n end,\n '}')\nfrom `{{ database_name }}`.{{ schema_name }}.INFORMATION_SCHEMA.COLUMNS\nwhere lower(table_name) = '{{ table_name }}'\nand lower(table_schema) = '{{ schema_name }}'\norder by 1\n\n{% endset %}\n\n{% set results = run_query(query) %}\n{% set results_list = results.columns[0].values() %}}\n\n{{ return(results_list) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.fivetran_utils.get_columns_for_macro": {"unique_id": "macro.fivetran_utils.get_columns_for_macro", "package_name": "fivetran_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Asana/dbt_asana/integration_tests/dbt_modules/fivetran_utils", "path": "macros/get_columns_for_macro.sql", "original_file_path": "macros/get_columns_for_macro.sql", "name": "get_columns_for_macro", "macro_sql": "{% macro get_columns_for_macro(table_name, schema_name, database_name) -%}\n {{ return(adapter.dispatch('get_columns_for_macro')(table_name, schema_name, database_name)) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "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_modules/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": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "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_modules/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 == 'bigquery' %}\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": []}, "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_modules/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', packages = fivetran_utils._get_utils_namespaces()) (string, string_path) }}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "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_modules/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": []}, "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_modules/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": []}, "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_modules/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": []}, "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_modules/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', packages = fivetran_utils._get_utils_namespaces()) (datepart, interval, from_timestamp) }}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "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_modules/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": []}, "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_modules/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": []}, "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_modules/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": []}, "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_modules/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": []}, "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_modules/fivetran_utils", "path": "macros/ceiling.sql", "original_file_path": "macros/ceiling.sql", "name": "ceiling", "macro_sql": "{% macro ceiling(num) -%}\n\n{{ adapter.dispatch('ceiling', packages = fivetran_utils._get_utils_namespaces()) (num) }}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "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_modules/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": []}, "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_modules/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": []}, "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_modules/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": []}, "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_modules/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": []}, "macro.fivetran_utils._get_utils_namespaces": {"unique_id": "macro.fivetran_utils._get_utils_namespaces", "package_name": "fivetran_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Asana/dbt_asana/integration_tests/dbt_modules/fivetran_utils", "path": "macros/_get_utils_namespaces.sql", "original_file_path": "macros/_get_utils_namespaces.sql", "name": "_get_utils_namespaces", "macro_sql": "{% macro _get_utils_namespaces() %}\n {% set override_namespaces = var('dbt_utils_dispatch_list', []) %}\n {% do return(override_namespaces + ['dbt_utils', 'fivetran_utils']) %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "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_modules/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', packages = fivetran_utils._get_utils_namespaces()) (field_to_agg) }}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "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_modules/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 listagg({{ field_to_agg }}, ',')\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.fivetran_utils.snowflake__array_agg": {"unique_id": "macro.fivetran_utils.snowflake__array_agg", "package_name": "fivetran_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Asana/dbt_asana/integration_tests/dbt_modules/fivetran_utils", "path": "macros/array_agg.sql", "original_file_path": "macros/array_agg.sql", "name": "snowflake__array_agg", "macro_sql": "{% macro snowflake__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": []}, "macro.fivetran_utils.bigquery__array_agg": {"unique_id": "macro.fivetran_utils.bigquery__array_agg", "package_name": "fivetran_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Asana/dbt_asana/integration_tests/dbt_modules/fivetran_utils", "path": "macros/array_agg.sql", "original_file_path": "macros/array_agg.sql", "name": "bigquery__array_agg", "macro_sql": "{% macro bigquery__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": []}, "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_modules/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": []}, "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_modules/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": []}}, "docs": {"dbt.__overview__": {"unique_id": "dbt.__overview__", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/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 `--models` 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/overview)?\n- Read the [dbt viewpoint](https://docs.getdbt.com/docs/viewpoint)\n- [Installation](https://docs.getdbt.com/docs/installation)\n- Join the [chat](https://community.getdbt.com/) on Slack for live questions and support."}}, "exposures": {}, "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": ["seed.asana_integration_tests.story_data"], "model.asana_source.stg_asana__team_tmp": ["seed.asana_integration_tests.team_data"], "model.asana_source.stg_asana__task_tmp": ["seed.asana_integration_tests.task_data"], "model.asana_source.stg_asana__task_follower_tmp": ["seed.asana_integration_tests.task_follower_data"], "model.asana_source.stg_asana__tag_tmp": ["seed.asana_integration_tests.tag_data"], "model.asana_source.stg_asana__task_section_tmp": ["seed.asana_integration_tests.task_section_data"], "model.asana_source.stg_asana__task_tag_tmp": ["seed.asana_integration_tests.task_tag_data"], "model.asana_source.stg_asana__user_tmp": ["seed.asana_integration_tests.user_data"], "model.asana_source.stg_asana__section_tmp": ["seed.asana_integration_tests.section_data"], "model.asana_source.stg_asana__project_tmp": ["seed.asana_integration_tests.project_data"], "model.asana_source.stg_asana__project_task_tmp": ["seed.asana_integration_tests.project_task_data"], "test.asana_source.unique_stg_asana__project_project_id": ["model.asana_source.stg_asana__project"], "test.asana_source.not_null_stg_asana__project_project_id": ["model.asana_source.stg_asana__project"], "test.asana_source.not_null_stg_asana__project_task_project_id": ["model.asana_source.stg_asana__project_task"], "test.asana_source.not_null_stg_asana__project_task_task_id": ["model.asana_source.stg_asana__project_task"], "test.asana_source.unique_stg_asana__section_section_id": ["model.asana_source.stg_asana__section"], "test.asana_source.not_null_stg_asana__section_section_id": ["model.asana_source.stg_asana__section"], "test.asana_source.unique_stg_asana__story_story_id": ["model.asana_source.stg_asana__story"], "test.asana_source.not_null_stg_asana__story_story_id": ["model.asana_source.stg_asana__story"], "test.asana_source.not_null_stg_asana__story_target_task_id": ["model.asana_source.stg_asana__story"], "test.asana_source.unique_stg_asana__tag_tag_id": ["model.asana_source.stg_asana__tag"], "test.asana_source.not_null_stg_asana__tag_tag_id": ["model.asana_source.stg_asana__tag"], "test.asana_source.unique_stg_asana__task_task_id": ["model.asana_source.stg_asana__task"], "test.asana_source.not_null_stg_asana__task_task_id": ["model.asana_source.stg_asana__task"], "test.asana_source.not_null_stg_asana__task_follower_task_id": ["model.asana_source.stg_asana__task_follower"], "test.asana_source.not_null_stg_asana__task_follower_user_id": ["model.asana_source.stg_asana__task_follower"], "test.asana_source.not_null_stg_asana__task_section_task_id": ["model.asana_source.stg_asana__task_section"], "test.asana_source.not_null_stg_asana__task_section_section_id": ["model.asana_source.stg_asana__task_section"], "test.asana_source.not_null_stg_asana__task_tag_tag_id": ["model.asana_source.stg_asana__task_tag"], "test.asana_source.not_null_stg_asana__task_tag_task_id": ["model.asana_source.stg_asana__task_tag"], "test.asana_source.unique_stg_asana__team_team_id": ["model.asana_source.stg_asana__team"], "test.asana_source.not_null_stg_asana__team_team_id": ["model.asana_source.stg_asana__team"], "test.asana_source.unique_stg_asana__user_user_id": ["model.asana_source.stg_asana__user"], "test.asana_source.not_null_stg_asana__user_user_id": ["model.asana_source.stg_asana__user"], "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.unique_asana__task_task_id": ["model.asana.asana__task"], "test.asana.not_null_asana__task_task_id": ["model.asana.asana__task"], "test.asana.unique_asana__user_user_id": ["model.asana.asana__user"], "test.asana.not_null_asana__user_user_id": ["model.asana.asana__user"], "test.asana.unique_asana__project_project_id": ["model.asana.asana__project"], "test.asana.not_null_asana__project_project_id": ["model.asana.asana__project"], "test.asana.unique_asana__team_team_id": ["model.asana.asana__team"], "test.asana.not_null_asana__team_team_id": ["model.asana.asana__team"], "test.asana.unique_asana__tag_tag_id": ["model.asana.asana__tag"], "test.asana.not_null_asana__tag_tag_id": ["model.asana.asana__tag"], "test.asana.unique_asana__daily_metrics_date_day": ["model.asana.asana__daily_metrics"], "test.asana.not_null_asana__daily_metrics_date_day": ["model.asana.asana__daily_metrics"], "test.asana.unique_int_asana__project_task_metrics_project_id": ["model.asana.int_asana__project_task_metrics"], "test.asana.not_null_int_asana__project_task_metrics_project_id": ["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": ["model.asana.int_asana__project_user"], "test.asana.unique_int_asana__subtask_parent_subtask_id": ["model.asana.int_asana__subtask_parent"], "test.asana.not_null_int_asana__subtask_parent_subtask_id": ["model.asana.int_asana__subtask_parent"], "test.asana.unique_int_asana__task_assignee_task_id": ["model.asana.int_asana__task_assignee"], "test.asana.not_null_int_asana__task_assignee_task_id": ["model.asana.int_asana__task_assignee"], "test.asana.unique_int_asana__task_comments_task_id": ["model.asana.int_asana__task_comments"], "test.asana.not_null_int_asana__task_comments_task_id": ["model.asana.int_asana__task_comments"], "test.asana.unique_int_asana__task_first_modifier_task_id": ["model.asana.int_asana__task_first_modifier"], "test.asana.not_null_int_asana__task_first_modifier_task_id": ["model.asana.int_asana__task_first_modifier"], "test.asana.unique_int_asana__task_followers_task_id": ["model.asana.int_asana__task_followers"], "test.asana.not_null_int_asana__task_followers_task_id": ["model.asana.int_asana__task_followers"], "test.asana.unique_int_asana__task_open_length_task_id": ["model.asana.int_asana__task_open_length"], "test.asana.not_null_int_asana__task_open_length_task_id": ["model.asana.int_asana__task_open_length"], "test.asana.unique_int_asana__task_projects_task_id": ["model.asana.int_asana__task_projects"], "test.asana.not_null_int_asana__task_projects_task_id": ["model.asana.int_asana__task_projects"], "test.asana.unique_int_asana__task_story_story_id": ["model.asana.int_asana__task_story"], "test.asana.not_null_int_asana__task_story_story_id": ["model.asana.int_asana__task_story"], "test.asana.unique_int_asana__task_tags_task_id": ["model.asana.int_asana__task_tags"], "test.asana.not_null_int_asana__task_tags_task_id": ["model.asana.int_asana__task_tags"], "test.asana.unique_int_asana__user_task_metrics_user_id": ["model.asana.int_asana__user_task_metrics"], "test.asana.not_null_int_asana__user_task_metrics_user_id": ["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": ["model.asana_source.stg_asana__project_task_tmp"], "seed.asana_integration_tests.story_data": ["model.asana_source.stg_asana__story_tmp"], "seed.asana_integration_tests.task_tag_data": ["model.asana_source.stg_asana__task_tag_tmp"], "seed.asana_integration_tests.task_section_data": ["model.asana_source.stg_asana__task_section_tmp"], "seed.asana_integration_tests.task_data": ["model.asana_source.stg_asana__task_tmp"], "seed.asana_integration_tests.task_follower_data": ["model.asana_source.stg_asana__task_follower_tmp"], "seed.asana_integration_tests.tag_data": ["model.asana_source.stg_asana__tag_tmp"], "seed.asana_integration_tests.project_data": ["model.asana_source.stg_asana__project_tmp"], "seed.asana_integration_tests.user_data": ["model.asana_source.stg_asana__user_tmp"], "seed.asana_integration_tests.team_data": ["model.asana_source.stg_asana__team_tmp"], "seed.asana_integration_tests.section_data": ["model.asana_source.stg_asana__section_tmp"], "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", "test.asana_source.unique_stg_asana__user_user_id"], "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", "test.asana_source.unique_stg_asana__task_task_id"], "model.asana_source.stg_asana__task_section": ["model.asana.int_asana__task_projects", "test.asana_source.not_null_stg_asana__task_section_section_id", "test.asana_source.not_null_stg_asana__task_section_task_id"], "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", "test.asana_source.unique_stg_asana__section_section_id"], "model.asana_source.stg_asana__team": ["model.asana.asana__project", "model.asana.asana__team", "test.asana_source.not_null_stg_asana__team_team_id", "test.asana_source.unique_stg_asana__team_team_id"], "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", "test.asana_source.not_null_stg_asana__task_tag_task_id"], "model.asana_source.stg_asana__story": ["model.asana.int_asana__task_story", "test.asana_source.not_null_stg_asana__story_story_id", "test.asana_source.not_null_stg_asana__story_target_task_id", "test.asana_source.unique_stg_asana__story_story_id"], "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", "test.asana_source.unique_stg_asana__tag_tag_id"], "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", "test.asana_source.not_null_stg_asana__project_task_task_id"], "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", "test.asana_source.unique_stg_asana__project_project_id"], "model.asana_source.stg_asana__task_follower": ["model.asana.int_asana__task_followers", "test.asana_source.not_null_stg_asana__task_follower_task_id", "test.asana_source.not_null_stg_asana__task_follower_user_id"], "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"], "test.asana_source.unique_stg_asana__project_project_id": [], "test.asana_source.not_null_stg_asana__project_project_id": [], "test.asana_source.not_null_stg_asana__project_task_project_id": [], "test.asana_source.not_null_stg_asana__project_task_task_id": [], "test.asana_source.unique_stg_asana__section_section_id": [], "test.asana_source.not_null_stg_asana__section_section_id": [], "test.asana_source.unique_stg_asana__story_story_id": [], "test.asana_source.not_null_stg_asana__story_story_id": [], "test.asana_source.not_null_stg_asana__story_target_task_id": [], "test.asana_source.unique_stg_asana__tag_tag_id": [], "test.asana_source.not_null_stg_asana__tag_tag_id": [], "test.asana_source.unique_stg_asana__task_task_id": [], "test.asana_source.not_null_stg_asana__task_task_id": [], "test.asana_source.not_null_stg_asana__task_follower_task_id": [], "test.asana_source.not_null_stg_asana__task_follower_user_id": [], "test.asana_source.not_null_stg_asana__task_section_task_id": [], "test.asana_source.not_null_stg_asana__task_section_section_id": [], "test.asana_source.not_null_stg_asana__task_tag_tag_id": [], "test.asana_source.not_null_stg_asana__task_tag_task_id": [], "test.asana_source.unique_stg_asana__team_team_id": [], "test.asana_source.not_null_stg_asana__team_team_id": [], "test.asana_source.unique_stg_asana__user_user_id": [], "test.asana_source.not_null_stg_asana__user_user_id": [], "model.asana.asana__daily_metrics": ["test.asana.not_null_asana__daily_metrics_date_day", "test.asana.unique_asana__daily_metrics_date_day"], "model.asana.asana__user": ["test.asana.not_null_asana__user_user_id", "test.asana.unique_asana__user_user_id"], "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", "test.asana.unique_asana__task_task_id"], "model.asana.asana__team": ["test.asana.not_null_asana__team_team_id", "test.asana.unique_asana__team_team_id"], "model.asana.asana__project": ["model.asana.asana__team", "test.asana.not_null_asana__project_project_id", "test.asana.unique_asana__project_project_id"], "model.asana.asana__tag": ["test.asana.not_null_asana__tag_tag_id", "test.asana.unique_asana__tag_tag_id"], "model.asana.int_asana__task_comments": ["model.asana.asana__task", "test.asana.not_null_int_asana__task_comments_task_id", "test.asana.unique_int_asana__task_comments_task_id"], "model.asana.int_asana__project_task_metrics": ["model.asana.asana__project", "test.asana.not_null_int_asana__project_task_metrics_project_id", "test.asana.unique_int_asana__project_task_metrics_project_id"], "model.asana.int_asana__user_task_metrics": ["model.asana.asana__user", "test.asana.not_null_int_asana__user_task_metrics_user_id", "test.asana.unique_int_asana__user_task_metrics_user_id"], "model.asana.int_asana__task_tags": ["model.asana.asana__task", "test.asana.not_null_int_asana__task_tags_task_id", "test.asana.unique_int_asana__task_tags_task_id"], "model.asana.int_asana__task_open_length": ["model.asana.asana__task", "test.asana.not_null_int_asana__task_open_length_task_id", "test.asana.unique_int_asana__task_open_length_task_id"], "model.asana.int_asana__task_followers": ["model.asana.asana__task", "test.asana.not_null_int_asana__task_followers_task_id", "test.asana.unique_int_asana__task_followers_task_id"], "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"], "model.asana.int_asana__task_first_modifier": ["model.asana.asana__task", "test.asana.not_null_int_asana__task_first_modifier_task_id", "test.asana.unique_int_asana__task_first_modifier_task_id"], "model.asana.int_asana__task_projects": ["model.asana.asana__task", "test.asana.not_null_int_asana__task_projects_task_id", "test.asana.unique_int_asana__task_projects_task_id"], "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", "test.asana.unique_int_asana__task_assignee_task_id"], "model.asana.int_asana__subtask_parent": ["model.asana.asana__task", "test.asana.not_null_int_asana__subtask_parent_subtask_id", "test.asana.unique_int_asana__subtask_parent_subtask_id"], "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", "test.asana.unique_int_asana__task_story_story_id"], "test.asana.unique_asana__task_task_id": [], "test.asana.not_null_asana__task_task_id": [], "test.asana.unique_asana__user_user_id": [], "test.asana.not_null_asana__user_user_id": [], "test.asana.unique_asana__project_project_id": [], "test.asana.not_null_asana__project_project_id": [], "test.asana.unique_asana__team_team_id": [], "test.asana.not_null_asana__team_team_id": [], "test.asana.unique_asana__tag_tag_id": [], "test.asana.not_null_asana__tag_tag_id": [], "test.asana.unique_asana__daily_metrics_date_day": [], "test.asana.not_null_asana__daily_metrics_date_day": [], "test.asana.unique_int_asana__project_task_metrics_project_id": [], "test.asana.not_null_int_asana__project_task_metrics_project_id": [], "test.asana.dbt_utils_unique_combination_of_columns_int_asana__project_user_project_id__user_id__role__currently_working_on": [], "test.asana.unique_int_asana__subtask_parent_subtask_id": [], "test.asana.not_null_int_asana__subtask_parent_subtask_id": [], "test.asana.unique_int_asana__task_assignee_task_id": [], "test.asana.not_null_int_asana__task_assignee_task_id": [], "test.asana.unique_int_asana__task_comments_task_id": [], "test.asana.not_null_int_asana__task_comments_task_id": [], "test.asana.unique_int_asana__task_first_modifier_task_id": [], "test.asana.not_null_int_asana__task_first_modifier_task_id": [], "test.asana.unique_int_asana__task_followers_task_id": [], "test.asana.not_null_int_asana__task_followers_task_id": [], "test.asana.unique_int_asana__task_open_length_task_id": [], "test.asana.not_null_int_asana__task_open_length_task_id": [], "test.asana.unique_int_asana__task_projects_task_id": [], "test.asana.not_null_int_asana__task_projects_task_id": [], "test.asana.unique_int_asana__task_story_story_id": [], "test.asana.not_null_int_asana__task_story_story_id": [], "test.asana.unique_int_asana__task_tags_task_id": [], "test.asana.not_null_int_asana__task_tags_task_id": [], "test.asana.unique_int_asana__user_task_metrics_user_id": [], "test.asana.not_null_int_asana__user_task_metrics_user_id": [], "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": []}} \ No newline at end of file diff --git a/docs/run_results.json b/docs/run_results.json new file mode 100644 index 0000000..1631246 --- /dev/null +++ b/docs/run_results.json @@ -0,0 +1 @@ +{"metadata": {"dbt_schema_version": "https://schemas.getdbt.com/dbt/run-results/v1.json", "dbt_version": "0.19.0", "generated_at": "2021-03-22T23:02:02.144660Z", "invocation_id": "c669a45a-6fb5-4d1b-95ec-69df50a34cf9", "env": {}}, "results": [{"status": "success", "timing": [{"name": "compile", "started_at": "2021-03-22T23:01:58.796584Z", "completed_at": "2021-03-22T23:01:58.830869Z"}, {"name": "execute", "started_at": "2021-03-22T23:01:58.832579Z", "completed_at": "2021-03-22T23:01:58.832597Z"}], "thread_id": "Thread-2", "execution_time": 0.03826117515563965, "message": null, "adapter_response": {}, "unique_id": "seed.asana_integration_tests.project_task_data"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2021-03-22T23:01:58.795906Z", "completed_at": "2021-03-22T23:01:58.832093Z"}, {"name": "execute", "started_at": "2021-03-22T23:01:58.832978Z", "completed_at": "2021-03-22T23:01:58.832986Z"}], "thread_id": "Thread-1", "execution_time": 0.04466414451599121, "message": null, "adapter_response": {}, "unique_id": "seed.asana_integration_tests.project_data"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2021-03-22T23:01:58.796829Z", "completed_at": "2021-03-22T23:01:58.832334Z"}, {"name": "execute", "started_at": "2021-03-22T23:01:58.833230Z", "completed_at": "2021-03-22T23:01:58.833238Z"}], "thread_id": "Thread-3", "execution_time": 0.044837236404418945, "message": null, "adapter_response": {}, "unique_id": "seed.asana_integration_tests.section_data"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2021-03-22T23:01:58.832836Z", "completed_at": "2021-03-22T23:01:58.841430Z"}, {"name": "execute", "started_at": "2021-03-22T23:01:58.842619Z", "completed_at": "2021-03-22T23:01:58.842627Z"}], "thread_id": "Thread-4", "execution_time": 0.04743194580078125, "message": null, "adapter_response": {}, "unique_id": "seed.asana_integration_tests.story_data"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2021-03-22T23:01:58.843253Z", "completed_at": "2021-03-22T23:01:58.861981Z"}, {"name": "execute", "started_at": "2021-03-22T23:01:58.862927Z", "completed_at": "2021-03-22T23:01:58.862934Z"}], "thread_id": "Thread-1", "execution_time": 0.02161693572998047, "message": null, "adapter_response": {}, "unique_id": "seed.asana_integration_tests.task_data"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2021-03-22T23:01:58.843131Z", "completed_at": "2021-03-22T23:01:58.862235Z"}, {"name": "execute", "started_at": "2021-03-22T23:01:58.863127Z", "completed_at": "2021-03-22T23:01:58.863133Z"}], "thread_id": "Thread-2", "execution_time": 0.022339820861816406, "message": null, "adapter_response": {}, "unique_id": "seed.asana_integration_tests.tag_data"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2021-03-22T23:01:58.843641Z", "completed_at": "2021-03-22T23:01:58.862656Z"}, {"name": "execute", "started_at": "2021-03-22T23:01:58.863617Z", "completed_at": "2021-03-22T23:01:58.863637Z"}], "thread_id": "Thread-3", "execution_time": 0.02672290802001953, "message": null, "adapter_response": {}, "unique_id": "seed.asana_integration_tests.task_follower_data"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2021-03-22T23:01:58.863424Z", "completed_at": "2021-03-22T23:01:58.870220Z"}, {"name": "execute", "started_at": "2021-03-22T23:01:58.871159Z", "completed_at": "2021-03-22T23:01:58.871165Z"}], "thread_id": "Thread-4", "execution_time": 0.009440183639526367, "message": null, "adapter_response": {}, "unique_id": "seed.asana_integration_tests.task_section_data"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2021-03-22T23:01:58.871580Z", "completed_at": "2021-03-22T23:01:58.887787Z"}, {"name": "execute", "started_at": "2021-03-22T23:01:58.889587Z", "completed_at": "2021-03-22T23:01:58.889594Z"}], "thread_id": "Thread-1", "execution_time": 0.019683122634887695, "message": null, "adapter_response": {}, "unique_id": "seed.asana_integration_tests.task_tag_data"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2021-03-22T23:01:58.871672Z", "completed_at": "2021-03-22T23:01:58.889102Z"}, {"name": "execute", "started_at": "2021-03-22T23:01:58.889988Z", "completed_at": "2021-03-22T23:01:58.889995Z"}], "thread_id": "Thread-2", "execution_time": 0.019973039627075195, "message": null, "adapter_response": {}, "unique_id": "seed.asana_integration_tests.user_data"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2021-03-22T23:01:58.871992Z", "completed_at": "2021-03-22T23:01:58.889794Z"}, {"name": "execute", "started_at": "2021-03-22T23:01:58.890526Z", "completed_at": "2021-03-22T23:01:58.890532Z"}], "thread_id": "Thread-3", "execution_time": 0.03271818161010742, "message": null, "adapter_response": {}, "unique_id": "seed.asana_integration_tests.team_data"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2021-03-22T23:01:58.890179Z", "completed_at": "2021-03-22T23:01:58.918555Z"}, {"name": "execute", "started_at": "2021-03-22T23:01:58.928971Z", "completed_at": "2021-03-22T23:01:58.928980Z"}], "thread_id": "Thread-4", "execution_time": 0.040760040283203125, "message": null, "adapter_response": {}, "unique_id": "model.asana_source.stg_asana__project_task_tmp"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2021-03-22T23:01:58.905340Z", "completed_at": "2021-03-22T23:01:58.929291Z"}, {"name": "execute", "started_at": "2021-03-22T23:01:58.930375Z", "completed_at": "2021-03-22T23:01:58.930396Z"}], "thread_id": "Thread-1", "execution_time": 0.02689218521118164, "message": null, "adapter_response": {}, "unique_id": "model.asana_source.stg_asana__project_tmp"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2021-03-22T23:01:58.913074Z", "completed_at": "2021-03-22T23:01:58.930906Z"}, {"name": "execute", "started_at": "2021-03-22T23:01:58.932044Z", "completed_at": "2021-03-22T23:01:58.932050Z"}], "thread_id": "Thread-3", "execution_time": 0.027478933334350586, "message": null, "adapter_response": {}, "unique_id": "model.asana_source.stg_asana__story_tmp"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2021-03-22T23:01:58.905730Z", "completed_at": "2021-03-22T23:01:58.931568Z"}, {"name": "execute", "started_at": "2021-03-22T23:01:58.932382Z", "completed_at": "2021-03-22T23:01:58.932387Z"}], "thread_id": "Thread-2", "execution_time": 0.02841496467590332, "message": null, "adapter_response": {}, "unique_id": "model.asana_source.stg_asana__section_tmp"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2021-03-22T23:01:58.932731Z", "completed_at": "2021-03-22T23:01:58.950950Z"}, {"name": "execute", "started_at": "2021-03-22T23:01:58.951450Z", "completed_at": "2021-03-22T23:01:58.951458Z"}], "thread_id": "Thread-4", "execution_time": 0.036396026611328125, "message": null, "adapter_response": {}, "unique_id": "model.asana_source.stg_asana__tag_tmp"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2021-03-22T23:01:58.941711Z", "completed_at": "2021-03-22T23:01:58.965926Z"}, {"name": "execute", "started_at": "2021-03-22T23:01:58.968458Z", "completed_at": "2021-03-22T23:01:58.968466Z"}], "thread_id": "Thread-1", "execution_time": 0.03608512878417969, "message": null, "adapter_response": {}, "unique_id": "model.asana_source.stg_asana__task_tmp"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2021-03-22T23:01:58.951331Z", "completed_at": "2021-03-22T23:01:58.970096Z"}, {"name": "execute", "started_at": "2021-03-22T23:01:58.971014Z", "completed_at": "2021-03-22T23:01:58.971020Z"}], "thread_id": "Thread-2", "execution_time": 0.02882099151611328, "message": null, "adapter_response": {}, "unique_id": "model.asana_source.stg_asana__task_section_tmp"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2021-03-22T23:01:58.951137Z", "completed_at": "2021-03-22T23:01:58.970260Z"}, {"name": "execute", "started_at": "2021-03-22T23:01:58.971231Z", "completed_at": "2021-03-22T23:01:58.971237Z"}], "thread_id": "Thread-3", "execution_time": 0.037539005279541016, "message": null, "adapter_response": {}, "unique_id": "model.asana_source.stg_asana__task_follower_tmp"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2021-03-22T23:01:58.970452Z", "completed_at": "2021-03-22T23:01:58.988207Z"}, {"name": "execute", "started_at": "2021-03-22T23:01:58.989558Z", "completed_at": "2021-03-22T23:01:58.989567Z"}], "thread_id": "Thread-4", "execution_time": 0.02133011817932129, "message": null, "adapter_response": {}, "unique_id": "model.asana_source.stg_asana__task_tag_tmp"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2021-03-22T23:01:58.979277Z", "completed_at": "2021-03-22T23:01:58.989262Z"}, {"name": "execute", "started_at": "2021-03-22T23:01:58.990557Z", "completed_at": "2021-03-22T23:01:58.990563Z"}], "thread_id": "Thread-1", "execution_time": 0.02851390838623047, "message": null, "adapter_response": {}, "unique_id": "model.asana_source.stg_asana__user_tmp"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2021-03-22T23:01:58.990424Z", "completed_at": "2021-03-22T23:01:59.012188Z"}, {"name": "execute", "started_at": "2021-03-22T23:01:59.013417Z", "completed_at": "2021-03-22T23:01:59.013438Z"}], "thread_id": "Thread-2", "execution_time": 0.05257129669189453, "message": null, "adapter_response": {}, "unique_id": "model.asana_source.stg_asana__team_tmp"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2021-03-22T23:01:58.990983Z", "completed_at": "2021-03-22T23:01:59.157087Z"}, {"name": "execute", "started_at": "2021-03-22T23:01:59.157395Z", "completed_at": "2021-03-22T23:01:59.157408Z"}], "thread_id": "Thread-3", "execution_time": 0.16792869567871094, "message": null, "adapter_response": {}, "unique_id": "model.asana_source.stg_asana__project_task"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2021-03-22T23:01:59.013219Z", "completed_at": "2021-03-22T23:01:59.184353Z"}, {"name": "execute", "started_at": "2021-03-22T23:01:59.184636Z", "completed_at": "2021-03-22T23:01:59.184647Z"}], "thread_id": "Thread-1", "execution_time": 0.17304182052612305, "message": null, "adapter_response": {}, "unique_id": "model.asana_source.stg_asana__story"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2021-03-22T23:01:59.012393Z", "completed_at": "2021-03-22T23:01:59.211101Z"}, {"name": "execute", "started_at": "2021-03-22T23:01:59.212247Z", "completed_at": "2021-03-22T23:01:59.212261Z"}], "thread_id": "Thread-4", "execution_time": 0.20144104957580566, "message": null, "adapter_response": {}, "unique_id": "model.asana_source.stg_asana__project"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2021-03-22T23:01:59.045391Z", "completed_at": "2021-03-22T23:01:59.213297Z"}, {"name": "execute", "started_at": "2021-03-22T23:01:59.215658Z", "completed_at": "2021-03-22T23:01:59.215667Z"}], "thread_id": "Thread-2", "execution_time": 0.17259502410888672, "message": null, "adapter_response": {}, "unique_id": "model.asana_source.stg_asana__section"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2021-03-22T23:01:59.158878Z", "completed_at": "2021-03-22T23:01:59.329070Z"}, {"name": "execute", "started_at": "2021-03-22T23:01:59.329413Z", "completed_at": "2021-03-22T23:01:59.329426Z"}], "thread_id": "Thread-3", "execution_time": 0.17143988609313965, "message": null, "adapter_response": {}, "unique_id": "model.asana_source.stg_asana__tag"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2021-03-22T23:01:59.213212Z", "completed_at": "2021-03-22T23:01:59.349674Z"}, {"name": "execute", "started_at": "2021-03-22T23:01:59.350062Z", "completed_at": "2021-03-22T23:01:59.350075Z"}], "thread_id": "Thread-4", "execution_time": 0.13761615753173828, "message": null, "adapter_response": {}, "unique_id": "model.asana_source.stg_asana__task_follower"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2021-03-22T23:01:59.185827Z", "completed_at": "2021-03-22T23:01:59.377798Z"}, {"name": "execute", "started_at": "2021-03-22T23:01:59.378344Z", "completed_at": "2021-03-22T23:01:59.378355Z"}], "thread_id": "Thread-1", "execution_time": 0.19384503364562988, "message": null, "adapter_response": {}, "unique_id": "model.asana_source.stg_asana__task"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2021-03-22T23:01:59.227656Z", "completed_at": "2021-03-22T23:01:59.378571Z"}, {"name": "execute", "started_at": "2021-03-22T23:01:59.379368Z", "completed_at": "2021-03-22T23:01:59.379376Z"}], "thread_id": "Thread-2", "execution_time": 0.15777111053466797, "message": null, "adapter_response": {}, "unique_id": "model.asana_source.stg_asana__task_section"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2021-03-22T23:01:59.385845Z", "completed_at": "2021-03-22T23:01:59.412878Z"}, {"name": "execute", "started_at": "2021-03-22T23:01:59.413186Z", "completed_at": "2021-03-22T23:01:59.413199Z"}], "thread_id": "Thread-2", "execution_time": 0.032733917236328125, "message": null, "adapter_response": {}, "unique_id": "test.asana_source.not_null_stg_asana__project_task_project_id"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2021-03-22T23:01:59.415553Z", "completed_at": "2021-03-22T23:01:59.428271Z"}, {"name": "execute", "started_at": "2021-03-22T23:01:59.428647Z", "completed_at": "2021-03-22T23:01:59.428658Z"}], "thread_id": "Thread-2", "execution_time": 0.01394033432006836, "message": null, "adapter_response": {}, "unique_id": "test.asana_source.not_null_stg_asana__project_task_task_id"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2021-03-22T23:01:59.429834Z", "completed_at": "2021-03-22T23:01:59.439735Z"}, {"name": "execute", "started_at": "2021-03-22T23:01:59.440127Z", "completed_at": "2021-03-22T23:01:59.440138Z"}], "thread_id": "Thread-2", "execution_time": 0.011220932006835938, "message": null, "adapter_response": {}, "unique_id": "test.asana_source.not_null_stg_asana__story_story_id"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2021-03-22T23:01:59.441840Z", "completed_at": "2021-03-22T23:01:59.454100Z"}, {"name": "execute", "started_at": "2021-03-22T23:01:59.454704Z", "completed_at": "2021-03-22T23:01:59.454718Z"}], "thread_id": "Thread-2", "execution_time": 0.01390218734741211, "message": null, "adapter_response": {}, "unique_id": "test.asana_source.not_null_stg_asana__story_target_task_id"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2021-03-22T23:01:59.457232Z", "completed_at": "2021-03-22T23:01:59.467872Z"}, {"name": "execute", "started_at": "2021-03-22T23:01:59.468155Z", "completed_at": "2021-03-22T23:01:59.468166Z"}], "thread_id": "Thread-2", "execution_time": 0.012024879455566406, "message": null, "adapter_response": {}, "unique_id": "test.asana_source.unique_stg_asana__story_story_id"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2021-03-22T23:01:59.469314Z", "completed_at": "2021-03-22T23:01:59.479591Z"}, {"name": "execute", "started_at": "2021-03-22T23:01:59.480036Z", "completed_at": "2021-03-22T23:01:59.480047Z"}], "thread_id": "Thread-2", "execution_time": 0.011389970779418945, "message": null, "adapter_response": {}, "unique_id": "test.asana_source.not_null_stg_asana__project_project_id"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2021-03-22T23:01:59.481309Z", "completed_at": "2021-03-22T23:01:59.491976Z"}, {"name": "execute", "started_at": "2021-03-22T23:01:59.492213Z", "completed_at": "2021-03-22T23:01:59.492222Z"}], "thread_id": "Thread-2", "execution_time": 0.011691093444824219, "message": null, "adapter_response": {}, "unique_id": "test.asana_source.unique_stg_asana__project_project_id"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2021-03-22T23:01:59.493144Z", "completed_at": "2021-03-22T23:01:59.503873Z"}, {"name": "execute", "started_at": "2021-03-22T23:01:59.504149Z", "completed_at": "2021-03-22T23:01:59.504160Z"}], "thread_id": "Thread-2", "execution_time": 0.011722087860107422, "message": null, "adapter_response": {}, "unique_id": "test.asana_source.not_null_stg_asana__section_section_id"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2021-03-22T23:01:59.505240Z", "completed_at": "2021-03-22T23:01:59.514578Z"}, {"name": "execute", "started_at": "2021-03-22T23:01:59.514835Z", "completed_at": "2021-03-22T23:01:59.514845Z"}], "thread_id": "Thread-2", "execution_time": 0.010293960571289062, "message": null, "adapter_response": {}, "unique_id": "test.asana_source.unique_stg_asana__section_section_id"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2021-03-22T23:01:59.515961Z", "completed_at": "2021-03-22T23:01:59.525046Z"}, {"name": "execute", "started_at": "2021-03-22T23:01:59.525299Z", "completed_at": "2021-03-22T23:01:59.525308Z"}], "thread_id": "Thread-2", "execution_time": 0.00998687744140625, "message": null, "adapter_response": {}, "unique_id": "test.asana_source.not_null_stg_asana__tag_tag_id"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2021-03-22T23:01:59.526204Z", "completed_at": "2021-03-22T23:01:59.535249Z"}, {"name": "execute", "started_at": "2021-03-22T23:01:59.535506Z", "completed_at": "2021-03-22T23:01:59.535515Z"}], "thread_id": "Thread-2", "execution_time": 0.009891986846923828, "message": null, "adapter_response": {}, "unique_id": "test.asana_source.unique_stg_asana__tag_tag_id"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2021-03-22T23:01:59.536562Z", "completed_at": "2021-03-22T23:01:59.545156Z"}, {"name": "execute", "started_at": "2021-03-22T23:01:59.545375Z", "completed_at": "2021-03-22T23:01:59.545383Z"}], "thread_id": "Thread-2", "execution_time": 0.009380102157592773, "message": null, "adapter_response": {}, "unique_id": "test.asana_source.not_null_stg_asana__task_follower_task_id"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2021-03-22T23:01:59.546247Z", "completed_at": "2021-03-22T23:01:59.557960Z"}, {"name": "execute", "started_at": "2021-03-22T23:01:59.558279Z", "completed_at": "2021-03-22T23:01:59.558290Z"}], "thread_id": "Thread-2", "execution_time": 0.012737035751342773, "message": null, "adapter_response": {}, "unique_id": "test.asana_source.not_null_stg_asana__task_follower_user_id"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2021-03-22T23:01:59.559203Z", "completed_at": "2021-03-22T23:01:59.568304Z"}, {"name": "execute", "started_at": "2021-03-22T23:01:59.568550Z", "completed_at": "2021-03-22T23:01:59.568559Z"}], "thread_id": "Thread-2", "execution_time": 0.009945154190063477, "message": null, "adapter_response": {}, "unique_id": "test.asana_source.not_null_stg_asana__task_task_id"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2021-03-22T23:01:59.569435Z", "completed_at": "2021-03-22T23:01:59.578562Z"}, {"name": "execute", "started_at": "2021-03-22T23:01:59.578812Z", "completed_at": "2021-03-22T23:01:59.578821Z"}], "thread_id": "Thread-2", "execution_time": 0.009974002838134766, "message": null, "adapter_response": {}, "unique_id": "test.asana_source.unique_stg_asana__task_task_id"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2021-03-22T23:01:59.595663Z", "completed_at": "2021-03-22T23:01:59.605536Z"}, {"name": "execute", "started_at": "2021-03-22T23:01:59.605801Z", "completed_at": "2021-03-22T23:01:59.605812Z"}], "thread_id": "Thread-2", "execution_time": 0.010770797729492188, "message": null, "adapter_response": {}, "unique_id": "test.asana_source.not_null_stg_asana__task_section_section_id"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2021-03-22T23:01:59.606714Z", "completed_at": "2021-03-22T23:01:59.616076Z"}, {"name": "execute", "started_at": "2021-03-22T23:01:59.616335Z", "completed_at": "2021-03-22T23:01:59.616345Z"}], "thread_id": "Thread-2", "execution_time": 0.010247230529785156, "message": null, "adapter_response": {}, "unique_id": "test.asana_source.not_null_stg_asana__task_section_task_id"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2021-03-22T23:01:59.617236Z", "completed_at": "2021-03-22T23:01:59.629178Z"}, {"name": "execute", "started_at": "2021-03-22T23:01:59.629418Z", "completed_at": "2021-03-22T23:01:59.629426Z"}], "thread_id": "Thread-2", "execution_time": 0.012775182723999023, "message": null, "adapter_response": {}, "unique_id": "test.asana.not_null_int_asana__task_projects_task_id"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2021-03-22T23:01:59.630285Z", "completed_at": "2021-03-22T23:01:59.644435Z"}, {"name": "execute", "started_at": "2021-03-22T23:01:59.644684Z", "completed_at": "2021-03-22T23:01:59.644693Z"}], "thread_id": "Thread-2", "execution_time": 0.014999866485595703, "message": null, "adapter_response": {}, "unique_id": "test.asana.unique_int_asana__task_projects_task_id"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2021-03-22T23:01:59.330534Z", "completed_at": "2021-03-22T23:01:59.714921Z"}, {"name": "execute", "started_at": "2021-03-22T23:01:59.715398Z", "completed_at": "2021-03-22T23:01:59.715412Z"}], "thread_id": "Thread-3", "execution_time": 0.3856770992279053, "message": null, "adapter_response": {}, "unique_id": "model.asana_source.stg_asana__task_tag"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2021-03-22T23:01:59.380939Z", "completed_at": "2021-03-22T23:01:59.716300Z"}, {"name": "execute", "started_at": "2021-03-22T23:01:59.717039Z", "completed_at": "2021-03-22T23:01:59.717048Z"}], "thread_id": "Thread-1", "execution_time": 0.33757710456848145, "message": null, "adapter_response": {}, "unique_id": "model.asana_source.stg_asana__team"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2021-03-22T23:01:59.351333Z", "completed_at": "2021-03-22T23:01:59.716719Z"}, {"name": "execute", "started_at": "2021-03-22T23:01:59.717481Z", "completed_at": "2021-03-22T23:01:59.717491Z"}], "thread_id": "Thread-4", "execution_time": 0.3677680492401123, "message": null, "adapter_response": {}, "unique_id": "model.asana_source.stg_asana__user"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2021-03-22T23:01:59.720094Z", "completed_at": "2021-03-22T23:01:59.758149Z"}, {"name": "execute", "started_at": "2021-03-22T23:01:59.762800Z", "completed_at": "2021-03-22T23:01:59.762813Z"}], "thread_id": "Thread-3", "execution_time": 0.045089006423950195, "message": null, "adapter_response": {}, "unique_id": "test.asana_source.not_null_stg_asana__task_tag_tag_id"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2021-03-22T23:01:59.743310Z", "completed_at": "2021-03-22T23:01:59.763508Z"}, {"name": "execute", "started_at": "2021-03-22T23:01:59.764747Z", "completed_at": "2021-03-22T23:01:59.764754Z"}], "thread_id": "Thread-1", "execution_time": 0.04565691947937012, "message": null, "adapter_response": {}, "unique_id": "test.asana_source.not_null_stg_asana__task_tag_task_id"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2021-03-22T23:01:59.743433Z", "completed_at": "2021-03-22T23:01:59.764499Z"}, {"name": "execute", "started_at": "2021-03-22T23:01:59.765629Z", "completed_at": "2021-03-22T23:01:59.765639Z"}], "thread_id": "Thread-4", "execution_time": 0.03550601005554199, "message": null, "adapter_response": {}, "unique_id": "test.asana_source.not_null_stg_asana__team_team_id"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2021-03-22T23:01:59.767349Z", "completed_at": "2021-03-22T23:01:59.799071Z"}, {"name": "execute", "started_at": "2021-03-22T23:01:59.813493Z", "completed_at": "2021-03-22T23:01:59.813528Z"}], "thread_id": "Thread-3", "execution_time": 0.0545659065246582, "message": null, "adapter_response": {}, "unique_id": "test.asana_source.unique_stg_asana__team_team_id"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2021-03-22T23:01:59.823799Z", "completed_at": "2021-03-22T23:01:59.839902Z"}, {"name": "execute", "started_at": "2021-03-22T23:01:59.858346Z", "completed_at": "2021-03-22T23:01:59.858358Z"}], "thread_id": "Thread-3", "execution_time": 0.049865007400512695, "message": null, "adapter_response": {}, "unique_id": "test.asana_source.not_null_stg_asana__user_user_id"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2021-03-22T23:01:59.833946Z", "completed_at": "2021-03-22T23:01:59.871930Z"}, {"name": "execute", "started_at": "2021-03-22T23:01:59.872676Z", "completed_at": "2021-03-22T23:01:59.872685Z"}], "thread_id": "Thread-2", "execution_time": 0.049407005310058594, "message": null, "adapter_response": {}, "unique_id": "test.asana_source.unique_stg_asana__user_user_id"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2021-03-22T23:01:59.834200Z", "completed_at": "2021-03-22T23:01:59.873245Z"}, {"name": "execute", "started_at": "2021-03-22T23:01:59.874296Z", "completed_at": "2021-03-22T23:01:59.874303Z"}], "thread_id": "Thread-1", "execution_time": 0.05098915100097656, "message": null, "adapter_response": {}, "unique_id": "test.asana.not_null_int_asana__task_tags_task_id"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2021-03-22T23:01:59.855928Z", "completed_at": "2021-03-22T23:01:59.873798Z"}, {"name": "execute", "started_at": "2021-03-22T23:01:59.874886Z", "completed_at": "2021-03-22T23:01:59.874895Z"}], "thread_id": "Thread-4", "execution_time": 0.04158306121826172, "message": null, "adapter_response": {}, "unique_id": "test.asana.unique_int_asana__task_tags_task_id"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2021-03-22T23:01:59.901107Z", "completed_at": "2021-03-22T23:01:59.928783Z"}, {"name": "execute", "started_at": "2021-03-22T23:01:59.929692Z", "completed_at": "2021-03-22T23:01:59.929700Z"}], "thread_id": "Thread-1", "execution_time": 0.055338144302368164, "message": null, "adapter_response": {}, "unique_id": "test.asana.not_null_int_asana__task_assignee_task_id"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2021-03-22T23:01:59.901241Z", "completed_at": "2021-03-22T23:01:59.929171Z"}, {"name": "execute", "started_at": "2021-03-22T23:01:59.930207Z", "completed_at": "2021-03-22T23:01:59.930215Z"}], "thread_id": "Thread-4", "execution_time": 0.04905533790588379, "message": null, "adapter_response": {}, "unique_id": "test.asana.unique_int_asana__task_assignee_task_id"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2021-03-22T23:01:59.929501Z", "completed_at": "2021-03-22T23:01:59.958807Z"}, {"name": "execute", "started_at": "2021-03-22T23:01:59.959826Z", "completed_at": "2021-03-22T23:01:59.959836Z"}], "thread_id": "Thread-3", "execution_time": 0.03218698501586914, "message": null, "adapter_response": {}, "unique_id": "test.asana.not_null_int_asana__task_followers_task_id"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2021-03-22T23:01:59.942913Z", "completed_at": "2021-03-22T23:01:59.960877Z"}, {"name": "execute", "started_at": "2021-03-22T23:01:59.971488Z", "completed_at": "2021-03-22T23:01:59.971499Z"}], "thread_id": "Thread-2", "execution_time": 0.05254387855529785, "message": null, "adapter_response": {}, "unique_id": "test.asana.unique_int_asana__task_followers_task_id"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2021-03-22T23:01:59.999017Z", "completed_at": "2021-03-22T23:02:00.015452Z"}, {"name": "execute", "started_at": "2021-03-22T23:02:00.027555Z", "completed_at": "2021-03-22T23:02:00.027585Z"}], "thread_id": "Thread-2", "execution_time": 0.04689502716064453, "message": null, "adapter_response": {}, "unique_id": "test.asana.not_null_int_asana__task_story_story_id"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2021-03-22T23:02:00.015321Z", "completed_at": "2021-03-22T23:02:00.042715Z"}, {"name": "execute", "started_at": "2021-03-22T23:02:00.057443Z", "completed_at": "2021-03-22T23:02:00.057457Z"}], "thread_id": "Thread-1", "execution_time": 0.0443878173828125, "message": null, "adapter_response": {}, "unique_id": "test.asana.unique_int_asana__task_story_story_id"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2021-03-22T23:02:00.015675Z", "completed_at": "2021-03-22T23:02:00.048096Z"}, {"name": "execute", "started_at": "2021-03-22T23:02:00.057737Z", "completed_at": "2021-03-22T23:02:00.057745Z"}], "thread_id": "Thread-4", "execution_time": 0.04418373107910156, "message": null, "adapter_response": {}, "unique_id": "test.asana.not_null_int_asana__subtask_parent_subtask_id"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2021-03-22T23:02:00.042172Z", "completed_at": "2021-03-22T23:02:00.058934Z"}, {"name": "execute", "started_at": "2021-03-22T23:02:00.075598Z", "completed_at": "2021-03-22T23:02:00.075609Z"}], "thread_id": "Thread-3", "execution_time": 0.041429996490478516, "message": null, "adapter_response": {}, "unique_id": "test.asana.unique_int_asana__subtask_parent_subtask_id"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2021-03-22T23:02:00.057984Z", "completed_at": "2021-03-22T23:02:00.076910Z"}, {"name": "execute", "started_at": "2021-03-22T23:02:00.077707Z", "completed_at": "2021-03-22T23:02:00.077715Z"}], "thread_id": "Thread-2", "execution_time": 0.05393791198730469, "message": null, "adapter_response": {}, "unique_id": "test.asana.dbt_utils_unique_combination_of_columns_int_asana__project_user_project_id__user_id__role__currently_working_on"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2021-03-22T23:02:00.077180Z", "completed_at": "2021-03-22T23:02:00.109241Z"}, {"name": "execute", "started_at": "2021-03-22T23:02:00.122331Z", "completed_at": "2021-03-22T23:02:00.122341Z"}], "thread_id": "Thread-1", "execution_time": 0.04719901084899902, "message": null, "adapter_response": {}, "unique_id": "test.asana.not_null_int_asana__task_comments_task_id"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2021-03-22T23:02:00.077326Z", "completed_at": "2021-03-22T23:02:00.122043Z"}, {"name": "execute", "started_at": "2021-03-22T23:02:00.122798Z", "completed_at": "2021-03-22T23:02:00.122806Z"}], "thread_id": "Thread-4", "execution_time": 0.052582740783691406, "message": null, "adapter_response": {}, "unique_id": "test.asana.unique_int_asana__task_comments_task_id"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2021-03-22T23:02:00.108884Z", "completed_at": "2021-03-22T23:02:00.123332Z"}, {"name": "execute", "started_at": "2021-03-22T23:02:00.137413Z", "completed_at": "2021-03-22T23:02:00.137423Z"}], "thread_id": "Thread-3", "execution_time": 0.03076314926147461, "message": null, "adapter_response": {}, "unique_id": "test.asana.not_null_int_asana__task_first_modifier_task_id"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2021-03-22T23:02:00.122665Z", "completed_at": "2021-03-22T23:02:00.138670Z"}, {"name": "execute", "started_at": "2021-03-22T23:02:00.139467Z", "completed_at": "2021-03-22T23:02:00.139475Z"}], "thread_id": "Thread-2", "execution_time": 0.054396867752075195, "message": null, "adapter_response": {}, "unique_id": "test.asana.unique_int_asana__task_first_modifier_task_id"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2021-03-22T23:02:00.139197Z", "completed_at": "2021-03-22T23:02:00.251250Z"}, {"name": "execute", "started_at": "2021-03-22T23:02:00.252247Z", "completed_at": "2021-03-22T23:02:00.252263Z"}], "thread_id": "Thread-1", "execution_time": 0.11582207679748535, "message": null, "adapter_response": {}, "unique_id": "model.asana.asana__task"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2021-03-22T23:02:00.139768Z", "completed_at": "2021-03-22T23:02:00.251803Z"}, {"name": "execute", "started_at": "2021-03-22T23:02:00.253049Z", "completed_at": "2021-03-22T23:02:00.253067Z"}], "thread_id": "Thread-4", "execution_time": 0.11579513549804688, "message": null, "adapter_response": {}, "unique_id": "test.asana.not_null_int_asana__task_open_length_task_id"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2021-03-22T23:02:00.223471Z", "completed_at": "2021-03-22T23:02:00.252676Z"}, {"name": "execute", "started_at": "2021-03-22T23:02:00.254160Z", "completed_at": "2021-03-22T23:02:00.254169Z"}], "thread_id": "Thread-3", "execution_time": 0.09837889671325684, "message": null, "adapter_response": {}, "unique_id": "test.asana.unique_int_asana__task_open_length_task_id"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2021-03-22T23:02:00.258684Z", "completed_at": "2021-03-22T23:02:00.321950Z"}, {"name": "execute", "started_at": "2021-03-22T23:02:00.323886Z", "completed_at": "2021-03-22T23:02:00.323895Z"}], "thread_id": "Thread-3", "execution_time": 0.06779026985168457, "message": null, "adapter_response": {}, "unique_id": "model.asana.asana__tag"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2021-03-22T23:02:00.326653Z", "completed_at": "2021-03-22T23:02:00.421160Z"}, {"name": "execute", "started_at": "2021-03-22T23:02:00.448643Z", "completed_at": "2021-03-22T23:02:00.448666Z"}], "thread_id": "Thread-2", "execution_time": 0.14197683334350586, "message": null, "adapter_response": {}, "unique_id": "test.asana.unique_asana__task_task_id"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2021-03-22T23:02:00.398199Z", "completed_at": "2021-03-22T23:02:00.480550Z"}, {"name": "execute", "started_at": "2021-03-22T23:02:00.480822Z", "completed_at": "2021-03-22T23:02:00.480832Z"}], "thread_id": "Thread-3", "execution_time": 0.09599804878234863, "message": null, "adapter_response": {}, "unique_id": "model.asana.asana__project"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2021-03-22T23:02:00.468915Z", "completed_at": "2021-03-22T23:02:00.494017Z"}, {"name": "execute", "started_at": "2021-03-22T23:02:00.496191Z", "completed_at": "2021-03-22T23:02:00.496203Z"}], "thread_id": "Thread-2", "execution_time": 0.028536081314086914, "message": null, "adapter_response": {}, "unique_id": "test.asana.not_null_int_asana__project_task_metrics_project_id"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2021-03-22T23:02:00.481752Z", "completed_at": "2021-03-22T23:02:00.498733Z"}, {"name": "execute", "started_at": "2021-03-22T23:02:00.520394Z", "completed_at": "2021-03-22T23:02:00.520407Z"}], "thread_id": "Thread-3", "execution_time": 0.05506110191345215, "message": null, "adapter_response": {}, "unique_id": "test.asana.unique_int_asana__project_task_metrics_project_id"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2021-03-22T23:02:00.498519Z", "completed_at": "2021-03-22T23:02:00.538286Z"}, {"name": "execute", "started_at": "2021-03-22T23:02:00.540048Z", "completed_at": "2021-03-22T23:02:00.540056Z"}], "thread_id": "Thread-2", "execution_time": 0.04887580871582031, "message": null, "adapter_response": {}, "unique_id": "model.asana.asana__user"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2021-03-22T23:02:00.326196Z", "completed_at": "2021-03-22T23:02:00.580346Z"}, {"name": "execute", "started_at": "2021-03-22T23:02:00.580641Z", "completed_at": "2021-03-22T23:02:00.580653Z"}], "thread_id": "Thread-4", "execution_time": 0.25611376762390137, "message": null, "adapter_response": {}, "unique_id": "test.asana.not_null_asana__task_task_id"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2021-03-22T23:02:00.565851Z", "completed_at": "2021-03-22T23:02:00.581767Z"}, {"name": "execute", "started_at": "2021-03-22T23:02:00.582339Z", "completed_at": "2021-03-22T23:02:00.582347Z"}], "thread_id": "Thread-2", "execution_time": 0.027418136596679688, "message": null, "adapter_response": {}, "unique_id": "test.asana.unique_int_asana__user_task_metrics_user_id"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2021-03-22T23:02:00.540270Z", "completed_at": "2021-03-22T23:02:00.582102Z"}, {"name": "execute", "started_at": "2021-03-22T23:02:00.587963Z", "completed_at": "2021-03-22T23:02:00.587977Z"}], "thread_id": "Thread-3", "execution_time": 0.054559946060180664, "message": null, "adapter_response": {}, "unique_id": "test.asana.not_null_int_asana__user_task_metrics_user_id"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2021-03-22T23:02:00.582018Z", "completed_at": "2021-03-22T23:02:00.594151Z"}, {"name": "execute", "started_at": "2021-03-22T23:02:00.594765Z", "completed_at": "2021-03-22T23:02:00.594773Z"}], "thread_id": "Thread-4", "execution_time": 0.023262977600097656, "message": null, "adapter_response": {}, "unique_id": "test.asana.not_null_asana__tag_tag_id"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2021-03-22T23:02:00.594640Z", "completed_at": "2021-03-22T23:02:00.621753Z"}, {"name": "execute", "started_at": "2021-03-22T23:02:00.622391Z", "completed_at": "2021-03-22T23:02:00.622405Z"}], "thread_id": "Thread-2", "execution_time": 0.029085874557495117, "message": null, "adapter_response": {}, "unique_id": "test.asana.unique_asana__tag_tag_id"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2021-03-22T23:02:00.594999Z", "completed_at": "2021-03-22T23:02:00.629414Z"}, {"name": "execute", "started_at": "2021-03-22T23:02:00.632773Z", "completed_at": "2021-03-22T23:02:00.632783Z"}], "thread_id": "Thread-3", "execution_time": 0.03934907913208008, "message": null, "adapter_response": {}, "unique_id": "model.asana.asana__team"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2021-03-22T23:02:00.622706Z", "completed_at": "2021-03-22T23:02:00.639455Z"}, {"name": "execute", "started_at": "2021-03-22T23:02:00.644194Z", "completed_at": "2021-03-22T23:02:00.644204Z"}], "thread_id": "Thread-4", "execution_time": 0.02289581298828125, "message": null, "adapter_response": {}, "unique_id": "test.asana.not_null_asana__project_project_id"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2021-03-22T23:02:00.634013Z", "completed_at": "2021-03-22T23:02:00.650913Z"}, {"name": "execute", "started_at": "2021-03-22T23:02:00.655288Z", "completed_at": "2021-03-22T23:02:00.655299Z"}], "thread_id": "Thread-2", "execution_time": 0.022995948791503906, "message": null, "adapter_response": {}, "unique_id": "test.asana.unique_asana__project_project_id"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2021-03-22T23:02:00.644557Z", "completed_at": "2021-03-22T23:02:00.656553Z"}, {"name": "execute", "started_at": "2021-03-22T23:02:00.662870Z", "completed_at": "2021-03-22T23:02:00.662882Z"}], "thread_id": "Thread-3", "execution_time": 0.02348613739013672, "message": null, "adapter_response": {}, "unique_id": "test.asana.not_null_asana__user_user_id"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2021-03-22T23:02:00.656370Z", "completed_at": "2021-03-22T23:02:00.677298Z"}, {"name": "execute", "started_at": "2021-03-22T23:02:00.678001Z", "completed_at": "2021-03-22T23:02:00.678014Z"}], "thread_id": "Thread-4", "execution_time": 0.022928953170776367, "message": null, "adapter_response": {}, "unique_id": "test.asana.unique_asana__user_user_id"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2021-03-22T23:02:00.667672Z", "completed_at": "2021-03-22T23:02:00.678729Z"}, {"name": "execute", "started_at": "2021-03-22T23:02:00.689736Z", "completed_at": "2021-03-22T23:02:00.689748Z"}], "thread_id": "Thread-2", "execution_time": 0.023344993591308594, "message": null, "adapter_response": {}, "unique_id": "test.asana.not_null_asana__team_team_id"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2021-03-22T23:02:00.678334Z", "completed_at": "2021-03-22T23:02:00.691042Z"}, {"name": "execute", "started_at": "2021-03-22T23:02:00.691322Z", "completed_at": "2021-03-22T23:02:00.691330Z"}], "thread_id": "Thread-3", "execution_time": 0.014282941818237305, "message": null, "adapter_response": {}, "unique_id": "test.asana.unique_asana__team_team_id"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2021-03-22T23:02:00.258552Z", "completed_at": "2021-03-22T23:02:02.100458Z"}, {"name": "execute", "started_at": "2021-03-22T23:02:02.100787Z", "completed_at": "2021-03-22T23:02:02.100802Z"}], "thread_id": "Thread-1", "execution_time": 1.8437302112579346, "message": null, "adapter_response": {}, "unique_id": "model.asana.asana__daily_metrics"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2021-03-22T23:02:02.102804Z", "completed_at": "2021-03-22T23:02:02.125097Z"}, {"name": "execute", "started_at": "2021-03-22T23:02:02.125409Z", "completed_at": "2021-03-22T23:02:02.125422Z"}], "thread_id": "Thread-4", "execution_time": 0.023749113082885742, "message": null, "adapter_response": {}, "unique_id": "test.asana.not_null_asana__daily_metrics_date_day"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2021-03-22T23:02:02.103033Z", "completed_at": "2021-03-22T23:02:02.126128Z"}, {"name": "execute", "started_at": "2021-03-22T23:02:02.126410Z", "completed_at": "2021-03-22T23:02:02.126419Z"}], "thread_id": "Thread-2", "execution_time": 0.024374008178710938, "message": null, "adapter_response": {}, "unique_id": "test.asana.unique_asana__daily_metrics_date_day"}], "elapsed_time": 5.028863906860352, "args": {"log_format": "default", "write_json": true, "profiles_dir": "/Users/joseph.markiewicz/.dbt", "target": "bigquery", "use_cache": true, "compile": true, "version_check": true, "which": "generate", "rpc_method": "docs.generate"}} \ No newline at end of file diff --git a/integration_tests/.gitignore b/integration_tests/.gitignore new file mode 100644 index 0000000..64454d7 --- /dev/null +++ b/integration_tests/.gitignore @@ -0,0 +1,5 @@ + +target/ +dbt_modules/ +logs/ +.DS_Store \ No newline at end of file diff --git a/integration_tests/ci/sample.profiles.yml b/integration_tests/ci/sample.profiles.yml new file mode 100644 index 0000000..1a34ace --- /dev/null +++ b/integration_tests/ci/sample.profiles.yml @@ -0,0 +1,37 @@ + +# HEY! This file is used in the asana integrations tests with CircleCI. +# You should __NEVER__ check credentials into version control. Thanks for reading :) + +config: + send_anonymous_usage_stats: False + use_colors: True + +integration_tests: + target: snowflake + outputs: + redshift: + type: redshift + host: "{{ env_var('CI_REDSHIFT_DBT_HOST') }}" + user: "{{ env_var('CI_REDSHIFT_DBT_USER') }}" + pass: "{{ env_var('CI_REDSHIFT_DBT_PASS') }}" + dbname: "{{ env_var('CI_REDSHIFT_DBT_DBNAME') }}" + port: 5439 + schema: asana_integration_tests + threads: 8 + bigquery: + type: bigquery + method: service-account + keyfile: "{{ env_var('GCLOUD_SERVICE_KEY_PATH') }}" + project: 'dbt-package-testing' + schema: asana_integration_tests + threads: 8 + snowflake: + type: snowflake + account: "{{ env_var('CI_SNOWFLAKE_DBT_ACCOUNT') }}" + user: "{{ env_var('CI_SNOWFLAKE_DBT_USER') }}" + password: "{{ env_var('CI_SNOWFLAKE_DBT_PASS') }}" + role: "{{ env_var('CI_SNOWFLAKE_DBT_ROLE') }}" + database: "{{ env_var('CI_SNOWFLAKE_DBT_DATABASE') }}" + warehouse: "{{ env_var('CI_SNOWFLAKE_DBT_WAREHOUSE') }}" + schema: asana_integration_tests + threads: 8 \ No newline at end of file diff --git a/integration_tests/data/project_data.csv b/integration_tests/data/project_data.csv new file mode 100644 index 0000000..3ef4915 --- /dev/null +++ b/integration_tests/data/project_data.csv @@ -0,0 +1,17 @@ +id,_fivetran_deleted,_fivetran_synced,archived,color,created_at,current_status,due_date,modified_at,name,notes,owner_id,public,team_id,workspace_id +1142815262788834,FALSE,2021-03-22 14:24:47,FALSE,light-purple,2019-10-02 16:02:54,,,2020-02-27 17:26:31,75f4eda5755b226c07bdd5ef96624733,,,,1109585467162456,2104505001950 +339036947888917,FALSE,2021-03-22 14:24:31,FALSE,dark-green,2019-09-18 17:03:10,,,2020-02-27 17:25:56,3a704e169290367034b7a33b86a6c894,,,,1109585467162456,2104505001950 +1135568818569273,FALSE,2021-03-22 14:23:20,FALSE,light-blue,2019-08-14 4:26:19,,,2020-02-27 17:26:24,35a0789351b1e8bea1efce4b7e1b6d58,f2872ac60b5baf3040b01ae77f699889,,,1109585467162456,2104505001950 +339036947888916,FALSE,2021-03-22 14:24:21,FALSE,light-purple,2019-09-13 18:17:47,,,2019-09-21 22:37:42,5c7fac1b9516ef9ff51cbc30a6292a80,,2104505001945,,1130944552712711,2104505001950 +1123411555652103,FALSE,2021-03-22 14:21:52,FALSE,light-purple,2019-05-16 16:15:08,,,2019-05-16 16:15:10,d3d4421c105c43597ec6bc36c21c7a05,,2349446254454,,2527546068509,2104505001950 +994480050688368,FALSE,2021-03-22 14:21:46,FALSE,,2019-01-17 18:17:50,,,2019-09-21 22:27:55,ea50dd49e3f04fc0b08874465c0568ed,,2349446254454,,2527546068509,2104505001950 +339036947888918,FALSE,2021-03-22 14:21:26,FALSE,,2017-05-10 18:58:18,,,2019-09-21 22:27:28,44426ab2d0738bb56fec785a43de6e62,,2349446254454,,2527546068509,2104505001950 +339014487764325,FALSE,2021-03-22 14:21:25,FALSE,,2017-05-10 17:07:21,,,2019-09-21 22:27:08,72d7ec4b0127c0b11876d57b054b1201,,2349446254454,,2527546068509,2104505001950 +339036947888913,FALSE,2021-03-22 14:21:25,FALSE,,2017-05-10 18:30:46,,,2019-09-21 22:27:17,780efbde414f524f93e38332db3cc32d,,2349446254454,,2527546068509,2104505001950 +339282757803825,FALSE,2021-03-22 14:21:27,FALSE,,2017-05-10 22:25:19,,,2019-09-21 22:27:21,f32c3edaacea72c0ddb30ecf0135c4de,,2349446254454,,2527546068509,2104505001950 +338932209783787,FALSE,2021-03-22 14:21:24,FALSE,,2017-05-10 16:44:24,,,2019-09-21 22:27:15,f5e81e2cb4be3ae9d39fffc68d8af82c,,2349446254454,,2527546068509,2104505001950 +1119233841877068,FALSE,2021-03-22 14:21:51,FALSE,light-blue,2019-04-18 14:25:19,,,2019-04-18 14:25:21,df021e8d790008ba29b535b898402cd0,,2349446254454,,2527546068509,2104505001950 +1103976536247089,FALSE,2021-03-22 14:21:50,FALSE,,2019-01-28 6:14:18,,,2019-09-21 22:27:55,678884011246bebab096ff8b65f1b541,,2349446254454,,2527546068509,2104505001950 +1133789517942526,FALSE,2021-03-22 14:22:37,FALSE,dark-pink,2019-07-31 20:35:29,,2019-09-11 0:00:00,2020-02-27 17:26:23,d704501c4aadd255aa9245d2c926529d,d41d8cd98f00b204e9800998ecf8427e,338984235816349,,1109585467162456,2104505001950 +1127687633259843,FALSE,2021-03-22 14:21:58,FALSE,light-warm-gray,2019-06-19 5:04:03,,,2020-02-27 17:26:22,d704501c4aadd255aa9245d2c926529d,,338984235816349,,1109585467162456,2104505001950 +1138337102495418,FALSE,2021-03-22 14:24:06,FALSE,light-blue,2019-09-04 0:06:05,752e3db7344085cd1bdb19f63d241ca8,,2020-02-27 17:26:29,d704501c4aadd255aa9245d2c926529d,ccf334d79abdfd11da2d0cba23fb1108,338984235816349,,1109585467162456,2104505001950 \ No newline at end of file diff --git a/integration_tests/data/project_task_data.csv b/integration_tests/data/project_task_data.csv new file mode 100644 index 0000000..40e9d5f --- /dev/null +++ b/integration_tests/data/project_task_data.csv @@ -0,0 +1,3 @@ +project_id,task_id,_fivetran_synced +1145621382672906,1199893417793941,2021-02-04 02:24:35 +1134396676363546,1199893417793941,2021-02-04 02:24:35 \ No newline at end of file diff --git a/integration_tests/data/section_data.csv b/integration_tests/data/section_data.csv new file mode 100644 index 0000000..cd512b2 --- /dev/null +++ b/integration_tests/data/section_data.csv @@ -0,0 +1,14 @@ +id,_fivetran_synced,created_at,name,project_id +1140999307201834,2021-03-22 14:21:03,2019-09-21 22:25:26,05a821cdf4370ff1dd2fc1d4465fb23e,2417304153254 +1140999305179192,2021-03-22 14:21:03,2019-09-21 22:25:04,453486c410b442f5df1143816d2fa52f,2417304153254 +1140999422113332,2021-03-22 14:21:04,2019-09-21 22:25:04,453486c410b442f5df1143816d2fa52f,2693467581098 +1140999422891922,2021-03-22 14:21:06,2019-09-21 22:25:14,453486c410b442f5df1143816d2fa52f,2724895544714 +1140999306720518,2021-03-22 14:21:08,2019-09-21 22:25:21,453486c410b442f5df1143816d2fa52f,3931050316709 +1140999423455392,2021-03-22 14:21:11,2019-09-21 22:25:21,453486c410b442f5df1143816d2fa52f,3944161162427 +1140999424217513,2021-03-22 14:21:11,2019-09-21 22:25:27,453486c410b442f5df1143816d2fa52f,4021281497638 +1140999307427051,2021-03-22 14:21:14,2019-09-21 22:25:31,453486c410b442f5df1143816d2fa52f,4388687446288 +1140999307646897,2021-03-22 14:21:14,2019-09-21 22:25:36,98f770b0af18ca763421bac22b4b6805,4388687446288 +1140999307646896,2021-03-22 14:21:15,2019-09-21 22:25:35,453486c410b442f5df1143816d2fa52f,4404698904438 +1140999307926262,2021-03-22 14:21:16,2019-09-21 22:25:39,453486c410b442f5df1143816d2fa52f,4428993261541 +1140999428608188,2021-03-22 14:21:18,2019-09-21 22:26:19,23ce0eb7d180f3dc8391d4af48572d21,28303577354184 +1140999427143974,2021-03-22 14:21:18,2019-09-21 22:26:02,453486c410b442f5df1143816d2fa52f,28303577354184 \ No newline at end of file diff --git a/integration_tests/data/story_data.csv b/integration_tests/data/story_data.csv new file mode 100644 index 0000000..cf7c424 --- /dev/null +++ b/integration_tests/data/story_data.csv @@ -0,0 +1,4 @@ +id,_fivetran_synced,created_at,created_by_id,hearted,num_hearts,source,target_id,text,type +1199886380677330,2021-02-04 02:24:36,2021-02-04 00:22:02,1137799670337705,,0,web,1199893417793941,e4d11d32473e2f36be6c080f2d4ba59b,system +1199886372611183,2021-02-04 02:24:36,2021-02-04 00:11:27,1137799670337705,,0,web,1199893417793941,1d2d2a1e18edac3a1d519b7df24ec16e,system +1199886381437255,2021-02-04 02:24:36,2021-02-04 00:22:15,1137799670337705,,0,web,1199893417793941,533b581ae821186aa349ca7cd8f19179,system \ No newline at end of file diff --git a/integration_tests/data/tag_data.csv b/integration_tests/data/tag_data.csv new file mode 100644 index 0000000..9a5404b --- /dev/null +++ b/integration_tests/data/tag_data.csv @@ -0,0 +1,18 @@ +id,_fivetran_deleted,_fivetran_synced,color,created_at,message,name,notes,workspace_id +163915846063865,FALSE,2021-03-22 14:20:57,,2016-08-04 17:26:14,,54ce99fa85c92b1d87678436e956a2e8,,2104505001950 +155711202630775,FALSE,2021-03-22 14:20:57,,2016-07-14 23:52:42,,5b6cf869265c13af8566f192b4ab3d2a,,2104505001950 +205334637062213,FALSE,2021-03-22 14:20:57,,2016-11-01 15:28:12,,e7cc8f3f3aef4a5a55daa94bebb1b577,,2104505001950 +155711202630769,FALSE,2021-03-22 14:20:57,,2016-07-14 23:52:14,,221d2a347ebfc15d48665188f639d1cb,,2104505001950 +155711202630772,FALSE,2021-03-22 14:20:57,,2016-07-14 23:52:36,,7cb15e416d62919b1b40298324fbe30b,,2104505001950 +155711202630764,FALSE,2021-03-22 14:20:57,,2016-07-14 23:51:23,,87f9f735a1d36793ceaecd4e47124b63,,2104505001950 +155711202630767,FALSE,2021-03-22 14:20:57,,2016-07-14 23:51:31,,24f47cdbe9ddba774a7cc53e51d9032e,,2104505001950 +87008074978192,FALSE,2021-03-22 14:20:57,,2016-02-03 18:36:17,,11ff9f68afb6b8b5b8eda218d7c83a65,,2104505001950 +155711202630759,FALSE,2021-03-22 14:20:57,,2016-07-14 23:50:37,,e01aecb528730f3bfe10f9d57f1317bf,,2104505001950 +155711202630747,FALSE,2021-03-22 14:20:57,,2016-07-14 23:49:45,,21021ea0e52be8e9c599f4dff41e5be0,,2104505001950 +155711202630754,FALSE,2021-03-22 14:20:57,,2016-07-14 23:50:10,,bf78fa4160a6ed81e32eb6964d297cf9,,2104505001950 +155711202630745,FALSE,2021-03-22 14:20:57,,2016-07-14 23:49:31,,8c6384dda98d8864d00e29dc96179970,,2104505001950 +155711202630751,FALSE,2021-03-22 14:20:57,,2016-07-14 23:50:03,,cc8d68c551c4a9a6d5313e07de4deafd,,2104505001950 +1143821191383339,FALSE,2021-03-22 14:20:57,,2019-10-08 20:56:09,,464fe4ea0557b9c34b4ef33c135f6a08,,2104505001950 +148696288165443,FALSE,2021-03-22 14:20:57,,2016-06-27 17:44:23,,da50c2fb0cbcdf1b923b0ca88e4d49ee,,2104505001950 +146630888383184,FALSE,2021-03-22 14:20:57,,2016-06-21 19:34:34,,2ceea82aab3ac5bc623e79186b389481,,2104505001950 +148289869797755,FALSE,2021-03-22 14:20:57,,2016-06-25 0:54:37,,4007f46c835117c8761ebbaf8dd9969f,,2104505001950 \ No newline at end of file diff --git a/integration_tests/data/task_data.csv b/integration_tests/data/task_data.csv new file mode 100644 index 0000000..74ba5b0 --- /dev/null +++ b/integration_tests/data/task_data.csv @@ -0,0 +1,2 @@ +id,_fivetran_synced,assignee_id,assignee_status,completed,completed_at,completed_by_id,created_at,due_at,due_on,hearted,modified_at,name,notes,num_hearts,parent_id,start_on,workspace_id +1199893417793941,2021-02-04 02:24:35,1137799670337705,inbox,FALSE,,,2021-02-04 00:11:27,,,FALSE,2021-02-04 00:22:16,dab5f67e57087576d51dc40d79c517bc,,0,,,2104505001950 \ No newline at end of file diff --git a/integration_tests/data/task_follower_data.csv b/integration_tests/data/task_follower_data.csv new file mode 100644 index 0000000..3e063b9 --- /dev/null +++ b/integration_tests/data/task_follower_data.csv @@ -0,0 +1,2 @@ +task_id,user_id,_fivetran_synced +1199893417793941,1137799670337705,2021-02-04 02:24:35 \ No newline at end of file diff --git a/integration_tests/data/task_section_data.csv b/integration_tests/data/task_section_data.csv new file mode 100644 index 0000000..cb78fb6 --- /dev/null +++ b/integration_tests/data/task_section_data.csv @@ -0,0 +1,3 @@ +section_id,task_id,_fivetran_synced +1145638605769770,1199893417793941,2021-02-04 02:24:35 +1140999344898860,1199893417793941,2021-02-04 02:24:35 \ No newline at end of file diff --git a/integration_tests/data/task_tag_data.csv b/integration_tests/data/task_tag_data.csv new file mode 100644 index 0000000..650ee06 --- /dev/null +++ b/integration_tests/data/task_tag_data.csv @@ -0,0 +1,5 @@ +tag_id,task_id,_fivetran_synced +163915846063865,1199893417793941,2021-02-04 02:24:35 +155711202630775,1199893417793941,2021-02-04 02:24:35 +205334637062213,1199893417793941,2021-02-04 02:24:35 +155711202630769,1199893417793941,2021-02-04 02:24:35 \ No newline at end of file diff --git a/integration_tests/data/team_data.csv b/integration_tests/data/team_data.csv new file mode 100644 index 0000000..9c1f51d --- /dev/null +++ b/integration_tests/data/team_data.csv @@ -0,0 +1,26 @@ +id,_fivetran_deleted,_fivetran_synced,name,organization_id +1175290352849593,FALSE,2021-03-22 14:20:55,c8a88aee2acd5dbf76978f421dd70dee,2104505001950 +1165006878005385,FALSE,2021-03-22 14:20:55,042627cc066e7a21b9b0b16ddf92a089,2104505001950 +1175424836114178,FALSE,2021-03-22 14:20:55,b1861e61b41ba3fff4e74757d74c4e90,2104505001950 +1190726085138177,FALSE,2021-03-22 14:20:55,e545301c9a02e33abe2917f4e38405e5,2104505001950 +1163857948371041,FALSE,2021-03-22 14:20:55,53e0dbc06e48e3d381ac224fa8bae3df,2104505001950 +1175424836114180,FALSE,2021-03-22 14:20:55,54dd0f611e06ada1547a2fa4b5ac4e2c,2104505001950 +1145563915215145,FALSE,2021-03-22 14:20:55,7cb15e416d62919b1b40298324fbe30b,2104505001950 +1140675397099665,FALSE,2021-03-22 14:20:55,7d10c031056d08b88a3b4fcf25631682,2104505001950 +1131216624451101,FALSE,2021-03-22 14:20:55,f9d8847b3da721264efcd1aaeebacf13,2104505001950 +1127125465171855,FALSE,2021-03-22 14:20:55,99992776e80912d4b03c9540a2255c1a,2104505001950 +1131147572225013,FALSE,2021-03-22 14:20:55,1458f7aba7fa08b3920d2836d95ce518,2104505001950 +1130779217347436,FALSE,2021-03-22 14:20:55,d98628a5ec525dab008c2262ad6669d4,2104505001950 +1139142125254369,FALSE,2021-03-22 14:20:55,29d94732ca1696b21b3cdd2df5795dab,2104505001950 +1130944552712711,FALSE,2021-03-22 14:20:55,31ff7243543d02f6537c4a43a4a18ce5,2104505001950 +1125199132412749,FALSE,2021-03-22 14:20:55,36cbc41c1c121f2c68f5776a118ea027,2104505001950 +1126309244892859,FALSE,2021-03-22 14:20:55,cd32106bcb6de321930cf34574ea388c,2104505001950 +1126866959976249,FALSE,2021-03-22 14:20:55,deb10517653c255364175796ace3553f,2104505001950 +1126539229462849,FALSE,2021-03-22 14:20:55,5f3c8189bb84d2ea4061e757daa9561f,2104505001950 +1126687349073941,FALSE,2021-03-22 14:20:55,c482980d384a9d0e7bc39e1140270870,2104505001950 +1119148247636811,FALSE,2021-03-22 14:20:55,5231dee7156b84b0d1854de1a18dd169,2104505001950 +2527546068509,FALSE,2021-03-22 14:20:55,a7ace9d7b0d52558c00f7540af56ed57,2104505001950 +595727761265526,FALSE,2021-03-22 14:20:55,c46c77edb3c31643a9260161249548c5,2104505001950 +1109585467162456,FALSE,2021-03-22 14:20:55,7cb15e416d62919b1b40298324fbe30b,2104505001950 +1199557466985079,FALSE,2021-03-22 14:20:55,cd32106bcb6de321930cf34574ea388c,2104505001950 +1199576475848629,FALSE,2021-03-22 14:20:55,deb10517653c255364175796ace3553f,2104505001950 \ No newline at end of file diff --git a/integration_tests/data/user_data.csv b/integration_tests/data/user_data.csv new file mode 100644 index 0000000..3f9f30d --- /dev/null +++ b/integration_tests/data/user_data.csv @@ -0,0 +1,21 @@ +id,_fivetran_deleted,_fivetran_synced,email,name +1145566427371773,FALSE,2021-03-22 14:20:55,f8fca099b562801e43e671847ab63793,ba502a3057da84df93c1cee38be20d98 +1140679468933567,FALSE,2021-03-22 14:20:55,bf70064fcc790acb2640c9ea6658e7bf,784742a66a3a0c271feced5b149ff8db +1143584790050961,FALSE,2021-03-22 14:20:55,0e8eb57f064990dd67d18c6457d3b7e4,3c065e105ba1ffa3cbcb06ce6274a0b4 +1142174241683304,FALSE,2021-03-22 14:20:55,74ea05adc4b1b53d8ed38de392bb6ae8,eea1bd8603b800df2834f07d362a1998 +1140738529427046,FALSE,2021-03-22 14:20:55,0920cafb10279abbb850ccf42906f584,dc4bc96708073c555c91c4909f3e7da2 +874533751271912,FALSE,2021-03-22 14:20:55,c2045671bfeec500fa785e46bda796b0,c2045671bfeec500fa785e46bda796b0 +892002646367883,FALSE,2021-03-22 14:20:55,cc9681199b8d7962c787a49aad79b28a,c0639ca053b1211987bbbfd70e944bdc +1115060366861453,FALSE,2021-03-22 14:20:55,1d4af9f6d0045aac6abf03629535e875,b31671608b9a4785bf89d02a868391c9 +1109585316746864,FALSE,2021-03-22 14:20:55,b9adcab5121811121c2c3d0aaaf9b2e8,b6e6868d2c745b987fd6bac86965e201 +874533751409163,FALSE,2021-03-22 14:20:55,64b62aabe443ca4e937bbc5576179c88,64b62aabe443ca4e937bbc5576179c88 +892002646367901,FALSE,2021-03-22 14:20:55,368eaa391757666b80b48d45492d5a62,413685a28fcb6d760c825c796a0fcecf +1119270776407458,FALSE,2021-03-22 14:20:55,72af537b7a20cdc9125de91f5f6c9052,72af537b7a20cdc9125de91f5f6c9052 +1116354963772542,FALSE,2021-03-22 14:20:55,396b3a68984e542c218467d3354ce079,ac0df616713dcb9a53f04f106e973d81 +1139503248172020,FALSE,2021-03-22 14:20:55,5b4d3e849ff258a849b4cd99080097b6,527a7c3ec3b7736b0ebfa0b9e688cc4d +1139503169042444,FALSE,2021-03-22 14:20:55,52537af58083acd49f69acaadfa6552c,4b4826feea5d1e05d9596eaa04fe154b +1139330627337223,FALSE,2021-03-22 14:20:55,36e84c9f6590a44b2f10df1ecfc3649a,a8ddbe83b3c803beff4f04d48f6f5312 +388477550412326,FALSE,2021-03-22 14:20:55,2be7fdf344cc0e93a63089083b2c3a53,e549f53a2e1eb4b27b65b3a04c315f4e +648669515172057,FALSE,2021-03-22 14:20:55,76f8de0b00112335503a7d3734f52f79,00046eaa445242bb910688f9e1893b07 +350290010811012,FALSE,2021-03-22 14:20:55,46006954dd091c5dab1b6159a5e1524c,9605959095f1e07ba7628a197088bd70 +719802245514819,FALSE,2021-03-22 14:20:55,008e38cb1023225e4441f47ab5d01c70,a07d50fa47e3cfcad2a166929d680b45 \ No newline at end of file diff --git a/integration_tests/dbt_project.yml b/integration_tests/dbt_project.yml new file mode 100644 index 0000000..e07366c --- /dev/null +++ b/integration_tests/dbt_project.yml @@ -0,0 +1,92 @@ +config-version: 2 + +name: 'asana_integration_tests' +version: '0.3.0' + +require-dbt-version: [">=0.18.0", "<0.20.0"] +profile: 'integration_tests' + +vars: + asana_schema: asana_integration_tests + asana: + user: "{{ ref('stg_asana__user') }}" + project: "{{ ref('stg_asana__project') }}" + task: "{{ ref('stg_asana__task') }}" + story: "{{ ref('stg_asana__story') }}" + team: "{{ ref('stg_asana__team') }}" + tag: "{{ ref('stg_asana__tag') }}" + project_task: "{{ ref('stg_asana__project_task') }}" + task_follower: "{{ ref('stg_asana__task_follower') }}" + task_tag: "{{ ref('stg_asana__task_tag') }}" + section: "{{ ref('stg_asana__section') }}" + task_section: "{{ ref('stg_asana__task_section') }}" + + asana_source: + user: "{{ ref('user_data') }}" + project: "{{ ref('project_data') }}" + task: "{{ ref('task_data') }}" + story: "{{ ref('story_data') }}" + team: "{{ ref('team_data') }}" + tag: "{{ ref('tag_data') }}" + project_task: "{{ ref('project_task_data') }}" + task_follower: "{{ ref('task_follower_data') }}" + task_tag: "{{ ref('task_tag_data') }}" + section: "{{ ref('section_data') }}" + task_section: "{{ ref('task_section_data') }}" + +seeds: + +quote_columns: "{{ true if target.type == 'redshift' else false }}" + asana_integration_tests: + +column_types: + _fivetran_synced: timestamp + user_data: + +column_types: + id: "{{ 'int64' if target.type == 'bigquery' else 'bigint' }}" + project_data: + +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' }}" + task_data: + +column_types: + created_at: timestamp + completed_at: timestamp + 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' }}" + story_data: + +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' }}" + team_data: + +column_types: + id: "{{ 'int64' if target.type == 'bigquery' else 'bigint' }}" + organization_id: "{{ 'int64' if target.type == 'bigquery' else 'bigint' }}" + tag_data: + +column_types: + id: "{{ 'int64' if target.type == 'bigquery' else 'bigint' }}" + workspace_id: "{{ 'int64' if target.type == 'bigquery' else 'bigint' }}" + project_task_data: + +column_types: + project_id: "{{ 'int64' if target.type == 'bigquery' else 'bigint' }}" + task_id: "{{ 'int64' if target.type == 'bigquery' else 'bigint' }}" + task_follower_data: + +column_types: + user_id: "{{ 'int64' if target.type == 'bigquery' else 'bigint' }}" + task_id: "{{ 'int64' if target.type == 'bigquery' else 'bigint' }}" + task_tag_data: + +column_types: + tag_id: "{{ 'int64' if target.type == 'bigquery' else 'bigint' }}" + task_id: "{{ 'int64' if target.type == 'bigquery' else 'bigint' }}" + section_data: + +column_types: + id: "{{ 'int64' if target.type == 'bigquery' else 'bigint' }}" + project_id: "{{ 'int64' if target.type == 'bigquery' else 'bigint' }}" + 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 diff --git a/integration_tests/packages.yml b/integration_tests/packages.yml new file mode 100644 index 0000000..fdf93c1 --- /dev/null +++ b/integration_tests/packages.yml @@ -0,0 +1,2 @@ +packages: + - local: ../ \ No newline at end of file diff --git a/integration_tests/requirements.txt b/integration_tests/requirements.txt new file mode 100644 index 0000000..38e8ae6 --- /dev/null +++ b/integration_tests/requirements.txt @@ -0,0 +1 @@ +dbt==0.19.0 \ No newline at end of file diff --git a/macros/string_agg.sql b/macros/string_agg.sql deleted file mode 100644 index e8f7a73..0000000 --- a/macros/string_agg.sql +++ /dev/null @@ -1,20 +0,0 @@ -{% macro string_agg(field_to_agg, delimiter) -%} - -{{ adapter_macro('asana.string_agg', field_to_agg, delimiter) }} - -{%- endmacro %} - -{% macro default__string_agg(field_to_agg, delimiter) %} - string_agg({{ field_to_agg }}, {{ delimiter }}) - -{% endmacro %} - -{% macro snowflake__string_agg(field_to_agg, delimiter) %} - listagg({{ field_to_agg }}, {{ delimiter }}) - -{% endmacro %} - -{% macro redshift__string_agg(field_to_agg, delimiter) %} - listagg({{ field_to_agg }}, {{ delimiter }}) - -{% endmacro %} \ No newline at end of file diff --git a/models/asana.yml b/models/asana.yml index 9cbeae8..cb4a44e 100644 --- a/models/asana.yml +++ b/models/asana.yml @@ -3,7 +3,7 @@ version: 2 models: # enriched core object tables - - name: asana_task + - name: asana__task description: An enriched task table consisting of base task info + aggregated metrics and lists columns: @@ -125,7 +125,7 @@ models: description: Timestamp of when the parent task was created - - name: asana_user + - name: asana__user description: Enriched user table consisting of base user info + metrics around tasks and completions columns: @@ -160,7 +160,7 @@ models: description: Aggregated list of the projects that the user is currently assigned to or owns - - name: asana_project + - name: asana__project description: Table of projects' basic info enriched with metrics regarding tasks and completions columns: @@ -195,7 +195,7 @@ models: description: User-facing name of the project's team - name: is_archived - description: Boolean representing if the project has been arhcived in the UI + description: Boolean representing if the project has been archived in the UI - name: project_link description: URL formatted to bring you directly to the project in asana. @@ -231,7 +231,7 @@ models: description: Free-form textual description associated with project - - name: asana_team + - name: asana__team description: Enriched team table consisting of basic team info + task/completion metrics (note that teams can only act on tasks in projects) columns: @@ -268,12 +268,12 @@ models: - name: number_of_archived_projects description: Count of archived projects - - name: asana_tag + - name: asana__tag description: Table of tag basic info enriched with some task metrics. columns: - name: tag_id - description: System-gemerated unique ID for the tag + description: System-generated unique ID for the tag tests: - unique - not_null @@ -300,7 +300,7 @@ models: description: The avg number of days that completed tasks with this tag were open and assigned. - - name: asana_daily_metrics + - name: asana__daily_metrics description: Table of task metrics per each day columns: - name: date_day diff --git a/models/asana_daily_metrics.sql b/models/asana__daily_metrics.sql similarity index 96% rename from models/asana_daily_metrics.sql rename to models/asana__daily_metrics.sql index 9101810..2e496dd 100644 --- a/models/asana_daily_metrics.sql +++ b/models/asana__daily_metrics.sql @@ -1,7 +1,7 @@ with task as ( select * - from {{ ref('asana_task') }} + from {{ ref('asana__task') }} ), @@ -9,11 +9,11 @@ spine as ( {% if execute %} {% set first_date_query %} - select min( created_at ) as min_date from {{ ref('asana_task') }} + select min( created_at ) as min_date from {{ ref('asana__task') }} {% endset %} {% set first_date = run_query(first_date_query).columns[0][0]|string %} - {% else %} {% set first_date = "'2016-01-01'" %} + {% else %} {% set first_date = "2016-01-01" %} {% endif %} diff --git a/models/asana_project.sql b/models/asana__project.sql similarity index 96% rename from models/asana_project.sql rename to models/asana__project.sql index a2bfaea..2609bd2 100644 --- a/models/asana_project.sql +++ b/models/asana__project.sql @@ -1,7 +1,7 @@ with project_task_metrics as ( select * - from {{ ref('asana_project_task_metrics') }} + from {{ ref('int_asana__project_task_metrics') }} ), project as ( @@ -13,7 +13,7 @@ project as ( project_user as ( select * - from {{ ref('asana_project_user') }} + from {{ ref('int_asana__project_user') }} ), asana_user as ( diff --git a/models/asana_tag.sql b/models/asana__tag.sql similarity index 96% rename from models/asana_tag.sql rename to models/asana__tag.sql index 1ddc2e6..d35c47e 100644 --- a/models/asana_tag.sql +++ b/models/asana__tag.sql @@ -13,7 +13,7 @@ task_tag as ( task as ( select * - from {{ ref('asana_task') }} + from {{ ref('asana__task') }} where is_completed and tags is not null diff --git a/models/asana_task.sql b/models/asana__task.sql similarity index 86% rename from models/asana_task.sql rename to models/asana__task.sql index 82ad8e1..56bb564 100644 --- a/models/asana_task.sql +++ b/models/asana__task.sql @@ -6,51 +6,51 @@ with task as ( task_comments as ( select * - from {{ ref('asana_task_comments') }} + from {{ ref('int_asana__task_comments') }} ), task_followers as ( select * - from {{ ref('asana_task_followers') }} + from {{ ref('int_asana__task_followers') }} ), task_open_length as ( select * - from {{ ref('asana_task_open_length') }} + from {{ ref('int_asana__task_open_length') }} ), task_tags as ( select * - from {{ ref('asana_task_tags') }} + from {{ ref('int_asana__task_tags') }} ), task_assignee as ( select * - from {{ ref('asana_task_assignee') }} + from {{ ref('int_asana__task_assignee') }} where has_assignee ), task_projects as ( select * - from {{ ref('asana_task_projects') }} + from {{ ref('int_asana__task_projects') }} ), subtask_parent as ( select * - from {{ ref('asana_subtask_parent') }} + from {{ ref('int_asana__subtask_parent') }} ), task_first_modifier as ( select * - from {{ ref('asana_task_first_modifier') }} + from {{ ref('int_asana__task_first_modifier') }} ), task_join as ( diff --git a/models/asana_team.sql b/models/asana__team.sql similarity index 96% rename from models/asana_team.sql rename to models/asana__team.sql index 13b67f7..650fabc 100644 --- a/models/asana_team.sql +++ b/models/asana__team.sql @@ -6,7 +6,7 @@ with team as ( project as ( select * - from {{ ref('asana_project') }} + from {{ ref('asana__project') }} ), team_join as ( diff --git a/models/asana_user.sql b/models/asana__user.sql similarity index 94% rename from models/asana_user.sql rename to models/asana__user.sql index edfde52..daa0b40 100644 --- a/models/asana_user.sql +++ b/models/asana__user.sql @@ -1,7 +1,7 @@ with user_task_metrics as ( select * - from {{ ref('asana_user_task_metrics') }} + from {{ ref('int_asana__user_task_metrics') }} ), asana_user as ( @@ -12,7 +12,7 @@ asana_user as ( project_user as ( select * - from {{ ref('asana_project_user') }} + from {{ ref('int_asana__project_user') }} where currently_working_on or role = 'owner' ), diff --git a/models/intermediate/asana_project_task_metrics.sql b/models/intermediate/int_asana__project_task_metrics.sql similarity index 98% rename from models/intermediate/asana_project_task_metrics.sql rename to models/intermediate/int_asana__project_task_metrics.sql index f90ba3b..5870ec4 100644 --- a/models/intermediate/asana_project_task_metrics.sql +++ b/models/intermediate/int_asana__project_task_metrics.sql @@ -1,7 +1,7 @@ with task as ( select * - from {{ ref('asana_task') }} + from {{ ref('asana__task') }} ), diff --git a/models/intermediate/asana_project_user.sql b/models/intermediate/int_asana__project_user.sql similarity index 96% rename from models/intermediate/asana_project_user.sql rename to models/intermediate/int_asana__project_user.sql index d00d175..8c528d7 100644 --- a/models/intermediate/asana_project_user.sql +++ b/models/intermediate/int_asana__project_user.sql @@ -7,7 +7,7 @@ with project_tasks as ( assigned_tasks as ( select * - from {{ ref('asana_task_assignee') }} + from {{ ref('int_asana__task_assignee') }} where has_assignee ), diff --git a/models/intermediate/asana_subtask_parent.sql b/models/intermediate/int_asana__subtask_parent.sql similarity index 92% rename from models/intermediate/asana_subtask_parent.sql rename to models/intermediate/int_asana__subtask_parent.sql index 304e1f2..eb5c459 100644 --- a/models/intermediate/asana_subtask_parent.sql +++ b/models/intermediate/int_asana__subtask_parent.sql @@ -1,7 +1,7 @@ with task_assignee as ( select * - from {{ ref('asana_task_assignee') }} + from {{ ref('int_asana__task_assignee') }} ), diff --git a/models/intermediate/asana_task_assignee.sql b/models/intermediate/int_asana__task_assignee.sql similarity index 100% rename from models/intermediate/asana_task_assignee.sql rename to models/intermediate/int_asana__task_assignee.sql diff --git a/models/intermediate/asana_task_comments.sql b/models/intermediate/int_asana__task_comments.sql similarity index 92% rename from models/intermediate/asana_task_comments.sql rename to models/intermediate/int_asana__task_comments.sql index 5a04ef1..d1767cc 100644 --- a/models/intermediate/asana_task_comments.sql +++ b/models/intermediate/int_asana__task_comments.sql @@ -1,7 +1,7 @@ with comments as ( select * - from {{ ref('asana_task_story') }} + from {{ ref('int_asana__task_story') }} where comment_content is not null order by target_task_id, created_at asc diff --git a/models/intermediate/asana_task_first_modifier.sql b/models/intermediate/int_asana__task_first_modifier.sql similarity index 93% rename from models/intermediate/asana_task_first_modifier.sql rename to models/intermediate/int_asana__task_first_modifier.sql index 2a03073..99304ce 100644 --- a/models/intermediate/asana_task_first_modifier.sql +++ b/models/intermediate/int_asana__task_first_modifier.sql @@ -1,7 +1,7 @@ with story as ( select * - from {{ ref('asana_task_story') }} + from {{ ref('int_asana__task_story') }} where created_by_user_id is not null -- sometimes user id can be null in story. limit to ones with associated users ), diff --git a/models/intermediate/asana_task_followers.sql b/models/intermediate/int_asana__task_followers.sql similarity index 100% rename from models/intermediate/asana_task_followers.sql rename to models/intermediate/int_asana__task_followers.sql diff --git a/models/intermediate/asana_task_open_length.sql b/models/intermediate/int_asana__task_open_length.sql similarity index 96% rename from models/intermediate/asana_task_open_length.sql rename to models/intermediate/int_asana__task_open_length.sql index a92135e..799ebef 100644 --- a/models/intermediate/asana_task_open_length.sql +++ b/models/intermediate/int_asana__task_open_length.sql @@ -8,7 +8,7 @@ with task as ( story as ( select * - from {{ ref('asana_task_story') }} + from {{ ref('int_asana__task_story') }} ), diff --git a/models/intermediate/asana_task_projects.sql b/models/intermediate/int_asana__task_projects.sql similarity index 100% rename from models/intermediate/asana_task_projects.sql rename to models/intermediate/int_asana__task_projects.sql diff --git a/models/intermediate/asana_task_story.sql b/models/intermediate/int_asana__task_story.sql similarity index 100% rename from models/intermediate/asana_task_story.sql rename to models/intermediate/int_asana__task_story.sql diff --git a/models/intermediate/asana_task_tags.sql b/models/intermediate/int_asana__task_tags.sql similarity index 100% rename from models/intermediate/asana_task_tags.sql rename to models/intermediate/int_asana__task_tags.sql diff --git a/models/intermediate/asana_user_task_metrics.sql b/models/intermediate/int_asana__user_task_metrics.sql similarity index 95% rename from models/intermediate/asana_user_task_metrics.sql rename to models/intermediate/int_asana__user_task_metrics.sql index db1c2c7..b0ee9a6 100644 --- a/models/intermediate/asana_user_task_metrics.sql +++ b/models/intermediate/int_asana__user_task_metrics.sql @@ -1,7 +1,7 @@ with tasks as ( select * - from {{ ref('asana_task') }} + from {{ ref('asana__task') }} where assignee_user_id is not null ), diff --git a/models/intermediate/intermediate_asana.yml b/models/intermediate/intermediate_asana.yml index 40fc74b..eef0348 100644 --- a/models/intermediate/intermediate_asana.yml +++ b/models/intermediate/intermediate_asana.yml @@ -1,7 +1,7 @@ version: 2 models: - - name: asana_project_task_metrics + - name: int_asana__project_task_metrics description: Draws from (non-intermediate) ASANA_TASK to compute metrics about tasks in each project. columns: - name: project_id @@ -9,13 +9,17 @@ models: - unique - not_null - - name: asana_project_user + - name: int_asana__project_user description: Table of who is *working* on the project -- its owner + users assigned to it tasks tests: - - unique: - column_name: "project_id || '-' || user_id || '-' || role || '-' || currently_working_on" + - dbt_utils.unique_combination_of_columns: + combination_of_columns: + - project_id + - user_id + - role + - currently_working_on - - name: asana_subtask_parent + - name: int_asana__subtask_parent description: Combines subtasks + information regarding parent tasks columns: - name: subtask_id @@ -23,7 +27,7 @@ models: - unique - not_null - - name: asana_task_assignee + - name: int_asana__task_assignee description: Combines tasks + information regarding their assigned user columns: - name: task_id @@ -31,7 +35,7 @@ models: - unique - not_null - - name: asana_task_comments + - name: int_asana__task_comments description: Aggregates all comments on a task into a conversation + the number of comments columns: - name: task_id @@ -39,7 +43,7 @@ models: - unique - not_null - - name: asana_task_first_modifier + - name: int_asana__task_first_modifier description: Extracts the first person to make a story (modify) the task. A proxy for the task creator, since that's not provided. columns: - name: task_id @@ -47,7 +51,7 @@ models: - unique - not_null - - name: asana_task_followers + - name: int_asana__task_followers description: Aggregates a count of and a list of the names of the users who follow each task columns: - name: task_id @@ -55,7 +59,7 @@ models: - unique - not_null - - name: asana_task_open_length + - name: int_asana__task_open_length description: Computes the days that each task has spent open and assigned. columns: - name: task_id @@ -63,15 +67,15 @@ models: - unique - not_null - - name: asana_task_projects - description: Aggregates a count of and a list of the namesof the projects and sections that each task belongs to. + - name: int_asana__task_projects + description: Aggregates a count of and a list of the names of the projects and sections that each task belongs to. columns: - name: task_id tests: - unique - not_null - - name: asana_task_story + - name: int_asana__task_story description: Parses and categorizes asana stories into action types. Useful for looking at individual-task histories columns: - name: story_id @@ -85,7 +89,7 @@ models: - name: action_description description: The original pre-categorized content of the story - - name: asana_task_tags + - name: int_asana__task_tags description: Aggregates a count of and a list of the names of the tags attached to each task. columns: - name: task_id @@ -93,7 +97,7 @@ models: - unique - not_null - - name: asana_user_task_metrics + - name: int_asana__user_task_metrics description: Draws from (non-intermediate) ASANA_TASK to compute metrics about tasks for each user. columns: - name: user_id diff --git a/packages.yml b/packages.yml index b79243e..5f1b0c3 100644 --- a/packages.yml +++ b/packages.yml @@ -1,10 +1,3 @@ packages: - package: fivetran/asana_source - version: 0.2.0 - - - package: fishtown-analytics/dbt_utils - version: [">=0.6.0", "<0.7.0"] - - - git: "https://github.com/fivetran/dbt_fivetran_utils.git" - warn-unpinned: false - \ No newline at end of file + version: [">=0.3.0","<0.4.0"] \ No newline at end of file